How can non-coders use programs on Github?

40

8

Excuse my ignorance but I know nothing about coding. However, there have been many times when I have seen very interesting programs on GitHub. The problem is I have no idea how to use them. Without a setup file, I don't know what I am doing.

For example, I want to use the program developed here: https://github.com/tonton-pixel/unicopedia-plus. But when I download the files, I don't understand how to install this or get it functioning on my computer.

Please give very basic steps on how to use programs like this.

kandyman

Posted 2019-06-02T20:27:53.887

Reputation: 321

Question was closed 2019-06-03T13:47:15.113

2You don't have to be "coder" to use source code. One purpose for providing the source code is to allow the program to be built (or even ported) to other systems or platforms that don't already offer pre-built, ready-to-run executables. Typically you would need to install a toolchain to build the program from source code. – sawdust – 2019-06-02T22:17:06.630

What kind of toolchain? Are there generic ones that can build a range of programs from source code? – kandyman – 2019-06-02T22:19:52.663

A toolchain is typically language, operating system and architecture specific for both the host and target systems. I have only been using C toolchains (both native and cross), and know nothing about Java and Python build environments. For the site you specifically mentioned, the README file has a how-to Building section. – sawdust – 2019-06-02T22:42:18.887

Code on Github is really just source code or scripts. There is no one way to run anything on GitHub; each repo has it’s own needs. In your case the instructions are here in the README file in the repo. Or just download a release, unZip it and then just run it like any application.

– JakeGould – 2019-06-03T02:15:06.913

What OS are you on? Your question reads as very general but it’s actually very specific: If you are on macOS, just go to the “releases” link on the repo, download a recompiled release, unZip it and enjoy the program without compiling from source. Voting to close because a general question about using GitHub code—which is a massive repository—is fairly unanswerable.

– JakeGould – 2019-06-03T02:25:48.583

2This would wildly vary by the target OS and the programming language(s) used. – Mast – 2019-06-03T08:13:02.283

4@sawdust Eh, I'm not sure I agree. How easy it is to build a project varies wildly, but for most projects, understanding the norms of how stuff written for the target language or platform typically gets built or run is going to be at least helpful, and for some it's outright necessary. Unfortunately, that is knowledge that typically only coders who have used that language or platform are going to have. I've been a professional dev for years and sometimes still take a miserable day of trial-and-error and Googling to get a poorly-documented tool written in a language I don't know to work. – Mark Amery – 2019-06-03T11:39:10.330

@kandyman to be honest, getting started is not hard at all! Languages like Python were actually *designed* to be "learning" / "educational" languages.

– LogicalBranch – 2019-06-03T12:13:35.627

