- 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.
- Run
npm run install:allto install all needed node-modules in various service/frontend - Set-up the respective .env file in various service and at root by referring to the sample file
- Change the .env file at user-service to
ENV=local - Run
npm run localdbto start up the local mongoDB and mongo-express - Run
npm run stop:dockerto stop the local mongoDB and mongo-express. This will also stop any other running docker containers. - You can access the mongo-express dashboard at
localhost:8081to view the database
- Change the .env file at user-service to
ENV=PROD - Ensure that you have set the correct
MONGODB_URIin the .env file at user-service
- Run
npm run devto start up all microservices (user-service, matching-service, collab-service, question-service) in Docker with live reload, and the frontend on your host machine - The microservices run in Docker with hot reload enabled - any code changes will automatically restart the service
- The frontend runs natively on your machine at
localhost:3000for optimal Hot Module Replacement (HMR) performance - 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)
- User Service:
- Alternative: Run
npm run dev:frontendto start only the frontend, ornpm run dev:dockerto start only the Docker services
- Run
docker-compose up --buildto build and start up the user-service and frontend in docker containers - For local DB, ensure that you have changed the .env file at user-service to
ENV=localbefore running the command and rundocker-compose --profile localdb up --buildinstead - TO run the containers run
docker-compose upif using cloud DB ordocker-compose --profile localdb upif using local DB - The frontend will be running at
localhost - To stop the containers run
docker-compose downordocker-compose --profile localdb downif using local DB. You can also runnpm run stop:dockerto stop the containers. This will also stop any other running docker containers.