Skip to content
Merged
18 changes: 16 additions & 2 deletions developer_docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ _Note_: The installation steps assume you are using a Unix-like shell. If you ar
* For Windows and Linux: [MongoDB Installation](https://docs.mongodb.com/manual/installation/)
7. `$ cp .env.example .env`
8. (Optional) Update `.env` with necessary keys to enable certain app behaviors, i.e. add Github ID and Github Secret if you want to be able to log in with Github.
9. `$ npm run fetch-examples` - this downloads the example sketches into a user called 'p5'
9. `$ npm run fetch-examples` - this downloads the example sketches into a user called 'p5'. Note that you need to configure your Github API, details can be found in the [Github API Configuration] section(https://github.com/vulongphan/p5.js-web-editor/blob/fix/installation-guide-update/developer_docs/installation.md#github-api-configuration)
10. `$ npm start`
11. Navigate to [http://localhost:8000](http://localhost:8000) in your browser
12. Install the [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en)
Expand All @@ -47,7 +47,7 @@ Note that this takes up a significant amount of space on your machine. Make sure
3. `$ docker-compose -f docker-compose-development.yml build`
4. `$ cp .env.example .env`
5. (Optional) Update `.env` with necessary keys to enable certain app behavoirs, i.e. add Github ID and Github Secret if you want to be able to log in with Github.
6. `$ docker-compose -f docker-compose-development.yml run --rm app npm run fetch-examples`
6. `$ docker-compose -f docker-compose-development.yml run --rm app npm run fetch-examples` - note that you need to configure your Github API, details can be found in the [Github API Configuration] section(https://github.com/vulongphan/p5.js-web-editor/blob/fix/installation-guide-update/developer_docs/installation.md#github-api-configuration)

Now, anytime you wish to start the server with its dependencies, you can run:

Expand Down Expand Up @@ -80,3 +80,17 @@ name, you can also set it using this variable. I.e.:
For more information on using a custom domain, see this documentation link:

http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingCustomURLs

## Github API Configuration

In this application, Github Credentials are used for:
* Authentication with GitHub
* Importing the p5.js examples to your local database
* Rendering the 404 pages

If you are working on a part of the application that requires one of the above uses then you will need to get GitHub API credentials.

An overview about Github API can be found [here](https://developer.github.com/v3/).

When you go to your Developers Settings, you will see two types of Apps `Github Apps` and `OAuth Apps`. For this application, you should create an OAuth App since some Github API calls will not accept your Credentials if you create a Github App. One of the key differences between the two is that while `Oauth Apps` act on your behalf, `Github Apps` act on its own. More differences between these two can be found [here](https://docs.github.com/en/free-pro-team@latest/developers/apps/differences-between-github-apps-and-oauth-apps)