Skip to content

Whos-Who/backend

Repository files navigation

Whos Who

Backend repository for Whos Who, our CS3216 Assignment 3

Table of content

Environment Set up

Installing Dependencies

  1. Install Node V12 and Docker
  2. Clone this repository to your directory
  3. Navigate into the backend directory
  4. Run npm install
  5. To run server with nodemon, run npm run dev
  6. Alternatively, you can run npm start to run without nodemon

Docker Set Up

  1. Change rename .env.example to .env, which will be used to set the environment variables
  2. Run docker-compose up to build docker image and run docker container for PostgreSQL Database
  3. Hit Ctrl-c to exit
  4. To remove your container, run docker compose down

Running Redis locally

  1. Make sure your docker container is running, if not set up yet, refer to the above section
  2. Install redis-cli on you terminal
  3. After successfully installing, run redis-cli, enter PING
  4. If your Redis Server replies with PONG, your Redis Server is running correctly

Running PostgreSQL locally

  1. Make sure your docker container is running, if not set up yet, refer to the above section
  2. You can use a Database Management tool like PgAdmin or SequelPro to connect to the local PostgreSQL
  3. Connect to the server with the following settings:
  • Database: assignment-3
  • Host: localhost
  • Port: 5432

Running migrations

To update your local database with the latest schemas, run npx sequelize-cli db:migrate

Running seed files

To update your local database with the latest seed data, like default decks, run npx sequelize-cli db:seed:all

Linting, Formatting and CI Check

  1. Install Prettier extension on VSCode
  2. Set it as your code formatter and set it to format document on save (which will make things easier)
  3. Code should be auto-formatted on save
  4. ESlint is installed to maintain some code style (used the lowest requirement), which adheres to the Prettier style formatter
  5. CI check enforced just for linting

Documentation

REST API endpoints

REST API

Socket Listeners and Emitters

Socket Listeners and Emitters

Redis Key-value mappings

Redis key-value storage

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published