3@sawdust I just asked my mum (who isn't a "coder" but can use a PC fine enough) to follow your comment. She has the following questions: "What's a toolchain? "Is English ok for the language?" "What's an operating system?" "What's an architecture?" "What's a host?" "What's a target system?" "What's a C toolchain?" "What's native?" "What's cross?" "What's Java?" "What's Python?" "What's a build environment?" – RyanfaeScotland – 2019-06-03T12:34:39.463

2

@kandyman The project you have linked has published releaes. These are already compiled versions of the software that anyone can download and run. If there isn't an installer then you can typically move the software to any folder you like and just run it. (If it needs some special setup; there should be a readme file telling you what to do) You can find the releases for the linked project here: https://github.com/tonton-pixel/unicopedia-plus/releases

– Mischa – 2019-06-03T12:36:55.263

Answers

70

TL;DR

If you want actual instructions on installing this particular project, skip to the bottom of this answer. Everything beforehand applies more generally to any kind of project on GitHub.

A Quick Note On GitHub Releases

Sometimes the author(s) of a program will have pre-built releases on GitHub. Assuming these files exist, they can typically be accessed by appending "releases" to the project URL e.g. https://github.com/tonton-pixel/unicopedia-plus/releases. From the main project page, they can be accessed via the "Releases" link:

ex. GitHub Releases Link

GitHub Releases Link Example - Screenshot

Operating System Support

Not all projects are supported on all operating systems. Determining what platforms a project supports is part of the research mentioned below, even though it isn't explicitly stated. For what it's worth, projects in interpreted languages tend to be cross-platform while projects in compiled languages tend not to be (but this isn't an absolute given).


Overview

There have been many times when I have seen very interesting programs on Github. The problem is I have no idea how to use them.

As alluded to in the other answers to this question, the basic process is to do a small amount of research and see if there is any documentation for the project. This can give you the following insights:

  • Is it a program or a library?

    In short, libraries are collections of functions or data that typically cannot be used outside of other programs (they are not stand alone). Some libraries may come with tools to use them in a standalone manner or with other support tools to use outside the library itself, but this isn't common.

  • What language is it written in?

    Determining the programming language the software is written in can help determine what additional programs may be needed to support the project.

  • Is the program in a language that is compiled or is it scripted?

    The practical impact of this is that scripted languages essentially always need at least one additional program (their interpreter) to run. Compiled languages may need special tools (a toolchain) to turn them into executable programs or (ideally) may have already been made/compiled (perhaps by the author(s) on GitHub but also by someone else).

    Lists of compiled languages as well as scripted languages are available from Wikipedia.

  • Are there demonstrations regarding how to use the software?

    Whoever is creating the software will often provide a list of requirements for the project (i.e. any necessary support software) and/or demonstrations on how to use that software. This isn't universal, but again, this is typically found in the documentation (if any) for the project.

  • Are there links to any external websites?

    For a variety of reasons, not all the documentation or software needed for a program/project may be kept on GitHub. In this case, using Google to research the software or noting external links created by the author(s) can be extremely beneficial as they may contain clues (or actual instructions) on how to use that software.

It's probably worth mentioning that there is no generic solution for determining exactly what a project needs in order to be run successfully. As already noted, there will always be some amount of research required. But as you gain familiarity with the projects hosted on GitHub overall, patterns will emerge that will make using them eventually easier.


A Practical Example

For example, I want to use the program developed here: https://github.com/tonton-pixel/unicopedia-plus. But when I download the files, I don't understand how to install this or get it functioning on my computer.

  1. Is it a program or a library?

    From the GitHub page you linked to, the phrase "wrapped into one single app" in the project description and the accompanying screenshots seem to clearly indicate it has some kind of stand-alone functionality (so it's probably not a traditional library).

  2. What language is it in?

    Again, from the project description, it clearly states "built with Electron". If we click the link provided (marked "Electron"), we are taken to the Electron Framework homepage, which uses JavaScript, HTML, and CSS (as stated in its own description).

    So it would seem likely our application was built on "JavaScript, HTML, and CSS". This is seems to be confirmed by the .js and .json file extensions clearly visible in the primary file listings:

    JavaScript File Extensions Example - Screenshot

    Note that this is just an example of what to look for overall. GitHub can provide a breakdown of the language(s) used in the project (by percentage) if you click the colored bar below "commits", "branches", "releases", "contributors" and "View license" on the desktop interface:

    ex. GitHub Breakdown Bar (Before) GitHub Breakdown Bar Example 1 - Screenshot

    ex. GitHub Breakdown Bar (After) GitHub Breakdown Bar Example 2 - Screenshot


Note that this feature may not always be available. Two exceptions seem to include the mobile version of the site and some older browsers (i.e. clicking the bar may do nothing).


  1. Is JavaScript a compiled or scripted language?

    JavaScript is a scripted language per Wikipedia. Therefore, since the software is written in JavaScript, it needs an additional program to run (an interpreter, as previously stated).

    So how do you run JavaScript on your PC? This might actually be the hardest part to determine but we have some clues. If we scroll all the way down and read the Building section on the main GitHub project page:

    You'll need Node.js installed on your computer in order to build this app.

    Clicking the link marked "Node.js" takes us to the Node.js website, which has nice, friendly, not-at-all scary installers.

  2. Are there demonstrations regarding how to use the software?

    If we read the next part of the Building section, we find these instructions:

 git clone https://github.com/tonton-pixel/unicopedia-plus
 cd unicopedia-plus
 npm install
 npm start

Text Instructions

As a small note, whenever you see text instructions, this typically means you need to use a terminal or command window and type the instructions given. On Windows you can use cmd.exe (Start Menu → Search → cmdEnter). Any Mac or Linux distribution should have prominent links to relevant terminal applications.

ex. Windows Command Window (cmd.exe)

Windows Command Window CMD - Screenshot

Also, before following any instructions, you will want to install all the prerequisite software. In this instance, this means installing Node.js first. The option to add node and npm to your path (important for Steps 3 and 4) should already be selected when using the Windows installer.


If you get an error about npm not being recognized in Windows (Step 3 below):

  • Close the current command window, open a new one and try again.

  • You may need to log out and log in again to reload your environment variables.

  • You may still need to add npm to your Windows Path manually, assuming something was mis-marked during your Node.js installation.

Any solutions for similar issues on Mac/Linux should be readily available online.


Installing Unicopedia Plus

Following the steps given on the GitHub project page:

  1. We can ignore git clone https://github.com/tonton-pixel/unicopedia-plus which simply tells us to download the files using git, the program GitHub is named after. We, as normal non-programmers, will simply click the big green "Clone or Download" button and select "Download ZIP":

GitHub Clone or Download - Screenshot

  1. After we extract our .zip file with a program such as 7zip, we are ready for our next instruction cd unicopedia-plus. In this case, cd is a command to switch folders ("change directory") and tells us we need to navigate to the extracted unicopedia-plus folder (this should contain main.js).

It's important to note here that the portion after cd may not be "just" unicopedia-plus.

The second portion may be different depending on:

  • Where the command window/terminal is launched from.

  • Where you stored/extracted your .zip file.

  • What the file/folder you downloaded is actually called (e.g. "unicopedia-plus-master" for the .zip version).

The solution to this is to determine the full path to the "proper" unicopedia-plus directory and use that instead e.g. cd C:\some\path\to\unicopedia-plus-folder for Windows or cd /some/path/to/unicopedia-plus-folder for Mac/Linux.


  1. The next instruction we encounter is npm install. To skip any trouble, we have already installed Node.js with npm added to our path (above) and navigated to the proper unicopedia-plus folder (the one containing main.js) in our command window/terminal (the previous step).

    So we simply need to type npm install and let the setup/build process do its thing (like a normal installer).

    Note that there may be some additional requirements that are downloaded and installed automatically during this process, so make sure to have a working internet connection. You will be returned to the command line when installation is finished. Be patient. =)


We have also (hypothetically) done some research and found that npm is the "node package manager", a command-line utility included with Node.js. npm is used for "interacting" with various Node.js projects such as ours, which includes installation, management and an interface to work with anything we've installed.


  1. Start the program with with the final command npm start. You should get the graphical user interface shown on the GitHub page. This seemed to take around 30 seconds or so during testing, so again, be patient. =)

On Windows, you can create a batch file to start this project like so:

1. Create a new text file.

2. Type something similar to the following:

    cd "C:\path\to\unicopedia-plus-folder"
    npm start

3. Save this file and change the file extension from .txt to .bat.

4. Double-click the .bat (batch) file when you wish to start the graphical user interface for the project.

You can substitute C:\path\to\nodejs\npm.cmd start in place of npm start if you run into issues.


Anaksunaman

Posted 2019-06-02T20:27:53.887

Reputation: 9 278

7

Or if you are on macOS, just go to the “releases” link on the repo, download a recompiled release, unZip it and enjoy the program without compiling from source.

– JakeGould – 2019-06-03T02:24:29.103

24This is way too complicated for someone who says "without a setup file, I'm lost". But that's just the way it is, so have an upvote. I've been a coder for 30+ years, and sometimes I still need several hours (or even give up) on projects that use an unfamiliar (to me) toolchain or have a lot of dependencies. In some cases I have to tweak a bit of the code to get it to compile/run on my system. As a standard user, checking the "Releases" tab, or trying to find a website that provides a compiled version (with all caveats ...) is more or less your only option. – Guntram Blohm supports Monica – 2019-06-03T07:31:44.893

2Thank you so much for this detailed answer. I had no idea it could be this complicated, but I really appreciate the time you took to put this answer together. I will read through it carefully and do my best to follow the instructions you have provided. Much appreciated. – kandyman – 2019-06-03T08:17:28.183

1

@kandyman Your welcome. =) I would say the important thing is not to be too daunted. I didn't mention it in my answer but sites like readthedocs.io (which hosts open source project documentation), as well any personal sites hosted by the author(s) can be a life saver. There are also plenty of useful patterns. For instance, npm has rough equivalents in other interpreted languages such as Python (pip) and Ruby (gem). Compiled languages may have Integrated Development Environments available and files that can help you build projects.

