Skip to content

Getting Started

reeved edited this page Mar 25, 2021 · 5 revisions

Prerequisites

On Windows?
We recommend using WSL for its ease of use when using Node.JS as well as Git for this project. You can follow this guide to install WSL 2, as well as set up Visual Studio Code, Git and Node.JS on your Windows system.

Not on Windows?
No worries! Follow the steps below to install the required tools for this project.

1. Node.JS and NPM

This project is built using the Node JS platform. Please follow the relevant instructions to install it on the platform of your choice.

Tested Version: We can only guarantee stability on the current LTS Release of Node JS. At the time of writing, this is v14.16.0 and NPM v6.14.11.

2. Git

To contribute to this project, please use Git. You can install it on the platform of your choice by visiting their website.

Tested Version: v2.31.0

3. Visual Studio Code and Prettier

The text editor of choice for this project is Visual Studio Code. This is because it incorporates nicely with WSL and Git. VS Code also has an extension called Prettier that can be used to format your code according to our conventions automatically. You can install VS Code on your platform here and install the Prettier extension on VS Code here.

Prettier should automatically recognise our .prettierrc config file when you work on this project. To use it, you can follow this guide to learn how to run Prettier. We recommend enabling the Format on Save option to make your life easier!

Running this Project

First, clone the repository and open the project directory:

git clone git@github.com:Mafia-Hands/Mafia.git
cd Mafia

To run this application locally, the frontend and backend must run together. You can do it like so:

Frontend:

cd frontend
npm install
npm start

Backend:

cd backend
npm install
npm start

Note: You do not need to run npm install every time. Only when a new package is added.

Note: Ensure that the socket.js file (frontend > src > socket.js) points to your local server by uncommenting the necessary line. If you don't want to run the server locally, you can let it point to our hosted server. However, any changes you make to the server will not be reflected unless it has been accepted into our Upstream codebase.

Clone this wiki locally