Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
349 commits
Select commit Hold shift + click to select a range
71e71d7
Merge branch 'main' of https://github.com/CS3219-AY2425S1/cs3219-ay24…
AlyssaPng Sep 29, 2024
ee9266e
Remove duplicate header
AlyssaPng Sep 29, 2024
9e1b7c7
Merge pull request #30 from CS3219-AY2425S1/PP-43
zoebelle-pang Sep 29, 2024
548b6ae
PP-40
zoebelle-pang Sep 29, 2024
4c36ae8
PP-45
zoebelle-pang Sep 29, 2024
b6ae530
Create handler to submit question. Create toast to display status of …
Kb-Tay Sep 29, 2024
9edf7b0
Merge pull request #31 from CS3219-AY2425S1/PP-45
Kb-Tay Sep 29, 2024
8e14b7f
Merge pull request #29 from CS3219-AY2425S1/PP-42
Kb-Tay Sep 29, 2024
13a0e4f
Merge conflicts with main
Kb-Tay Sep 29, 2024
e32ef09
Update delete request to retrieve id from url
Kb-Tay Sep 29, 2024
86bc0bf
Merge pull request #32 from CS3219-AY2425S1/PP-46-aaron
Kb-Tay Sep 29, 2024
c3f956c
Merge branch 'main' into PP-44
Kb-Tay Sep 29, 2024
835219d
Connect update and edit request frontend to backend
Kb-Tay Sep 29, 2024
212b1ef
Fix error when no questions in db
Kb-Tay Sep 29, 2024
83d4783
Remove default of fetching user data on window focus
Kb-Tay Sep 29, 2024
d255175
Fix table style
AlyssaPng Sep 29, 2024
edbc8e3
Merge pull request #33 from CS3219-AY2425S1/PP-44
Kb-Tay Sep 29, 2024
e632afe
Add categories. Fix med cat
Kb-Tay Sep 29, 2024
90861ff
Merge pull request #34 from CS3219-AY2425S1/fix-medium
AlyssaPng Sep 29, 2024
354b534
Fix backend for handling primitive.ObjectId
Kb-Tay Sep 29, 2024
e898d29
Merge pull request #35 from CS3219-AY2425S1/fix-questions
AlyssaPng Sep 29, 2024
d094822
add example env files
Kb-Tay Sep 29, 2024
f39d549
Merge pull request #36 from CS3219-AY2425S1/example-env
AlyssaPng Sep 29, 2024
7d4cd54
add user service and create docker file
Kb-Tay Oct 4, 2024
5ee9846
compose with db
Kb-Tay Oct 4, 2024
ff39b8e
Update docker compose
Kb-Tay Oct 4, 2024
4071d92
Merge pull request #38 from CS3219-AY2425S1/split-service
Hwww23 Oct 4, 2024
e5e9e4f
PP-48
AlyssaPng Oct 4, 2024
129ef10
split question service from user and organise routes
Kb-Tay Oct 5, 2024
cbee59e
Remove old user service code
Kb-Tay Oct 5, 2024
44fe557
PP-50
zoebelle-pang Oct 5, 2024
3ce3452
PP-50 remove.env
zoebelle-pang Oct 5, 2024
090b1a7
Changes to env file
Kb-Tay Oct 5, 2024
6ce8853
Merge branch 'PP-50' of https://github.com/CS3219-AY2425S1/cs3219-ay2…
Kb-Tay Oct 5, 2024
e54520b
Update question service to create db and collection if not defined
Kb-Tay Oct 5, 2024
1061917
Merge pull request #39 from CS3219-AY2425S1/PP-50
Kb-Tay Oct 5, 2024
a357d05
Merge branch 'main' of https://github.com/CS3219-AY2425S1/cs3219-ay24…
AlyssaPng Oct 5, 2024
99a5a31
Merge pull request #40 from CS3219-AY2425S1/PP-53
AlyssaPng Oct 5, 2024
4c15a59
Merge branch 'main' of https://github.com/CS3219-AY2425S1/cs3219-ay24…
AlyssaPng Oct 5, 2024
7238430
PP-48 [Frontend] Link the API from front-end to Peerprep
AlyssaPng Oct 5, 2024
ed29ffa
Merge pull request #41 from CS3219-AY2425S1/PP-48
Kb-Tay Oct 5, 2024
576e511
Add question service dockerfile
SHni99 Oct 5, 2024
4b61629
Update docker compose file
SHni99 Oct 5, 2024
3ef420c
Fix go docker file
Kb-Tay Oct 6, 2024
419d40f
Save compose file
SHni99 Oct 6, 2024
d86fad2
fix logout route
Kb-Tay Oct 6, 2024
2a6ad16
Fix logout route, clean up user context to prevent undefined field ch…
Kb-Tay Oct 6, 2024
f756f65
Add question api context
SHni99 Oct 6, 2024
15c8c71
Merge branch 'PP-56' of https://github.com/CS3219-AY2425S1/cs3219-ay2…
Kb-Tay Oct 6, 2024
08cd007
Add token in CORS
SHni99 Oct 6, 2024
b68cd6d
reroute crus oprations in questions service
SHni99 Oct 6, 2024
231bca1
Refetch user data when edit profile
Kb-Tay Oct 6, 2024
d2e648e
Update readme and .env.sample files
Kb-Tay Oct 6, 2024
e1f1b10
Merge pull request #42 from CS3219-AY2425S1/PP-56
Kb-Tay Oct 6, 2024
52d3bc4
Merge pull request #43 from CS3219-AY2425S1/PP-56-aaron
SHni99 Oct 6, 2024
ce5c811
Merge branch 'main' of github.com:CS3219-AY2425S1/cs3219-ay2425s1-pro…
SHni99 Oct 6, 2024
6b2b00a
Update README.md
SHni99 Oct 6, 2024
3f3321b
Merge pull request #44 from CS3219-AY2425S1/update-readme
SHni99 Oct 6, 2024
8128ca4
Merge branch 'main' of github.com:CS3219-AY2425S1/cs3219-ay2425s1-pro…
SHni99 Oct 6, 2024
88ec604
redis express
Kb-Tay Oct 12, 2024
35833c0
Add monitoring for bull queues
Kb-Tay Oct 12, 2024
8733e87
Testing bull and redis
Kb-Tay Oct 12, 2024
f44ddcc
Merge branch 'redis-tut' of github.com:CS3219-AY2425S1/cs3219-ay2425s…
SHni99 Oct 13, 2024
688a2cd
Update bull queue algo
SHni99 Oct 13, 2024
38434c7
Add concurrenct in matching
SHni99 Oct 13, 2024
45fa0bd
Working job queue with 1 min timeout
Kb-Tay Oct 16, 2024
3192251
no message
zoebelle-pang Oct 17, 2024
d14d6e5
Merge branch 'PP-61' of https://github.com/CS3219-AY2425S1/cs3219-ay2…
zoebelle-pang Oct 17, 2024
9895d96
Merge pull request #46 from CS3219-AY2425S1/PP-61
SHni99 Oct 17, 2024
af7cd3f
frontend collab view
zoebelle-pang Oct 17, 2024
c959406
PP-60 [Backend] Websocket
AlyssaPng Oct 17, 2024
965265a
Merge branch 'PP-60' of https://github.com/CS3219-AY2425S1/cs3219-ay2…
zoebelle-pang Oct 17, 2024
a6ef3c7
only ui for collab
zoebelle-pang Oct 17, 2024
55be325
edit app.js
zoebelle-pang Oct 17, 2024
dd64677
no message
zoebelle-pang Oct 17, 2024
fe4d80d
Merge remote-tracking branch 'origin/PP-59' into testing-socket
Kb-Tay Oct 17, 2024
dd25d3a
edit dashboard to include socket
zoebelle-pang Oct 17, 2024
9db585c
Add dockerfile and fix join queue bug
AlyssaPng Oct 18, 2024
b40c892
Add redis image into dockercompose
AlyssaPng Oct 18, 2024
73ea483
Merge branch 'PP-59' of https://github.com/CS3219-AY2425S1/cs3219-ay2…
Kb-Tay Oct 18, 2024
75d1ee5
test
Kb-Tay Oct 18, 2024
10e147b
docker build for redis
Kb-Tay Oct 18, 2024
3919210
docker test
Kb-Tay Oct 18, 2024
2b3902b
Fix docker env
Kb-Tay Oct 18, 2024
9d44596
Fix docker compose for redis and matching service
Kb-Tay Oct 18, 2024
8473117
test
Kb-Tay Oct 18, 2024
15b6966
Add user to queue upon connection
Kb-Tay Oct 19, 2024
14dec47
Create socket connection upon connection page redirect. Add user to q…
Kb-Tay Oct 19, 2024
75d3e27
Remove user from queue upon socket disconnect
Kb-Tay Oct 19, 2024
272d87a
Successfully match users and notify frontend
Kb-Tay Oct 19, 2024
d404b5a
Add error handling for collaboration
Kb-Tay Oct 19, 2024
2e79761
Cleanup for bull queue. Handle duplicate emits from server to frontend
Kb-Tay Oct 19, 2024
a6fd295
Test docker and change db back
AlyssaPng Oct 19, 2024
b14457f
Add matching ui page
SHni99 Oct 20, 2024
1690dcc
Add matching service
SHni99 Oct 20, 2024
de3d114
Integrate UI into MatchingPage
Hwww23 Oct 20, 2024
c759fa5
Add username to join queue
AlyssaPng Oct 20, 2024
56abdf6
Fix ui
Kb-Tay Oct 20, 2024
dc20675
Update env data matching service
Kb-Tay Oct 20, 2024
d064879
Merge pull request #51 from CS3219-AY2425S1/fix-ui
AlyssaPng Oct 20, 2024
217e773
added reload
Hwww23 Oct 20, 2024
7d2479c
Merge pull request #52 from CS3219-AY2425S1/fix-ui
Kb-Tay Oct 20, 2024
c6b0152
PP-67 Leetcode Api
AlyssaPng Oct 22, 2024
bbd6034
Add Duplicate Check
AlyssaPng Oct 23, 2024
e245a81
Refractor QuestionView
AlyssaPng Oct 24, 2024
5a29aed
Add get topics
AlyssaPng Oct 25, 2024
d0bace6
Chnage dashboard UI
AlyssaPng Oct 25, 2024
0418fcc
Add docker compose watch to allow for hot reload
Kb-Tay Oct 27, 2024
4133458
Merge pull request #54 from CS3219-AY2425S1/docker-watch
SHni99 Oct 29, 2024
a3f7f65
Fix topic box color error
SHni99 Oct 29, 2024
7f7f7cd
Add monaco editor
SHni99 Oct 29, 2024
7552af3
Fix message service
SHni99 Oct 29, 2024
dba1c20
Add in question display
SHni99 Oct 29, 2024
1a0d3c1
Merge pull request #53 from CS3219-AY2425S1/PP-67
Kb-Tay Oct 29, 2024
0a47e70
Merge pull request #55 from CS3219-AY2425S1/collab-service
Kb-Tay Oct 29, 2024
03a1665
Update question model
Kb-Tay Oct 30, 2024
1e535a2
Update backend to store topic in array
Kb-Tay Oct 30, 2024
305c3be
Add assign question route to question service
Kb-Tay Oct 30, 2024
64c8451
Merge pull request #56 from CS3219-AY2425S1/PP-71
AlyssaPng Oct 31, 2024
e35e065
PP-72 and View Question Button Implementation
AlyssaPng Oct 31, 2024
1880bb1
Fix editor error
AlyssaPng Oct 31, 2024
1cbf3bd
Merge pull request #57 from CS3219-AY2425S1/PP-72
AlyssaPng Nov 1, 2024
71b510b
Add Code Mirror Editor
AlyssaPng Nov 1, 2024
f455c83
Create server for socket io
Kb-Tay Nov 1, 2024
70de1ce
Merge remote-tracking branch 'origin/frontend-codemirror' into collab
Kb-Tay Nov 1, 2024
1ac3e22
integrate frontend
Kb-Tay Nov 1, 2024
ad126fe
add roomId in path
Kb-Tay Nov 1, 2024
533e688
Implement Assign Question
AlyssaPng Nov 1, 2024
4eb7b15
Working implementation for collaboration backend without redis storage
Kb-Tay Nov 2, 2024
a41b841
Containerise collab service
Kb-Tay Nov 2, 2024
45b2047
questionroute file no issue
zoebelle-pang Nov 2, 2024
ab586d2
questionController and package.json no issue
zoebelle-pang Nov 2, 2024
db392b1
websocketcontroller no issue
zoebelle-pang Nov 2, 2024
803d9a8
-
zoebelle-pang Nov 2, 2024
be4cead
Merge branch 'assign-question' of https://github.com/CS3219-AY2425S1/…
AlyssaPng Nov 2, 2024
16273fe
Fix collab issues
AlyssaPng Nov 2, 2024
7b2dcbb
Fix get question issues
AlyssaPng Nov 2, 2024
bbd2db2
create UI for collab page
zoebelle-pang Nov 2, 2024
111290e
fix duplicate frontend issue
zoebelle-pang Nov 2, 2024
dbfcc8f
Add reconnect function to collaboration session and disconnect
Hwww23 Nov 2, 2024
d74d9c0
Merge pull request #60 from CS3219-AY2425S1/PP-69
Kb-Tay Nov 3, 2024
a1c52fc
resolve conflict exit-session
Hwww23 Nov 3, 2024
da9684d
Fix collab code editor
AlyssaPng Nov 3, 2024
5d70aa0
Fix assign question
AlyssaPng Nov 3, 2024
f8250d8
Remove change from collabcontroller
AlyssaPng Nov 3, 2024
08aae0c
Chnage pending
AlyssaPng Nov 3, 2024
c89a0d7
Fix room issue
AlyssaPng Nov 3, 2024
bad8eb7
Merge pull request #62 from CS3219-AY2425S1/exit-session
AlyssaPng Nov 4, 2024
098d3f3
Merge branch 'fix-assign' of https://github.com/CS3219-AY2425S1/cs321…
AlyssaPng Nov 4, 2024
f59ed5e
Merge pull request #63 from CS3219-AY2425S1/fix-assign
zoebelle-pang Nov 4, 2024
6f13923
Add api for adding questions
AlyssaPng Nov 4, 2024
7b71710
Temporary fix for the collab service
Kb-Tay Nov 4, 2024
4ecebf5
Fix issues of collab not working upon load
Kb-Tay Nov 4, 2024
05db94f
Add Histroy Page
AlyssaPng Nov 4, 2024
1c9ea5e
Merge branch 'fix-collab' of https://github.com/CS3219-AY2425S1/cs321…
AlyssaPng Nov 4, 2024
bd8203a
Merge pull request #64 from CS3219-AY2425S1/fix-collab
AlyssaPng Nov 4, 2024
64be624
PP-74 N2 History
AlyssaPng Nov 4, 2024
f69bcdc
Merge pull request #65 from CS3219-AY2425S1/PP-74
zoebelle-pang Nov 5, 2024
cdb95bb
Implement AI assistance
Hwww23 Nov 5, 2024
362b7d7
no message
zoebelle-pang Nov 5, 2024
7975987
Change ui
AlyssaPng Nov 5, 2024
a107be7
Merge branch 'main' of https://github.com/CS3219-AY2425S1/cs3219-ay24…
AlyssaPng Nov 5, 2024
5026651
no message
zoebelle-pang Nov 5, 2024
8707d2d
Sync disconnect
AlyssaPng Nov 5, 2024
65925d7
Merge branch 'gemini' of https://github.com/CS3219-AY2425S1/cs3219-ay…
AlyssaPng Nov 5, 2024
4a34429
Edit UI
AlyssaPng Nov 5, 2024
261d3f6
remove node modules
AlyssaPng Nov 5, 2024
de7b6f8
Fix UI
AlyssaPng Nov 5, 2024
a272d0f
edit socket backend
Kb-Tay Nov 5, 2024
5330829
Merge branch 'sync-session' of https://github.com/CS3219-AY2425S1/cs3…
Kb-Tay Nov 5, 2024
81b861d
Cleanup backend
Kb-Tay Nov 5, 2024
4e592c7
Merge pull request #68 from CS3219-AY2425S1/sync-session-aaron
Kb-Tay Nov 5, 2024
fa006e6
Merge pull request #67 from CS3219-AY2425S1/sync-session
Kb-Tay Nov 5, 2024
f036c5b
Merge branch 'main' of https://github.com/CS3219-AY2425S1/cs3219-ay24…
zoebelle-pang Nov 5, 2024
aa4da06
remove node modules
zoebelle-pang Nov 5, 2024
6f04a2d
Store code in sessionStorage
AlyssaPng Nov 5, 2024
c48136c
Implement setup for codeMirror
AlyssaPng Nov 5, 2024
b1b8ef8
improve UI and fix chat echo issue
zoebelle-pang Nov 5, 2024
be2e8e3
no message
zoebelle-pang Nov 5, 2024
d5c350d
Merge branch 'reconnect-code' of https://github.com/CS3219-AY2425S1/c…
zoebelle-pang Nov 5, 2024
35eb918
Code compilation
Kb-Tay Nov 5, 2024
4e5d2bb
ui changes
Kb-Tay Nov 5, 2024
03cb766
Merge pull request #66 from CS3219-AY2425S1/chatservice
Kb-Tay Nov 5, 2024
ced69ac
Merge remote-tracking branch 'origin' into code-formatting
Kb-Tay Nov 5, 2024
638679b
Update env example file
Kb-Tay Nov 5, 2024
0acd0f3
Add end session
AlyssaPng Nov 6, 2024
6fd0019
Change UI back
AlyssaPng Nov 6, 2024
230f96c
Add scroll bar
AlyssaPng Nov 6, 2024
050a529
Merge pull request #69 from CS3219-AY2425S1/code-formatting
AlyssaPng Nov 6, 2024
e2b46f9
Merge branch 'main' into end-session
AlyssaPng Nov 6, 2024
cd22568
Merge pull request #70 from CS3219-AY2425S1/end-session
Kb-Tay Nov 6, 2024
3010c99
restrict to only enable admin add,edit and delete questions
zoebelle-pang Nov 9, 2024
0082b0a
Update matching service env
Kb-Tay Nov 9, 2024
6c6307f
Update env example files
Kb-Tay Nov 9, 2024
a4fd3ac
Merge pull request #72 from CS3219-AY2425S1/admin-question
AlyssaPng Nov 9, 2024
d172879
remove chat service and put into collab service
zoebelle-pang Nov 9, 2024
2bfaa94
Working socket implementation
Kb-Tay Nov 9, 2024
ed791ee
disconnect notification
zoebelle-pang Nov 9, 2024
b8d6be8
add reconnect and connect notifcation in chat
zoebelle-pang Nov 9, 2024
c665c10
ensure one listener for "newConnection" is active at any time.
zoebelle-pang Nov 9, 2024
49672d2
Merge pull request #73 from CS3219-AY2425S1/admin-question
Kb-Tay Nov 9, 2024
bfce237
Merge branch 'main' into update_env
Kb-Tay Nov 9, 2024
6e53ddf
working collab service
Kb-Tay Nov 9, 2024
920fbce
Add question interceptor
AlyssaPng Nov 9, 2024
5c0c91c
Merge branch 'update_env' of https://github.com/CS3219-AY2425S1/cs321…
AlyssaPng Nov 9, 2024
80a7605
Add token check
AlyssaPng Nov 9, 2024
234c6c0
Change from nodeport to clusterIP
Kb-Tay Nov 9, 2024
661b932
Merge remote-tracking branch 'origin/check-auth' into update_env
Kb-Tay Nov 9, 2024
5aaa4fa
Update env example. Services in docker file now match kubernetes files
Kb-Tay Nov 9, 2024
f025c10
Refine collab page UI
zoebelle-pang Nov 9, 2024
9caef47
Remove admin checkbox in registration page
zoebelle-pang Nov 9, 2024
48c00c6
Disable Action column if its non-admin user
zoebelle-pang Nov 9, 2024
ce7be89
remove Add LeetCode Question and Add Question for non-admin users
zoebelle-pang Nov 9, 2024
4c836db
Align the buttons in dashboard
zoebelle-pang Nov 9, 2024
dc0ad28
Restrict email input to only lower-case
zoebelle-pang Nov 9, 2024
aafc59e
no message
zoebelle-pang Nov 10, 2024
f6ca32f
no message
zoebelle-pang Nov 10, 2024
6e9a062
Chat prompt to include code in editor but unable to put beside
Hwww23 Nov 10, 2024
393dece
Fix filter on history
SHni99 Nov 10, 2024
cef91e8
Merge branch 'Refine-UI' of github.com:CS3219-AY2425S1/cs3219-ay2425s…
SHni99 Nov 10, 2024
6c4a663
change yaml configurations
Kb-Tay Nov 10, 2024
7cfe739
Merge pull request #76 from CS3219-AY2425S1/Refine-UI
Kb-Tay Nov 10, 2024
2de4e1a
text change align
Hwww23 Nov 10, 2024
06edce9
Merge pull request #77 from CS3219-AY2425S1/Refine-UI-2
SHni99 Nov 10, 2024
48003e8
merge with main
Kb-Tay Nov 10, 2024
e3a790b
no message
zoebelle-pang Nov 10, 2024
2661b6c
Merge pull request #78 from CS3219-AY2425S1/admin-question
Hwww23 Nov 10, 2024
3cf3189
no message
zoebelle-pang Nov 10, 2024
59dcbcc
Merge pull request #79 from CS3219-AY2425S1/admin-question
Hwww23 Nov 10, 2024
7cab8cb
Change chat bubble to be flexible to text size
zoebelle-pang Nov 10, 2024
b9e6201
remove comment
zoebelle-pang Nov 10, 2024
7ce843d
remove unused images
zoebelle-pang Nov 10, 2024
3489cc1
Merge pull request #80 from CS3219-AY2425S1/admin-question
Hwww23 Nov 10, 2024
7fd105c
Merge pull request #74 from CS3219-AY2425S1/update_env
AlyssaPng Nov 10, 2024
dab587f
Change env
AlyssaPng Nov 13, 2024
dd3c911
Fix retry
Kb-Tay Nov 13, 2024
4f95aa4
Add report
Kb-Tay Nov 13, 2024
f533966
Fix leetcode api
AlyssaPng Nov 13, 2024
e2ffaa9
Fix title header
AlyssaPng Nov 13, 2024
f414f43
Add data on queue when match failed
Kb-Tay Nov 13, 2024
2b5684e
changes to frontend chat and gemini
zoebelle-pang Nov 13, 2024
f343765
change welcome message
zoebelle-pang Nov 13, 2024
2b128a0
remove comments
zoebelle-pang Nov 13, 2024
4b132ba
Merge branch 'new_changes' of https://github.com/CS3219-AY2425S1/cs32…
AlyssaPng Nov 13, 2024
9982694
Merge branch 'trywork' of https://github.com/CS3219-AY2425S1/cs3219-a…
AlyssaPng Nov 13, 2024
c1dbce8
Merge pull request #82 from CS3219-AY2425S1/fix-local
zoebelle-pang Nov 13, 2024
e02472a
fix noti error
zoebelle-pang Nov 13, 2024
3521dcf
Update yaml files
Kb-Tay Nov 13, 2024
bfb00bb
Merge pull request #85 from CS3219-AY2425S1/final-commit
Kb-Tay Nov 13, 2024
e171497
Merge pull request #86 from CS3219-AY2425S1/trywork
Kb-Tay 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
Binary file added G48_Report.pdf
Binary file not shown.
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
[![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.
## Group: G48

### 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.

### Quick start guide

#### Run app with docker

- Read the guides of the backend services and frontend services to setup the .env file.
- For each service, copy the .env.sample file and rename it to .env
- For the `user` and `question` service, update the `MONGODB_CLOUD_URI` with ur mongodb atlas uri if you are using `PROD` mode.
- To start the app, `cd` to the backend folder and run the command `docker compose up`.
- To stop the app, run the command `docker compose down`.
1 change: 1 addition & 0 deletions backend/CollaborationService/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
9 changes: 9 additions & 0 deletions backend/CollaborationService/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PORT=3004
FRONTEND_URL='http://localhost:5173'
USER_SERVICE=http://user-service:3001

REDIS_URL='redis://redis:6379'
# REDIS_HOST='redis'
# REDIS_PORT='6379'

ENV="DEV" # dev will use hosted service, prod uses cloud
2 changes: 2 additions & 0 deletions backend/CollaborationService/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/node_modules
**/.env
66 changes: 66 additions & 0 deletions backend/CollaborationService/dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = __importDefault(require("express"));
// const server = http.createServer();
const app = (0, express_1.default)();
// The updates received so far (updates.length gives the current
// version)
// let updates: Update[] = [];
// // The current document
// let doc = Text.of(["Start document"]);
// let pending: ((value: any) => void)[] = [];
// let io = new Server(server, {
// path: "/api",
// cors: {
// origin: "*",
// methods: ["GET", "POST"],
// },
// });
// // listening for connections from clients
// io.on("connection", (socket: Socket) => {
// socket.on("pullUpdates", (version: number) => {
// if (version < updates.length) {
// socket.emit("pullUpdateResponse", JSON.stringify(updates.slice(version)));
// } else {
// pending.push((updates) => {
// socket.emit(
// "pullUpdateResponse",
// JSON.stringify(updates.slice(version))
// );
// });
// }
// });
// socket.on("pushUpdates", (version, docUpdates) => {
// docUpdates = JSON.parse(docUpdates);
// try {
// if (version != updates.length) {
// socket.emit("pushUpdateResponse", false);
// } else {
// for (let update of docUpdates) {
// // Convert the JSON representation to an actual ChangeSet
// // instance
// let changes = ChangeSet.fromJSON(update.changes);
// updates.push({ changes, clientID: update.clientID });
// doc = changes.apply(doc);
// }
// socket.emit("pushUpdateResponse", true);
// while (pending.length) pending.pop()!(updates);
// }
// } catch (error) {
// console.error(error);
// }
// });
// socket.on("getDocument", () => {
// socket.emit("getDocumentResponse", updates.length, doc.toString());
// });
// });
// const port = process.env.PORT || 3000;
// server.listen(port, () => console.log(`Server listening on port: ${port}`));
app.use(express_1.default.json());
app.use(express_1.default.urlencoded({ extended: true }));
app.get("/", (req, res) => {
res.send("Hello World!");
});
20 changes: 20 additions & 0 deletions backend/CollaborationService/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use an official Node.js runtime as a parent image
FROM node:20-alpine

# Set the working directory in the container
WORKDIR /app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install any dependencies
RUN npm install

# Bundle app source inside the Docker image
COPY . .

# Make port 5173 available to the world outside this container
EXPOSE 3004

# Define the command to run your app
CMD ["npm", "run", "dev"]
Loading