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: README.md
+47-7Lines changed: 47 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,20 +5,45 @@
5
5
This project follows a microservices architecture with the following services:
6
6
1.**Frontend** - Port `3000`
7
7
2.**User Service** - Port `3001`
8
-
3.**Question Service** - Port `3002`
8
+
3.**Question Service** - Port `3002`
9
9
4.**Matching Service** - Port `3003`
10
-
5.**MongoDB** - Port `27017` (Database)
11
-
6.**Nginx API Gateway** - Port `80`
12
-
7.**Redis** - Port `6379`
10
+
5.**Collaboration Service** - Port `3004`
11
+
6.**MongoDB** - Port `27017` (Database)
12
+
7.**Nginx API Gateway** - Port `80`
13
+
8.**Redis** - Port `6379`
14
+
9.**Zookeeper** - Port `2181`
15
+
10.**Kafka** - Port `9092`, Port `29092`
16
+
11.**Chat Service** (Located in addon/chat)
13
17
14
18
### Setting up the Project
19
+
20
+
### Running the Project with `start.sh`
21
+
22
+
A `start.sh` script is provided in the root directory to simplify setup. This script will start all services, check for any `.env.example` files, and create the required `.env` files if they don’t already exist.
23
+
24
+
To run the project, open a terminal in the `cs3219-ay2425s1-project-g25` directory and execute:
25
+
26
+
./start.sh
27
+
28
+
This script can be run on **Linux**, **macOS**, and **Windows** (with Git Bash or WSL). It will initialize all services and ensure the environment files are set up as needed.
29
+
30
+
Ensure the script has execute permissions. If needed, set them by running:
31
+
32
+
chmod +x start.sh
33
+
34
+
35
+
This will initialize all services and ensure the environment files are set up as needed. Note that running `start.sh` requires Git Bash, WSL, or a similar terminal environment capable of executing Bash scripts.
36
+
37
+
### Manual Setup
15
38
Copy and paste the .env.example files in each service. Rename them as .env files.
16
39
Files to do this in:
17
40
1. ./
18
41
2. /frontend
19
42
3. /backend/user-service
20
43
4. /backend/question-service
21
44
5. /backend/matching-service
45
+
6. /backend/collaboration-service
46
+
22
47
Then, run `node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"` twice to generate
23
48
your 2 JWT token secrets. For the first one, paste it into the JWT_ACCESS_TOKEN_SECRET variable of
24
49
the .env files in question-service and user-service. Then, copy the second into the
@@ -27,10 +52,15 @@ JWT_REFRESH_TOKEN_SECRET of the .env file in user-service.
27
52
Further note: The DB_CLOUD_URI .env variable in user-service doesn't need to be filled in. A local
28
53
database will be created in the mongoDB service.
29
54
30
-
Consult the readme files in the service if there are further configurations needed.
55
+
Consult the readme files in each service if there are further configurations needed.
56
+
31
57
### Running the Project
32
58
33
-
To run all services, execute the following command in the root directory:
59
+
To run the main services, execute the following command in the root directory:
60
+
61
+
`docker-compose up --build`
62
+
63
+
To run the chat service, navigate to the addon/chat directory and run:
34
64
35
65
`docker-compose up --build`
36
66
@@ -39,11 +69,15 @@ Once the containers are up:
39
69
- User Service: [http://localhost:3001](http://localhost:3001)
- Chat Service: Available through the main application
45
79
46
-
Note that even after docker says that everything is up and running, there is a risk that they aren't when you load the frontend.
80
+
Note that even after docker says that everything is up and running, there is a risk that they aren't when you load the frontend. Wait for the frontend logs to show up in the docker logs.
47
81
In this event, wait for about a minute before trying again. If that still doesn't work and there are network errors, try
48
82
rebuilding the services by running `docker-compose up --build` again.
49
83
@@ -58,3 +92,9 @@ rebuilding the services by running `docker-compose up --build` again.
58
92
### Nginx API Gateway
59
93
60
94
- Nginx runs on port `80` and acts as the API gateway for routing requests to the respective services.
95
+
96
+
### Kubernetes Auto Pod Scaling
97
+
98
+
All files for Kubernetes deployment and auto scaling of services can be found in the `/kubernetes/` folder.
99
+
100
+
Refer to the [README](/kubernetes/README.md) in the kubernetes folder for more information.
<NameOfLastUsedPublishProfile>C:\Users\Wwj\source\repos\project_ai\Chatio\Properties\PublishProfiles\Chatiox - Web Deploy.pubxml</NameOfLastUsedPublishProfile>
0 commit comments