– Anaksunaman – 2019-06-03T08:34:24.020

2Also note that for the What language is it in? part, you can click on the colored bar and get details (e.g. Unicodepedia: 80.1% JavaScript, 17.9% HTML, 2.0% CSS) – schnaader – 2019-06-03T09:21:00.470

4"Use the release if it exists" seems like the first thing one should try, but somehow you managed to describe it using manual URL manipulation?! On the projects main page there is a link to releases if they exist. – kutschkem – 2019-06-03T09:36:11.623

2@Anaksunaman I managed to get the program built and working using your instructions. Thanks again for your great post ! I also got the batch file working too! – kandyman – 2019-06-03T18:17:13.600

@kandyman No problem. =P Great to hear that everything went well. That's awesome. =) – Anaksunaman – 2019-06-03T18:55:53.303

4

The app on your example runs on electron so you should Google how to run such an app and you should find the official documentation.

For your example, I have done it for you and found the documentation, go to: https://electronjs.org/docs/tutorial/first-app#trying-this-example

Also you will find that the readme file is quite helpful too in some cases.

I have not given I step by step instruction to your example but a more general answer so as to enable you do such things your self in the future.

helper

Posted 2019-06-02T20:27:53.887

Reputation: 201

Electron is installed and built automatically via the build instructions, meaning it be ignored if we are only interested in using this github project. – Jesse Reza Khorasanee – 2019-06-03T12:14:44.143

0

Look for a Building or Installing section of the github project.

In this case, they are:

Build Instructions for unicopedia-plus

You'll need Node.js installed on your computer in order to build this app.

git clone https://github.com/tonton-pixel/unicopedia-plus
cd unicopedia-plus
npm install
npm start

How to follow the above instructions

  1. Install git, a core tool if working with github
  2. Go to nodejs.org, download and install node.js
  3. Execute the above commands in terminal (or command prompt). Copy and pasting them all at once should work fine
  4. Follow the instructions printed in terminal if any exist

Most projects will fundamentally follow the above three steps for build/installation.

If there are not easy to decipher Build or Installation instructions to be found on the github project, it's likely that the software isn't yet ready for anything more than developer use.

Jesse Reza Khorasanee

Posted 2019-06-02T20:27:53.887

Reputation: 151

1The instructions fail to address that you'll also need git installed to execute the first command. – Džuris – 2019-06-03T12:54:09.413

Sorry @Džuris you're right I overlooked that. Updated now. – Jesse Reza Khorasanee – 2019-06-03T22:59:42.040