Skip to content

CS3219-AY2526Sem1/cs3219-ay2526s1-project-g01

 
 

Repository files navigation

Review Assignment Due Date

CS3219 Project (PeerPrep) - AY2526S1

Group: G01

Note:

  • You are required to develop individual microservices within separate folders within this repository.
  • The teaching team should be given access to the repositories as we may require viewing the history of the repository in case of any disputes or disagreements.

Set-up

Initial

  1. Run npm run install:all to install all needed node-modules in various service/frontend
  2. Set-up the respective .env file in various service and at root by referring to the sample file

Local DB

  1. Change the .env file at user-service to ENV=local
  2. Run npm run localdb to start up the local mongoDB and mongo-express
  3. Run npm run stop:docker to stop the local mongoDB and mongo-express. This will also stop any other running docker containers.
  4. You can access the mongo-express dashboard at localhost:8081 to view the database

Cloud DB

  1. Change the .env file at user-service to ENV=PROD
  2. Ensure that you have set the correct MONGODB_URI in the .env file at user-service

Running the project (development)

  1. Run npm run dev to start up all microservices (user-service, matching-service, collab-service, question-service) in Docker with live reload, and the frontend on your host machine
  2. The microservices run in Docker with hot reload enabled - any code changes will automatically restart the service
  3. The frontend runs natively on your machine at localhost:3000 for optimal Hot Module Replacement (HMR) performance
  4. All microservices are exposed on their respective ports:
    • User Service: localhost:4000
    • Matching Service: localhost:3002
    • Collaboration Service: localhost:8000
    • Question Service: localhost:7000
    • API Gateway: localhost (port 80)
  5. Alternative: Run npm run dev:frontend to start only the frontend, or npm run dev:docker to start only the Docker services

Testing Docker production build

  1. Run docker-compose up --build to build and start up the user-service and frontend in docker containers
  2. For local DB, ensure that you have changed the .env file at user-service to ENV=local before running the command and run docker-compose --profile localdb up --build instead
  3. TO run the containers run docker-compose up if using cloud DB or docker-compose --profile localdb up if using local DB
  4. The frontend will be running at localhost
  5. To stop the containers run docker-compose down or docker-compose --profile localdb down if using local DB. You can also run npm run stop:docker to stop the containers. This will also stop any other running docker containers.

References:

About

nus-cs3219-ay2526s1-cs3219-ay2526s1-project-project-template created by GitHub Classroom

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 60.8%
  • JavaScript 36.3%
  • CSS 1.6%
  • Dockerfile 1.3%