This is the source code powering UltiMafia.com, a website built to provide online chat mafia to all.
WIP
The EZ setup guide is the best guide if you are a new contributor. If you have any questions or concerns please feel free to ask in our Discord server.
Before building your developer environment locally, you will need the following set up:
- NVM (should be provided with your Github Codespace)
- Firebase
- Recaptha
For the easiest set up, use the totalsetup.sh
script in the root project directory:
$ bash totalsetup.sh
If you want to perform your setup manually, follow these setups:
-
Install the correct version of Node and NPM and set them to default
$ source ~/nvm/nvm.sh $ nvm install 14.16.0 $ nvm use 14.16.0 $ nvm alias default 14.16.0
-
Download project root and front-end dependencies
$ npm i -g pm2 $ npm install $ cd react_main $ npm install
-
Build the front-end
$ cd react_main $ npm run build $ rm -rf build_public $ cp -r build build_public $ rm -rf build $ cd ..
You can run the
build.sh
inreact_main
script to automatically run these comands. -
Build and deploy the backend
$ docker-compose up -d --build
Use
docker-compose build
if you wish to build without running.
There is a clean-up script you can run from the root project directory to remove all build files:
$ bash cleanup.sh
NOTE: do NOT use sudo
when running any scripts or commands unless you are sure you know what you're doing. Running sudo
is linked to many issues including permission problems.
If you ran totalsetup.sh
, the project will automatically run. Otherwise, you can run npm start
from the root project directory. To stop, simply run npm stop
. The site will be accessible at http://127.0.0.1:80 (localhost).
If you are able to briefly see a loading graphic when attempting to enter the site before a blank screen, it is most likely due to a bug for the dev environment in which the launch screen will not load unless you are logged in.
To fix this:
- Go to http://127.0.0.1:80/auth/login
- Sign-up with a new account. If you have already created an account in the past for your local build, you may use the same one to login instead.
Once you log in, you should be redirected to the lobby page and the site should function properly.
- Fork the repository
- Make your changes to your forked repository
- Open a pull request on the master branch of this repository
- Perform a final test on the main site after merge into master
If you are a beginner, please follow the easy setup guide and ask in Discord if you are stuck at any step.
-OBSOLETE- This is for running your own development environment locally. You can still use this if you'd like by following the old beginner's guide, but the easiest way is now the docker guide linked above.
-
Install node.js, and set the version to
v14.16.0
. -
Install MongoDB and Redis and run them as services. You can refer to this guide for setting up MongoDB and Redis via Docker.
-
Clone your forked repository. Replace "UltiMafia" with your github username.
git clone https://github.com/UltiMafia/Ultimafia.git
- Install pm2 globally.
npm i -g pm2
- Install backend node modules.
cd Ultimafia
npm install
- Install frontend node modules.
cd react_main
npm install
-
Create
.env
file for the server underUltimafia/.env
, and copy this example file -
Create a
.env
file for the React app underUltimafia/react_main/.env
and copy this example file -
Refer to this guide for retrieving your own test API keys for Firebase and reCAPTCHA.
- Start the backend server
cd Ultimafia
npm start
- Start the frontend React app
cd react_main
npm start
This site is based on the code provided by r3ndd from this repository and is used under the Creative Commons license (Attribution-NonCommercial-ShareAlike 4.0 International). It has been changed and is not affiliated with the creator or the website that uses the original repository's code.
Music is by Fred, check out his youtube @fredthemontymole