Online platform for The Resistance! Play the game.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Other useful resources:
If you intend on contributing, make a fork of ProAvalon.
Git clone a copy of the code:
$ cd path/to/your/folder
# Replace with your fork if applicable
$ git clone https://github.com/vck3000/ProAvalon.git
.env.example
and name it .env
.$ cp .env.example .env
$ yarn
docker-compose up
. Ensure Docker is running.yarn dev
.AWS_ACCESS_KEY_ID
and access key into AWS_SECRET_ACCESS_KEY
in the .env
file.proavalon
in MinIO.victoria-metrics
a. From the main menu: Connections -> Data sources -> Add new data source.
b. Add a Prometheus time series database.
c. Under Connection, paste http://victoria-metrics:8428
then Save & test.Ctrl+C
.Ctrl+C
.docker-compose down
.yarn test
.yarn test:watch
.yarn test:coverage
.On the registration page, create an account ProNub with any password.
Alternatively, you can edit the admins file under /src/modsadmins/admins.ts
and not stage it in your future commits.
This is a Node.js express application that is currently deployed on Digital Ocean. There are three stages: Production (live server), Development/staging (master branch of this repo) and other Heroku servers for each pull request.
When a pull request is merged to master, GitHub Actions will trigger and produce docker containers. When approved, an admin will promote it to the production server.
User authentication is handled by Passport.js and client-server communication is handled by Socket.io. They are combined by passport.socketio.
The server is run from app.js
.
Routes are all under the routes
folder. index.js
is the upper most layer (most broad).
After users log in, they are redirected to the lobby page where sockets/sockets.js
handles socket communication.
All scripts and stylesheets are under the assets folder.lobby.ejs
is perhaps the most complicated. I have broken the file down into smaller pieces and required them at the bottom of lobby.ejs
.
There is a server-wide cache of 30 minutes for all files. This helps cut down on data usage, while also solving the issue of certain iPhone devices "flashing" every game iteration (the browser would re-download each image every time before caching was introduced).
There is also a middleware
folder which contains useful functions mainly for authentication purposes on forums and profiles.
Other useful global functions can be found under the myFunctions
folder.
When contributing, please make a new branch and then make pull request. If you require any help, feel free to make an issue, or contact an admin through Discord or through the server.