Backend repository for Whos Who, our CS3216 Assignment 3
- Install Node V12 and Docker
- Clone this repository to your directory
- Navigate into the
backend
directory - Run
npm install
- To run server with
nodemon
, runnpm run dev
- Alternatively, you can run
npm start
to run withoutnodemon
- Change rename
.env.example
to.env
, which will be used to set the environment variables - Run
docker-compose up
to build docker image and run docker container for PostgreSQL Database - Hit Ctrl-c to exit
- To remove your container, run
docker compose down
- Make sure your docker container is running, if not set up yet, refer to the above section
- Install
redis-cli
on you terminal - After successfully installing, run
redis-cli
, enterPING
- If your Redis Server replies with
PONG
, your Redis Server is running correctly
- Make sure your docker container is running, if not set up yet, refer to the above section
- You can use a Database Management tool like PgAdmin or SequelPro to connect to the local PostgreSQL
- Connect to the server with the following settings:
- Database: assignment-3
- Host: localhost
- Port: 5432
To update your local database with the latest schemas, run npx sequelize-cli db:migrate
To update your local database with the latest seed data, like default decks, run npx sequelize-cli db:seed:all
- Install Prettier extension on VSCode
- Set it as your code formatter and set it to format document on save (which will make things easier)
- Code should be auto-formatted on save
- ESlint is installed to maintain some code style (used the lowest requirement), which adheres to the Prettier style formatter
- CI check enforced just for linting