Skip to content

Commit 8cd5a2b

Browse files
author
Aishwarya Nair
committed
Merge branch 'test-updated-merge' of https://github.com/CS3219-AY2324S1/ay2324s1-course-assessment-g16 into test-updated-merge
2 parents d060104 + 8938a16 commit 8cd5a2b

File tree

1 file changed

+51
-31
lines changed

1 file changed

+51
-31
lines changed

CommunicationService/README.md

Lines changed: 51 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
### Features
44

5-
- provide video call function with audio
6-
- startCommunication : server socket events
5+
- provide audio call
6+
- startCommunication : server socket events for text based communication
77

88
### Table of Contents:
99

@@ -22,17 +22,17 @@
2222

2323
#### Listening port
2424

25-
http://localhost:3003
25+
http://localhost:3007
2626

2727

2828
#### Start the microservice on local machine by:
2929

30-
1. Navigate to peerprep directory.
30+
1. Navigate to CommunicationService directory.
3131

3232
2. Start the microservice in terminal using commands:
3333

3434
```
35-
cd peer-prep\src\backend\communication-service
35+
cd CommunicationService
3636
npm install
3737
npm start
3838
```
@@ -43,70 +43,90 @@ npm start
4343
4444
> node server.js
4545
46-
Communication service listening on port 3003
46+
Communication service listening on port 3007
4747
```
4848

4949
4. End communication service in terminal using `Ctrl+C`.
5050

5151

5252
#### For backend self-testing:
5353

54-
Here demonstrate local testing using Webpage:
54+
Here demonstrate local testing using Postman:
5555

56-
**Note**:
56+
1. In the history panel of Postman, click `new` button and select `Socket.io`.
5757

58-
> This testing only available currently.
58+
2. Add events to listen include:
5959

60-
1. Follow step 1 to step 3 in [Initiate Communication Service - Local Machine](#start-the-microservice-on-local-machine-by).
60+
- join
61+
- collaborator-joined
62+
- collaborator-recv-join
63+
- new-message
64+
- recv-message-log
65+
- called
66+
- answered
67+
- colllaborator-end-call
68+
- call-rejected
69+
- collaborator-disconnected
70+
- ice-candidate
6171

62-
2. In browser, create 2 webpage with url: `http://localhost:3003`.
72+
3. Connect clients to server:
6373

64-
3. Wait until `Call Collaborator panel` is initialized.
74+
Url 1: http://localhost:3007?sessionId=123c44c9-9bc3-402f-ba56-689eb0d2774d&userId=Gc2Bz9Nl8Wx4
6575

66-
4. Click on the `Call Collaborator panel` once in one of the pages, local video will be initiated.
76+
Url 2: http://localhost:3007?sessionId=123c44c9-9bc3-402f-ba56-689eb0d2774d&userId=PxJ3lVtWz8Kq
6777

68-
5. The `Accept Button` in the other page will be enabled, click it.
78+
4. Test events using the message panel:
6979

70-
6. Video call is enabled now.
80+
- recv-join
7181

72-
7. Stop video call by clicking the `End Button`. Video call will be ended for both clients.
82+
- message
7383

74-
8. End communication service in terminal using `Ctrl+C`.
84+
Arg1: string
85+
86+
- get-message-log
7587

88+
- call
7689

77-
#### Jest testing
90+
Arg1: any
7891

79-
1. Two terminal windows are required for Jest testing.
92+
- answer
8093

81-
2. Initiate the communication service in first window by:
94+
Arg1: any
8295

83-
```
84-
cd peer-prep\src\backend\communication-service
85-
npm start
86-
```
96+
- end-call
97+
98+
- reject-call
99+
100+
- disconnect
101+
102+
- ice-candidate
103+
Arg1: any
104+
105+
106+
#### Jest testing
87107

88-
3. Test the service in the other window using terminal commands:
108+
1. Test the service using terminal commands:
89109

90110
```
91-
cd peer-prep\src\backend\communication-service
111+
cd CommunicationService
92112
npm test
93113
```
94114

95-
4. Quit the server after finished testing using `Ctrl+C`.
115+
2. Quit the server after finished testing using `Ctrl+C`.
96116

97117

98118
#### Running in Docker
99119

100120
**Note**:
101121

102-
> Please delete the containers for other microservices.
122+
> Please ensure that there are no active container of the required services.
103123
104-
1. Navigate to peerprep directory.
124+
1. Navigate to CommunicationService directory.
105125

106126
2. Start the microservice in terminal using commands:
107127

108128
```
109-
cd peer-prep\src\backend\communication-service
129+
cd CommunicationService
110130
docker-compose up --build
111131
```
112132

@@ -115,7 +135,7 @@ docker-compose up --build
115135
```
116136
117137
> node server.js
118-
> Communication service listening on port 3003
138+
> Communication service listening on port 3007
119139
```
120140

121141
4. End communication service in terminal using `Ctrl+C` twice.

0 commit comments

Comments
 (0)