Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback #1

Open
wants to merge 301 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
301 commits
Select commit Hold shift + click to select a range
940367d
Update api-gateway port
XXJJXJ Sep 20, 2024
37c0c2b
Update path
XXJJXJ Sep 22, 2024
3079ff7
Update .env.sample
XXJJXJ Sep 23, 2024
da213bf
Add dockerfile for question service
XXJJXJ Sep 23, 2024
ea15c8c
Update header conversion
XXJJXJ Sep 23, 2024
de9c41a
Update docker-compose
XXJJXJ Sep 23, 2024
23223ab
File cleanup
XXJJXJ Sep 23, 2024
cb69c80
Update .env.example
XXJJXJ Sep 23, 2024
e2f576a
Update docker compose
XXJJXJ Sep 23, 2024
6dde024
Add question modal
keaganpzh Sep 23, 2024
05d2b99
Merge pull request #14 from CS3219-AY2425S1/feat/api-gateway-questions
keaganpzh Sep 23, 2024
9e2b891
Merge branch 'main' into branch-frontend-questions
keaganpzh Sep 23, 2024
d755d0b
Update hook to call from api gateway
keaganpzh Sep 23, 2024
56a0483
Merge pull request #19 from CS3219-AY2425S1/branch-frontend-questions
SimWPEric Sep 23, 2024
426bbc3
Question service validation (#20)
Bombbird2001 Sep 25, 2024
4bb9edc
add create and delete question button
SimWPEric Sep 25, 2024
fab11b7
center confirm delete modal
SimWPEric Sep 25, 2024
b2ff8a9
implement edit question functionality
SimWPEric Sep 26, 2024
56aca20
add check for duplicate question topic
SimWPEric Sep 26, 2024
b1ccbc9
add cancel button for create and update question page
SimWPEric Sep 27, 2024
bf42017
replace alert with toast
SimWPEric Sep 27, 2024
ddb6dfa
Merge pull request #21 from CS3219-AY2425S1/feat/question-CRUD
XXJJXJ Sep 28, 2024
35dc660
update button text
SimWPEric Sep 28, 2024
8c74c9a
Merge pull request #23 from CS3219-AY2425S1/fix/create-question-button
XXJJXJ Sep 28, 2024
a564667
Update README.md for question service DB setup
Bombbird2001 Sep 28, 2024
09aff14
Merge pull request #24 from CS3219-AY2425S1/doc/readme
SimWPEric Sep 28, 2024
f1e0585
implement user registration
SimWPEric Oct 1, 2024
369dc8a
implement user login
SimWPEric Oct 1, 2024
77226ab
add jwt token verification
SimWPEric Oct 1, 2024
8cb5393
protect dashboard paths
SimWPEric Oct 3, 2024
4343337
Add basic profile page
XXJJXJ Oct 3, 2024
4940fa4
Add userId to useAuth
XXJJXJ Oct 3, 2024
9b4e052
Add logout and deleteUser functions
XXJJXJ Oct 3, 2024
82add31
Add delete profile button
XXJJXJ Oct 3, 2024
c904424
add error toast when user not authenticated
SimWPEric Oct 5, 2024
cb33a0b
update user auth logic
SimWPEric Oct 5, 2024
abea675
remove reset password page
SimWPEric Oct 5, 2024
08d2f1e
Merge pull request #25 from CS3219-AY2425S1/feat/user-service
keaganpzh Oct 5, 2024
f7b14ec
Merge branch 'main' into feat/profile-page
SimWPEric Oct 5, 2024
064bbc6
Merge pull request #26 from CS3219-AY2425S1/feat/profile-page
keaganpzh Oct 5, 2024
1911cc6
Add error handling for question fetching
keaganpzh Oct 5, 2024
c6f8766
Merge pull request #29 from CS3219-AY2425S1/branch-err-handling
XXJJXJ Oct 5, 2024
ce99bd0
update delete profile modal
SimWPEric Oct 6, 2024
d4052e7
implement edit profile
SimWPEric Oct 6, 2024
6d4e7d9
fix tag overflow
SimWPEric Oct 6, 2024
3dafd35
Merge pull request #30 from CS3219-AY2425S1/feat/edit-profile
keaganpzh Oct 6, 2024
85e99dd
setup matching service with aws sqs
SimWPEric Oct 10, 2024
0cc9408
remove aws sqs, add kafka template
SimWPEric Oct 12, 2024
9504a93
update .env.example
SimWPEric Oct 12, 2024
4df0391
Merge pull request #32 from CS3219-AY2425S1/feat/matching-service
XXJJXJ Oct 12, 2024
adfbbb1
Set up Docker containers for Kafka, Zookeeper and Kafka UI
Bombbird2001 Oct 13, 2024
98e7e78
Add example code for reading from, sending to Kafka
Bombbird2001 Oct 14, 2024
d72cc74
Shift Kafka UI volume to backend folder
Bombbird2001 Oct 14, 2024
111944b
Merge pull request #38 from CS3219-AY2425S1/feat/kafka-cluster
Bombbird2001 Oct 15, 2024
6c394c2
create matching page
SimWPEric Oct 15, 2024
3f198d0
add toast for match not found
SimWPEric Oct 15, 2024
b36b9ff
Add skeleton impl
XXJJXJ Oct 13, 2024
cfac5f7
Rebase changes
XXJJXJ Oct 15, 2024
94c39e3
Shift kafka logic from controller to service
XXJJXJ Oct 15, 2024
b3f8347
disable topic and difficulty selection while matching
SimWPEric Oct 15, 2024
85852fc
Implement addMatchRequest
XXJJXJ Oct 15, 2024
0c734d2
Define MatchResponse
XXJJXJ Oct 15, 2024
b6a98bb
Merge pull request #40 from CS3219-AY2425S1/feat/match-endpoint
keaganpzh Oct 15, 2024
0c04183
Rename file from services to service
keaganpzh Oct 15, 2024
2a62676
Implement OnModuleInit in MatchingService
keaganpzh Oct 15, 2024
e61ad9a
Implement kafka consumer to wait on messages
keaganpzh Oct 15, 2024
b845c59
Add route to check match
keaganpzh Oct 15, 2024
5b76e14
Change internal message structure
keaganpzh Oct 15, 2024
b12b593
Handle cancel requests
keaganpzh Oct 16, 2024
8aa67b8
Add route for match cancelling
keaganpzh Oct 16, 2024
a4192d7
Improve cancelling logic
keaganpzh Oct 16, 2024
c1e7a18
Standardise responses from check-match
keaganpzh Oct 16, 2024
f7b12dd
Merge pull request #41 from CS3219-AY2425S1/branch-consumer
SimWPEric Oct 17, 2024
faf6eef
Add relaxed matching
XXJJXJ Oct 18, 2024
a0c78b3
Merge pull request #43 from CS3219-AY2425S1/main
tahsinhasem Oct 18, 2024
88979ee
Add Match Data Structures
tah5in Oct 18, 2024
7a4d00c
Add Methods to check matching
tah5in Oct 19, 2024
b83150b
Inetgrate Matching service to frontend
tah5in Oct 19, 2024
134cb47
Merge pull request #42 from CS3219-AY2425S1/feat/relaxed-match
keaganpzh Oct 19, 2024
3b696aa
Merge pull request #44 from CS3219-AY2425S1/tahsin-m4
keaganpzh Oct 19, 2024
a903aa6
add error toast for username or email already exist
SimWPEric Oct 20, 2024
88a271b
Add utility queue
XXJJXJ Oct 20, 2024
d9aaf33
Update matching services
XXJJXJ Oct 20, 2024
b78ef43
Update queue clean logic and cancel handling
XXJJXJ Oct 20, 2024
1140021
Update comments
XXJJXJ Oct 20, 2024
942078c
Merge pull request #48 from CS3219-AY2425S1/feat/match-backend-timeout
SimWPEric Oct 20, 2024
c22c4d7
add support for choosing any topic and difficulty
SimWPEric Oct 20, 2024
c339eab
Merge branch 'main' into improve-error-messages
SimWPEric Oct 20, 2024
44674a8
split topic and difficulty
SimWPEric Oct 20, 2024
28bf591
display roomId
SimWPEric Oct 20, 2024
5d5af7e
Merge pull request #47 from CS3219-AY2425S1/improve-error-messages
XXJJXJ Oct 20, 2024
f73f72d
update matching logs
SimWPEric Oct 20, 2024
e94ec80
Merge pull request #49 from CS3219-AY2425S1/improve-matching-svc-logs
XXJJXJ Oct 20, 2024
4f0b224
Update frontend to use domains from .env
XXJJXJ Oct 21, 2024
5ae7d8c
Add matching service to api gateway
XXJJXJ Oct 21, 2024
6485b2d
Update docker compose and .env.example
XXJJXJ Oct 21, 2024
959d517
Add utility scripts
XXJJXJ Oct 21, 2024
4b909c8
Update scripts
XXJJXJ Oct 21, 2024
2e4a249
Update scripts
XXJJXJ Oct 21, 2024
b02645e
Update
XXJJXJ Oct 21, 2024
8b49942
Update scripts
XXJJXJ Oct 21, 2024
e4a7773
Update port bindings in README
keaganpzh Oct 22, 2024
ff68da2
Update docker compose file
XXJJXJ Oct 22, 2024
bca2fc9
Add redirect for collab service
XXJJXJ Oct 22, 2024
c27c15c
Update .env.example
XXJJXJ Oct 22, 2024
d2d7916
Add collab-service
keaganpzh Oct 22, 2024
2cbc55c
Migrate from socket.io to ws
keaganpzh Oct 22, 2024
faea20f
Add config service
keaganpzh Oct 23, 2024
7618763
Improve room representation and collab service
keaganpzh Oct 23, 2024
f6db198
Handle client disconnect
keaganpzh Oct 23, 2024
d168278
Implement websocket server as a basic ws service
keaganpzh Oct 23, 2024
91242ce
Fix indent
keaganpzh Oct 23, 2024
6704b2f
Add method to get question from question service
keaganpzh Oct 23, 2024
1fb49c1
Add Docker
keaganpzh Oct 23, 2024
dbb55b4
Fix typo
keaganpzh Oct 23, 2024
287540f
Initial work on refactoring matching service to use WebSockets for co…
Bombbird2001 Oct 23, 2024
9184475
Merge pull request #58 from CS3219-AY2425S1/collab-service
keaganpzh Oct 23, 2024
952aa17
Merge branch 'main' into matching-websocket
Bombbird2001 Oct 23, 2024
93f46f7
Add socket.io to new matching websocket service
Bombbird2001 Oct 23, 2024
d7f5fa6
Update collab service to handle question in rooms
keaganpzh Oct 23, 2024
3390ac3
Update rooms to use full questions
keaganpzh Oct 23, 2024
10e3927
Merge branch 'main' into feat/api-gateway-and-fe-integration
XXJJXJ Oct 23, 2024
0642cc5
Create dynamic room page
keaganpzh Oct 23, 2024
2a73290
Move match request producer logic to match websocket service
Bombbird2001 Oct 23, 2024
837ddc7
Integrate room page with collab service
keaganpzh Oct 23, 2024
bc0808c
Add logic on matching websocket service to handle successful matches,…
Bombbird2001 Oct 23, 2024
648a0f7
Re-enable countdown timer on match button
Bombbird2001 Oct 24, 2024
00b5325
Re-enable manual cancelling of match request
Bombbird2001 Oct 24, 2024
b47185f
Move rooms to path /rooms/roomId
keaganpzh Oct 24, 2024
9e57476
Add collaborative code editor
keaganpzh Oct 24, 2024
05f39d4
Implement code execution
keaganpzh Oct 24, 2024
ef2d5c4
Handle failed ws connections
keaganpzh Oct 24, 2024
1d2dc70
Merge pull request #60 from CS3219-AY2425S1/matching-websocket
keaganpzh Oct 24, 2024
eb98fc8
Merge branch 'main' into collab-service
keaganpzh Oct 24, 2024
f146ca4
Merge branch 'main' into collab-service
keaganpzh Oct 24, 2024
3f23fe0
Update match service to create collab room
keaganpzh Oct 24, 2024
b0a08ce
Connect match to collab page
keaganpzh Oct 24, 2024
8579213
Add collab svc domain
keaganpzh Oct 24, 2024
1bc566e
Update docker-compose
keaganpzh Oct 24, 2024
e2e8739
fix collab service connection error
SimWPEric Oct 27, 2024
b6b513f
add chatbox to collab page
SimWPEric Oct 27, 2024
66f20f3
Initialize History Service
tah5in Oct 27, 2024
72e67e8
implement chat service
SimWPEric Oct 27, 2024
ec4331b
Dockerise the service and use environment vaiables
tah5in Oct 27, 2024
b84a181
Add checking of user ID before joining queue to prevent simultaneous …
Bombbird2001 Oct 28, 2024
80ea110
Update README
Bombbird2001 Oct 28, 2024
d00295e
Add Method to Query for Question History for a given Student
tah5in Oct 29, 2024
be7008b
Add Question History and Question Stats to profile page
tah5in Oct 29, 2024
49ee46c
Merge pull request #59 from CS3219-AY2425S1/collab-service
XXJJXJ Oct 30, 2024
d88c349
Merge remote-tracking branch 'origin/main' into feat/hist-service
tah5in Oct 30, 2024
3fbea4f
Add Question History once User goes to Room
tah5in Oct 30, 2024
6a26619
Merge branch 'main' into no-duplicate-match-redis
Bombbird2001 Oct 30, 2024
3d62e24
Ensure timeout is integer
Bombbird2001 Oct 30, 2024
c5fa8db
Merge pull request #67 from CS3219-AY2425S1/no-duplicate-match-redis
Bombbird2001 Oct 30, 2024
5be3b94
Merge pull request #62 from CS3219-AY2425S1/feat/chat
XXJJXJ Oct 30, 2024
f456d57
Merge branch 'main' into collab-service
XXJJXJ Oct 31, 2024
6339c9d
Merge pull request #68 from CS3219-AY2425S1/collab-service
SimWPEric Oct 31, 2024
380aaf7
Merge branch 'main' into feat/api-gateway-and-fe-integration
XXJJXJ Nov 1, 2024
0e4a217
Update .env example
XXJJXJ Nov 1, 2024
64e1813
Not Allow Duplicate Question Histories to be stored
tah5in Nov 1, 2024
14cfb0b
Bug Fix where Page queries for history for initial null userID
tah5in Nov 1, 2024
193e34e
Bug Fix where CSS was overflowing
tah5in Nov 1, 2024
bf6ddd2
Bug Fix Handle Duplicate Entries of Question History in front end
tah5in Nov 1, 2024
4cdca6e
Merge remote-tracking branch 'origin/main' into feat/hist-service
tah5in Nov 1, 2024
54ad820
Merge pull request #66 from CS3219-AY2425S1/feat/hist-service
XXJJXJ Nov 1, 2024
92e6f3a
Merge branch 'main' into feat/api-gateway-and-fe-integration
XXJJXJ Nov 1, 2024
0b91353
Update docs
XXJJXJ Nov 1, 2024
c1fea49
Remove unnecessary import
XXJJXJ Nov 1, 2024
df6e03d
Update FE services domain retrieval
XXJJXJ Nov 1, 2024
b251c51
Update router push typo
XXJJXJ Nov 1, 2024
03a89b4
Update chat service imports
XXJJXJ Nov 1, 2024
e8bf2a2
Remove default room creation in collab service
XXJJXJ Nov 1, 2024
cd3d4b0
Update api gw endpoints
XXJJXJ Nov 1, 2024
01471b7
Update docker compose
XXJJXJ Nov 1, 2024
9f44fef
Update .env example
XXJJXJ Nov 1, 2024
f066bb5
Add chat domain in chatbox
XXJJXJ Nov 1, 2024
463e030
Refactor for production builds
Bombbird2001 Nov 1, 2024
372a190
Add utility build script
XXJJXJ Nov 1, 2024
264ac2e
Update components
XXJJXJ Nov 1, 2024
af24aac
Add redis domain for matching ws service
XXJJXJ Nov 1, 2024
19cf5ae
Add health check to Docker container start up dependencies
Bombbird2001 Nov 1, 2024
dd437a3
refactor profile page
SimWPEric Nov 1, 2024
a506442
add logout button
SimWPEric Nov 1, 2024
024e02a
Merge pull request #69 from CS3219-AY2425S1/prod-builds
XXJJXJ Nov 1, 2024
fac5bba
Add api gw logs
XXJJXJ Nov 1, 2024
25f202f
Merge branch 'main' into feat/api-gateway-and-fe-integration
XXJJXJ Nov 1, 2024
b3e3868
Use prod for image building
XXJJXJ Nov 1, 2024
efd4283
Clean up prod docker compose file
XXJJXJ Nov 1, 2024
1d4d736
Merge pull request #70 from CS3219-AY2425S1/refactor/profile-page
XXJJXJ Nov 1, 2024
7ba85a2
Merge branch 'main' into feat/api-gateway-and-fe-integration
XXJJXJ Nov 1, 2024
e40fbc0
Update styling for question history
keaganpzh Nov 3, 2024
46883c6
Remove 'any' from question add/edit choices
keaganpzh Nov 3, 2024
e063ee0
Merge pull request #57 from CS3219-AY2425S1/feat/api-gateway-and-fe-i…
XXJJXJ Nov 3, 2024
9ff7606
Merge branch 'main' into frontend-style
keaganpzh Nov 3, 2024
707f638
Small edits
keaganpzh Nov 3, 2024
4de22a3
Remove upper bound on question
keaganpzh Nov 3, 2024
f88d055
Add language indicator for code editor
keaganpzh Nov 3, 2024
84affe1
update question CRUD based on admin role
SimWPEric Nov 4, 2024
b590b8e
Add unit tests for api gateway
XXJJXJ Nov 4, 2024
8f10ce6
add new solution field to Question
SimWPEric Nov 4, 2024
c2fe87f
Add unit tests for Question Service
XXJJXJ Nov 4, 2024
f9c6e4c
Merge pull request #74 from CS3219-AY2425S1/admin-crud-question
keaganpzh Nov 4, 2024
bae1b50
Merge branch 'main' into frontend-style
keaganpzh Nov 4, 2024
64080b9
Update matching.service for unit testing
XXJJXJ Nov 5, 2024
d6e3e22
Add matching service unit tests
XXJJXJ Nov 5, 2024
029e9b1
Handle language switching for individual user
keaganpzh Nov 5, 2024
d48fc79
Add unit tests for matching ws
XXJJXJ Nov 5, 2024
84faf25
Handle language change awareness
keaganpzh Nov 5, 2024
dd87cf4
Add 'attempted' word in question stats
keaganpzh Nov 5, 2024
6f7d904
Format question topics and complexity
keaganpzh Nov 5, 2024
d612a9b
Merge pull request #73 from CS3219-AY2425S1/frontend-style
SimWPEric Nov 5, 2024
a4d1428
Update collab service for testing
XXJJXJ Nov 5, 2024
fcf6e81
Add unit tests for collab service
XXJJXJ Nov 5, 2024
90035d4
Add unit tests for chat service
XXJJXJ Nov 5, 2024
d8d6517
Add user ID check before joining room
Bombbird2001 Nov 5, 2024
d6b3ec4
Display message to user if they try to join room that is not available
Bombbird2001 Nov 5, 2024
141609e
Remove unused code
Bombbird2001 Nov 5, 2024
58fa0e2
Update chat service unit tests
XXJJXJ Nov 6, 2024
56e252d
Update api gateway unit tests
XXJJXJ Nov 6, 2024
1e51367
Update matching service unit tests
XXJJXJ Nov 6, 2024
faaa74e
Update question service unit tests
XXJJXJ Nov 6, 2024
cf05aa4
Update api gateway endpoint for collab service
XXJJXJ Nov 6, 2024
bedd8f5
Merge pull request #76 from CS3219-AY2425S1/collab-service-with-verif…
SimWPEric Nov 6, 2024
5d82e99
Add Attempt History Tracking in Backend
tah5in Nov 6, 2024
5c52619
Add Tracking Attempts to FE
tah5in Nov 6, 2024
bcde208
Fix Bug Where collaborator did not have saved history
tah5in Nov 6, 2024
ccefe21
Add FE to see Attempt history
tah5in Nov 6, 2024
51c4c79
Handle Edge case where room ID does not exist in the backend
tah5in Nov 6, 2024
d138157
Made Review Changes
tah5in Nov 9, 2024
344eb85
Merge branch 'main' into attempt-history
tahsinhasem Nov 9, 2024
267659a
Fix getRoom typo
XXJJXJ Nov 9, 2024
6d41299
Allow view on different attempts
XXJJXJ Nov 9, 2024
5d6f593
Add toast warning for non-javascript run
XXJJXJ Nov 9, 2024
6382ee3
Update fetchRoom
XXJJXJ Nov 9, 2024
ef4bf15
update no history found
SimWPEric Nov 9, 2024
d55e6eb
disallow username containing spaces
SimWPEric Nov 9, 2024
443aa0a
Improve room cleaning logic
keaganpzh Nov 9, 2024
3645229
Merge pull request #78 from CS3219-AY2425S1/collab-service
SimWPEric Nov 9, 2024
76316c7
remove profile avatar icon
SimWPEric Nov 9, 2024
991a113
Use ConnectedUsers to find collaborator
tah5in Nov 9, 2024
17e92c7
Remove Dependency on Room for fetching attempt history
tah5in Nov 9, 2024
4a54824
fix assertion error
SimWPEric Nov 10, 2024
674cda1
Merge pull request #77 from CS3219-AY2425S1/attempt-history
SimWPEric Nov 10, 2024
894faf0
Merge branch 'main' into feat/unit-tests
XXJJXJ Nov 10, 2024
4c9ea09
Update collab service unit test
XXJJXJ Nov 10, 2024
8b6e953
Update unit tests for updated services
XXJJXJ Nov 11, 2024
dcfa1fb
Add update feature to history records when user profile changes
XXJJXJ Nov 13, 2024
4d2c9fb
Merge pull request #75 from CS3219-AY2425S1/feat/unit-tests
keaganpzh Nov 13, 2024
b936eb5
Merge branch 'main' into fix/history
XXJJXJ Nov 13, 2024
28b5a31
Merge pull request #79 from CS3219-AY2425S1/fix/history
XXJJXJ Nov 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Frontend used domains (NEXTJS needs NEXT_PUBLIC_ prefix, added in docker-compose)
API_GATEWAY_DOMAIN=http://localhost:8000/api
FE_COLLAB_SERVICE_DOMAIN=http://localhost:8007
FE_MATCHING_WEBSOCKET_SERVICE_DOMAIN=http://localhost:8008
FE_CHAT_SERVICE_DOMAIN=http://localhost:8009

# API Gateway
QUESTION_SERVICE_DOMAIN=http://question-app:8001
USER_SERVICE_DOMAIN=http://user-app:8003
COLLAB_SERVICE_DOMAIN=http://collab-app:8007
HISTORY_SERVICE_DOMAIN=http://history-app:8090

# May not need: Not sure how to redirect socket connections
CHAT_SERVICE_DOMAIN=http://chat-app:8009
MATCHING_WEBSOCKET_SERVICE_DOMAIN=http://matching-websocket:8008
# Even if redirect is possible, need "public" URL for sockets

# Question Service
MONGODB_URI=
MONGODB_NAME=

# User Service
JWT_SECRET=you-can-replace-this-with-your-own-secret
DB_CLOUD_URI=
DB_LOCAL_URI=mongodb://user-service-db:27017/peerprepUserServiceDB
PORT=8003
ENV=DEV # or PROD to use cloud URI

# History Service
HISTORY_SERVICE_PORT=8090
HISTORY_SERVICE_MONGODB_URI=

# Kafka Cluster
KAFKA_BROKER_URI=kafka:8005

# Matching Service
MATCHING_SERVICE_CONSUMER_GROUP_ID=matching-service
MATCHING_WEBSOCKET_SERVICE_CONSUMER_GROUP_ID=matching-websocket-service
REDIS_DOMAIN=redis://redis:6379

# Collab Service
COLLAB_SERVICE_CONSUMER_GROUP_ID=collab-service
133 changes: 133 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# macOS
.DS_Store

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
47 changes: 43 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,46 @@
[![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-22041afd0340ce965d47ae6ef1cefeee28c7c493a6346c4f15d667ab976d596c.svg)](https://classroom.github.com/a/bzPrOe11)

# CS3219 Project (PeerPrep) - AY2425S1

## Group: Gxx

### Note:
- You can choose to develop individual microservices within separate folders within this repository **OR** use individual repositories (all public) for each microservice.
- In the latter scenario, you should enable sub-modules on this GitHub classroom repository to manage the development/deployment **AND** add your mentor to the individual repositories as a collaborator.
- 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.
### Note:

- You can choose to develop individual microservices within separate folders within this repository **OR** use individual repositories (all public) for each microservice.
- In the latter scenario, you should enable sub-modules on this GitHub classroom repository to manage the development/deployment **AND** add your mentor to the individual repositories as a collaborator.
- 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.

# Note when adding new services

Initialising a new Nest.js project will cause a `.git` folder to exist within the service, which is not what we want. We want to remove the nested git folders by doing:

1. Verify that there is a nested `.git` directory

```bash
find backend/service_name/ -name ".git"
```

2. Remove the `.git` directory.

```bash
rm -rf backend/service_name/.git
```

# Backend: Service - Port Bindings

| Service | Docker Port | Local Port |
| -------------------------- | ----------- | ---------- |
| Frontend | 3000 | 3000 |
| API Gateway | 8000 | 8000 |
| Question Service | 8001 | 8001 |
| Matching Service | 8002 | 8002 |
| User Service | 8003 | 8003 |
| User Service MongoDB | 27017 | 27017 |
| Zookeeper | - | 8004 |
| Kafka | - | 8005 |
| Collab Service | 8007 | 8007 |
| Matching WebSocket Service | 8008 | 8008 |
| Chat Service | 8009 | 8009 |
| Kafka UI | 8006 | 8080 |
| History Service | 8090 | 8090 |
| Redis | - | 6379 |
2 changes: 2 additions & 0 deletions backend/api-gateway/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
QUESTION_SERVICE_DOMAIN=http://question-app:8001
USER_SERVICE_DOMAIN=http://user-app:8003
25 changes: 25 additions & 0 deletions backend/api-gateway/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
56 changes: 56 additions & 0 deletions backend/api-gateway/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# compiled output
/dist
/node_modules
/build

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# temp directory
.temp
.tmp

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
4 changes: 4 additions & 0 deletions backend/api-gateway/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
15 changes: 15 additions & 0 deletions backend/api-gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:20-alpine

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .

RUN npm run build

EXPOSE 8000

CMD ["npm", "run", "start:prod"]
13 changes: 13 additions & 0 deletions backend/api-gateway/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:20-alpine

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 8000

CMD ["npm", "run", "start:dev"]
Loading