Info for installation

This commit is contained in:
Ruben van de Ven 2020-11-02 15:11:27 +01:00
parent 6f2095eede
commit 07c4f9e899
3 changed files with 38 additions and 12 deletions

View file

@ -7,30 +7,29 @@ Follow these instructions to set up your development environment, which you need
_Note_: The installation steps assume you are using a Unix-like shell. If you are using Windows, you will need to use `copy` instead of `cp`.
1. Install Node.js. The recommended way is to Node through [nvm](https://github.com/nvm-sh/nvm). You can also install [node.js](https://nodejs.org/download/release/v12.16.1/) version 12.16.1 directly from the Node.js website.
2. [Fork](https://help.github.com/articles/fork-a-repo) the [p5.js Web Editor repository](https://github.com/processing/p5.js-web-editor) into your own GitHub account.
3. [Clone](https://help.github.com/articles/cloning-a-repository/) your new fork of the repository from GitHub onto your local computer.
3. [Clone](https://help.github.com/articles/cloning-a-repository/) this repository using git onto your local computer.
```
$ git clone https://github.com/YOUR_USERNAME/p5.js-web-editor.git
$ git clone https://git.rubenvandeven.com/r/p5.js-web-editor/
```
4. If you are using nvm, run `$ nvm use` to set your Node version to 12.16.1
5. Navigate into the project folder and install all its necessary dependencies with npm.
```
$ cd p5.js-web-editor
$ npm install
```
6. Install MongoDB and make sure it is running
* For Mac OSX with [homebrew](http://brew.sh/): `brew tap mongodb/brew` then `brew install mongodb-community` and finally start the server with `brew services start mongodb-community` or you can visit the installation guide here [Installation Guide For MacOS](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/)
* 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'
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)
13. Open and close the Redux DevTools using `ctrl+h`, and move them with `ctrl+w`
8. (For DigitalPlayground) use provided .env file
9. Run `npm run build:server && npm run build:client` to make sure all script are built and bundled.
11. use the provided service file to start the server through systemd
- edit `p5.js-web-editor.service` so it has the right files & folders according to you installation
- `cp /home/dp/p5.js-web-editor/p5.js-web-editor.service /etc/systemd/system/`
- `systemctl deamon-reload`
- `systemctl start p5.js-web-editor.service`
12. (Optionally) Set the `PORT` and `NODE_PORT` variables in the p5.js-web-editor.service and .env files to the desired port OR use an apache server (or something else) as https-proxy server. For an example see `digitalplayground-apache.conf`.
## Docker Installation

View file

@ -0,0 +1,26 @@
# Forward to IPv6-only host
<VirtualHost *:80>
Servername dp.rubenvandeven.com
RewriteEngine On
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
Servername dp.rubenvandeven.com
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://digitalplayground.rubenvandeven.com:8000/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) http://digitalplayground.rubenvandeven.com:8000/$1 [P,L]
ProxyPass / http://digitalplayground.rubenvandeven.com:8000/
ProxyPassReverse / http://digitalplayground.rubenvandeven.com:8000/
ProxyPreserveHost On
SSLCertificateFile /etc/letsencrypt/live/dp.rubenvandeven.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/dp.rubenvandeven.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

View file

@ -3,6 +3,7 @@ Description=p5.js web editor
After=network.target
[Service]
Environment=NODE_PORT=8000
Type=simple
User=YOUR_USER
EnvironmentFile=/home/YOUR_USER/p5.js-web-editor/.env