You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: backend/README.md
+5-11Lines changed: 5 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,19 +2,11 @@
2
2
3
3
> Before proceeding to each microservice for more instructions:
4
4
5
-
1. Set-up either a local or cloud MongoDB.
5
+
1. Setup cloud MongoDB if not using docker. We recommend this if you are just testing out each microservice separately to avoid needing to manually set up multiple instances of local MongoDB. Else, if you are using docker-compose.yml to run PeerPrep, check out the READMEs in the different backend microservices to set up the env for the local MongoDB instances.
6
6
7
-
2. Set-up Firebase.
7
+
2. Setup Firebase.
8
8
9
-
## Setting-up local MongoDB (only if you are using Docker)
10
-
11
-
1. In the `backend` directory, create a copy of the `.env.sample` file and name it `.env`.
12
-
13
-
2. To set up credentials for the MongoDB database, update `MONGO_INITDB_ROOT_USERNAME`, `MONGO_INITDB_ROOT_PASSWORD` of the `.env` file.
14
-
15
-
3. Your local Mongo URI will be `mongodb://<MONGO_INITDB_ROOT_USERNAME>:<MONGO_INITDB_ROOT_PASSWORD>@mongo:27017/`. Take note of it as we will be using in the `.env` files in the various microservices later on.
16
-
17
-
4. You can view the MongoDB collections locally using Mongo Express. To set up Mongo Express, update `ME_CONFIG_BASICAUTH_USERNAME` and `ME_CONFIG_BASICAUTH_PASSWORD`. The username and password will be the login credentials when you access Mongo Express at http://localhost:8081.
9
+
3. Follow the instructions [here](https://nodejs.org/en/download/package-manager) to set up Node v20.
18
10
19
11
## Setting-up cloud MongoDB (in production)
20
12
@@ -95,6 +87,8 @@
95
87
96
88
## Setting-up Firebase
97
89
90
+
> For ease of testing, you can set up just one firebase to use across all the microservices that need it.
91
+
98
92
1. Go to https://console.firebase.google.com/u/0/.
99
93
100
94
2. Create a project and choose a project name. Navigate to `Storage` and click on it to activate it.
> Please ensure that you have completed the backend set-up [here](../README.md) before proceeding.
4
+
5
+
## Setting-up Matching Service
6
+
7
+
1. In the `matching-service` directory, create a copy of the `.env.sample` file and name it `.env`. If you are looking to run matching service with the other services using docker-compose, comment out the variable `RABBITMQ_ADDR` under use case (1) in the .env file. Otherwise, if you are looking to run matching service individually, comment out the variables `RABBITMQ_DEFAULT_USER`, `RABBITMQ_DEFAULT_PASS` and `RABBITMQ_ADDR` under use case (2) in the .env file.
8
+
9
+
2. If you are running matching service together with other services using docker-compose, to set up credentials for RabbitMq, update the RabbitMq variables in the `.env` file. Update `RABBITMQ_DEFAULT_USER` and `RABBITMQ_DEFAULT_PASS` to what you want, then update `RABBITMQ_ADDR` to be `amqp://<RABBITMQ_DEFAULT_USER>:<RABBITMQ_DEFAULT_PASS>@rabbitmq:5672`. You can access RabbitMq management user interface locally with the username in `RABBITMQ_DEFAULT_USER` and password in `RABBITMQ_DEFAULT_PASS` at http://localhost:15672.
10
+
11
+
3. If you are running matching service individually, you do not need to make any changes to `RABBITMQ_ADDR`. You can access RabbitMq management user interface locally with the username `guest` and password `guest` at http://localhost:15672.
12
+
13
+
## Running Matching Service Individually with Docker
14
+
15
+
1. Set up and run RabbitMq locally on your computer with the command `docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:4.0-management`.
16
+
17
+
2. Open Command Line/Terminal and navigate into the `matching-service` directory.
18
+
19
+
3. Run the command: `npm install`. This will install all the necessary dependencies.
20
+
21
+
4. Run the command `npm start` to start the Matching Service in production mode, or use `npm run dev` for development mode, which includes features like automatic server restart when you make code changes. If you encounter connection errors, please wait for a few minutes before running `npm start` again as RabbitMq may take some time to start up.
22
+
23
+
## After running
24
+
25
+
1. To view Matching Service documentation, go to http://localhost:3002/docs.
26
+
27
+
2. Using applications like Postman, you can interact with the Matching Service on port 3002. If you wish to change this, please update the `.env` file.
0 commit comments