-
-
Notifications
You must be signed in to change notification settings - Fork 12
Tutorials ― setup
It should run on most operating systems that are capable of running Node.js, but the following have been tested:
- Windows 10
- Debian 9 (GNU/Linux)
- Fedora 30 (GNU/Linux)
- Manjaro 18.1 (GNU/Linux)
You will need Node.js and the yarn package manager.
These are ballpark figures, but a recommended minimum would be the following (for a dedicated / virtual server):
- 1 vCPU
- 1GB RAM
- 1GB storage
- High bandwidth network (preferably gigabit)
This will support up to 100 marbles on a decent sized map.
The $4 droplet does not seem to have enough memory to run it, unfortunately. The $6 droplet on DigitalOcean suffices, but more CPU and RAM are welcome for larger maps & player counts.
The Discord API is optional for development (config.discord.enabled
), but we would recommend setting it up for the full experience. You can create and configure your project here: https://discordapp.com/developers/applications/
Be sure to add the following to your OAuth2 redirects:
Start off by downloading or cloning this repository to any location on your device.
Before you can run the project, you must first download any dependencies using the following command
yarn
. This will automatically download and install any required dependencies. If you receive any errors during this step, please refer to the module that fails to install. (better-sqlite3
will likely fail if you are installing it on Windows, troubleshooting steps can be found here)
You must also set up configuration files. The project comes with examples that you must copy over and remove the example-part of the filename from e.g. config.user.example.js
becomes config.user.js
.
You must do so in the following locations:
\src\server
\src\client
Most variables are self explanatory.
For the server configuration specifically, most Discord values are required.
NOTE: Not all variables are currently used.
As an additional step, client scripts are bundled using webpack. There are several benefits to doing this, but explaining those is out of the scope of this tutorial. Simply run yarn build
to bundle all client scripts.
You will need to run this every time you change a client script and wish to test your changes.
If you have followed all steps above, you should be ready to start the application! Start it using the following command: yarn start
. This will launch a web server on port 3004
(unless you have changed this in the config file) which you can reach at localhost:3004
in the web browser of your liking.
To make sure websockets work correctly when using nginx, add the following to your location /
section:
proxy_http_version 1.1;
proxy_read_timeout 3600s;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;