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

Milestone D7 #132

Merged
merged 294 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
294 commits
Select commit Hold shift + click to select a range
9f350d2
Fix lint error and bugs in specific scenarios
jolynloh Oct 28, 2024
9c704c2
Merge branch 'development' into FE/collabPage
jolynloh Oct 28, 2024
678d15e
Enable chat on the frontend
nicolelim02 Oct 29, 2024
826965c
Communication service
nicolelim02 Oct 29, 2024
d3ee4cc
Change display
nicolelim02 Oct 29, 2024
8bc98c8
Fix port
guanquann Oct 29, 2024
a45869b
Update FE
guanquann Oct 29, 2024
c269044
Merge pull request #86 from guanquann/code-execution
nicolelim02 Oct 29, 2024
9aeead1
Merge pull request #90 from jolynloh/FE/collabPage
nicolelim02 Oct 29, 2024
be6e597
Merge pull request #89 from nicolelim02/chore/refactor
guanquann Oct 29, 2024
204c26b
Fix chat scroll
nicolelim02 Oct 29, 2024
e1307a9
Merge branch 'development' into feat/communication
nicolelim02 Oct 29, 2024
9d05bf9
Remove newline on enter and scroll to the last message
nicolelim02 Oct 30, 2024
65c9cd7
Fix textbox to the bottom
nicolelim02 Oct 30, 2024
5f4834e
Add communication service into ci
nicolelim02 Oct 30, 2024
33554ec
Add tests
nicolelim02 Oct 30, 2024
81b43be
Fix scrolling and trim input
nicolelim02 Oct 30, 2024
21c4d2a
Remove unused code
nicolelim02 Oct 30, 2024
ee43fb4
Add border below tabs
nicolelim02 Oct 30, 2024
bb8c950
Add test case components
nicolelim02 Oct 30, 2024
3a02277
Add test case input fields
jolynloh Oct 30, 2024
6eb8211
Allow users to enter newline using shift+enter
nicolelim02 Oct 30, 2024
71695dc
Add tooltip help message for test cases
jolynloh Oct 30, 2024
467baae
Add file upload component
jolynloh Oct 30, 2024
3805bdb
Complete file upload FE implementation
jolynloh Oct 31, 2024
08641b1
Merge branch 'development' of https://github.com/ruiqi7/peer-prep int…
ruiqi7 Oct 31, 2024
c19981b
Add qn history microservice
feliciagan Oct 31, 2024
c4b57f0
resolve merge conflicts
feliciagan Oct 31, 2024
558fa21
Implement code template input fields on frontend
jolynloh Oct 31, 2024
2ea2620
Add question history detail page
feliciagan Oct 31, 2024
287657f
Add title to qnhistdetails page
feliciagan Oct 31, 2024
c9c054e
Allow code editor to be read only
ruiqi7 Oct 31, 2024
fc2f3f8
Implement BE for storing testcases and integrate with FE
jolynloh Oct 31, 2024
129add1
Differentiate collab cursor by uid
ruiqi7 Oct 31, 2024
c7b8533
Merge pull request #91 from nicolelim02/feat/communication
guanquann Oct 31, 2024
8302d1d
change qnhistoryservice port number
feliciagan Oct 31, 2024
06b5ae2
resolve merge conflicts
feliciagan Oct 31, 2024
422a74f
Merge branch 'development' into feature/admin-add-test-cases
jolynloh Oct 31, 2024
258817a
Change code template input field to monospace font
jolynloh Nov 1, 2024
6d3f01c
Customise cursor style
ruiqi7 Nov 1, 2024
2cacd12
Remove decoration for user's own cursor
ruiqi7 Nov 1, 2024
46be3f7
Store collab sessions by room id
ruiqi7 Nov 1, 2024
6e8d8d5
resolve comment issues and add loader to prevent error msg rendering …
feliciagan Nov 2, 2024
5f1ade4
Add docs
nicolelim02 Nov 2, 2024
9865824
resolve comment issues and setup tests
feliciagan Nov 2, 2024
d67572a
Switch to yjs
ruiqi7 Nov 2, 2024
d4c86e9
Create ydoc on join
ruiqi7 Nov 3, 2024
9fe7636
Include test cases and code templates in question update
jolynloh Nov 3, 2024
9d7fd67
Add default code templates
jolynloh Nov 3, 2024
64b95f1
Update read random question controller
jolynloh Nov 3, 2024
87e07dd
Allow editor to be initialized with template
ruiqi7 Nov 3, 2024
8c279a3
Update code execution and fix some bugs
guanquann Nov 3, 2024
3edb8fe
Upgrade to yjs v2
ruiqi7 Nov 3, 2024
e94ec37
Save code to redis
ruiqi7 Nov 3, 2024
2268430
Partial handling of reconnection
ruiqi7 Nov 3, 2024
6510118
Clean up
ruiqi7 Nov 4, 2024
2c5bce1
Merge branch 'development' of https://github.com/ruiqi7/peer-prep int…
ruiqi7 Nov 4, 2024
369c75a
Remove testcase manual add
jolynloh Nov 4, 2024
73012f8
Merge pull request #92 from feliciagan/qnhist
jolynloh Nov 4, 2024
d59076f
Fix conflict errors
ruiqi7 Nov 4, 2024
7797157
Merge branch 'development' of https://github.com/ruiqi7/peer-prep int…
ruiqi7 Nov 4, 2024
87138d8
Merge branch 'development' into feature/admin-add-test-cases
jolynloh Nov 4, 2024
0ba50ee
Merge pull request #93 from jolynloh/feature/admin-add-test-cases
guanquann Nov 4, 2024
b955e93
Merge branch 'development' of https://github.com/ruiqi7/peer-prep int…
ruiqi7 Nov 4, 2024
186b796
merge and update code execution
guanquann Nov 4, 2024
993b716
Merge branch 'development' into feat/communication
nicolelim02 Nov 4, 2024
30d35b3
Update question service test and swagger
guanquann Nov 4, 2024
c9d5f94
Fix lint
guanquann Nov 4, 2024
4a3c861
Fix some linting issues
nicolelim02 Nov 4, 2024
009712f
Merge pull request #95 from nicolelim02/feat/communication
guanquann Nov 4, 2024
31a1580
Fix conflicts
guanquann Nov 4, 2024
fff8425
Integrate code editor for qns history
ruiqi7 Nov 4, 2024
5bdbf9a
Fix linting issue
nicolelim02 Nov 4, 2024
a3d87ca
Update to triple line instead
guanquann Nov 4, 2024
60889b4
Update frontend tooltip message for file input
guanquann Nov 4, 2024
551331d
Display test cases
nicolelim02 Nov 4, 2024
aec6625
Update tooltip
guanquann Nov 4, 2024
4724e7f
Seed question
guanquann Nov 4, 2024
14b0299
Fix code template initialization
ruiqi7 Nov 4, 2024
8898a48
Merge pull request #94 from ruiqi7/feature/coding-sandbox
guanquann Nov 4, 2024
e8a917a
Submit button
guanquann Nov 4, 2024
d0be32b
Submit button
guanquann Nov 4, 2024
78bfcdb
Create new redis instance for collab service
ruiqi7 Nov 4, 2024
46d13ad
Merge branch 'development' of https://github.com/ruiqi7/peer-prep int…
ruiqi7 Nov 4, 2024
0486444
Fix linting
ruiqi7 Nov 4, 2024
a48b914
End session
guanquann Nov 5, 2024
1f284ec
Catch invalid file url in code exe
guanquann Nov 5, 2024
12f7dc4
Add collab context
guanquann Nov 5, 2024
8f663b3
Fix type
guanquann Nov 5, 2024
3503bcf
Close communication socket when unmount
nicolelim02 Nov 5, 2024
9749003
Merge branch 'development' into feat/communication
nicolelim02 Nov 5, 2024
6d5ef0a
Merge pull request #96 from guanquann/code-execution
ruiqi7 Nov 5, 2024
af11aee
Merge branch 'development' of https://github.com/ruiqi7/peer-prep int…
ruiqi7 Nov 5, 2024
39b04ba
Merge branch 'development' of https://github.com/guanquann/cs3219-ay2…
guanquann Nov 5, 2024
563a247
Merge pull request #98 from ruiqi7/feature/coding-sandbox
guanquann Nov 5, 2024
0719b06
Merge branch 'development' into feat/communication
guanquann Nov 5, 2024
9bd6b1d
Merge branch 'development' of https://github.com/guanquann/cs3219-ay2…
guanquann Nov 5, 2024
6a05682
Fix loading code template bug and css
ruiqi7 Nov 5, 2024
bc7b1b0
Redirect to home if error joining collab room
ruiqi7 Nov 5, 2024
c26169e
Add seed qns, fix minor bug in code exe
guanquann Nov 5, 2024
ffd87c8
More qns
guanquann Nov 5, 2024
3079541
More questions and answers
guanquann Nov 5, 2024
1356a66
Shift end session logic to collab context
ruiqi7 Nov 5, 2024
ead61df
More answers
guanquann Nov 5, 2024
853ecff
More questions and answers
guanquann Nov 5, 2024
4f414e5
Merge pull request #100 from guanquann/questionSeed
feliciagan Nov 5, 2024
6329576
Merge pull request #99 from nicolelim02/feat/communication
feliciagan Nov 5, 2024
2141b0f
Merge branch 'development' into feat/collab
nicolelim02 Nov 5, 2024
69e7846
Merge pull request #101 from ruiqi7/feature/coding-sandbox
feliciagan Nov 5, 2024
b431b11
Change separator for test files
nicolelim02 Nov 5, 2024
4593412
Update code execution
nicolelim02 Nov 5, 2024
30e8258
Remove extra QuestionDetail type and
nicolelim02 Nov 5, 2024
ca07d5e
Fix testcases output
nicolelim02 Nov 5, 2024
920dd80
Merge pull request #97 from nicolelim02/feat/collab
feliciagan Nov 5, 2024
d9fb768
Change configs for aws eb
jolynloh Nov 6, 2024
506e36e
Merge branch 'development' into deployment
jolynloh Nov 6, 2024
3ca60ea
Close communication socket when user ends session
nicolelim02 Nov 6, 2024
798819c
Update code execution
guanquann Nov 6, 2024
427b044
Merge pull request #102 from nicolelim02/feat/communication
guanquann Nov 6, 2024
5cb3d86
Merge branch 'development' of https://github.com/guanquann/cs3219-ay2…
guanquann Nov 6, 2024
dd1d4e9
Merge pull request #103 from guanquann/code-execution-fe
nicolelim02 Nov 6, 2024
58d045f
Update question history with current progress when user end session w…
guanquann Nov 6, 2024
751c444
Merge branch 'development' of https://github.com/guanquann/cs3219-ay2…
guanquann Nov 6, 2024
4a30256
Merge branch 'development' into code-execution-fe
guanquann Nov 6, 2024
d97c049
Fix linting
nicolelim02 Nov 6, 2024
93504ea
Merge pull request #104 from guanquann/code-execution-fe
nicolelim02 Nov 6, 2024
7054696
Fix linting
nicolelim02 Nov 6, 2024
0a77cbf
Merge pull request #105 from nicolelim02/feat/collab
ruiqi7 Nov 6, 2024
0237d86
Remove testcasesApi
nicolelim02 Nov 6, 2024
a08f41b
Remove unused code
nicolelim02 Nov 6, 2024
bd320d3
Close socket connection after a delay
nicolelim02 Nov 6, 2024
4e0ab4b
Remove comment
nicolelim02 Nov 6, 2024
297bbd8
Update docs
nicolelim02 Nov 6, 2024
ed7c611
Merge pull request #106 from nicolelim02/feat/collab
ruiqi7 Nov 6, 2024
d2530d5
Remove setCompilerResult
nicolelim02 Nov 6, 2024
173658f
Merge pull request #107 from nicolelim02/feat/communication
ruiqi7 Nov 6, 2024
98e3946
Merge pull request #108 from nicolelim02/feat/collab
ruiqi7 Nov 6, 2024
3ae82c8
Merge branch 'development' of https://github.com/guanquann/cs3219-ay2…
guanquann Nov 6, 2024
ce31ad8
Fix sanbox
guanquann Nov 6, 2024
8580bea
Merge pull request #109 from guanquann/code-execution-fe
nicolelim02 Nov 6, 2024
ad3c6c4
Verify user's auth status
nicolelim02 Nov 6, 2024
b52957e
Merge branch 'development' into deployment
jolynloh Nov 6, 2024
2f23a0c
Fix end session on page refresh and tab closure
ruiqi7 Nov 6, 2024
4e96605
add filters and sorting for qnhistory
feliciagan Nov 7, 2024
70c3c6d
Add token verification for socket connection + refactor code
nicolelim02 Nov 7, 2024
bcc0d13
change create qn history record to be at collab instead of match
feliciagan Nov 7, 2024
38cc608
Modify alert message for collab page
ruiqi7 Nov 7, 2024
617a5e4
add qn history tests and fix bug
feliciagan Nov 7, 2024
1757a47
Merge branch 'development' into feat/communication
nicolelim02 Nov 7, 2024
5a6c04f
Handle partner ending or leaving session
ruiqi7 Nov 7, 2024
b238983
Refactor code
nicolelim02 Nov 7, 2024
a3cfa62
clean up code
feliciagan Nov 7, 2024
640e575
Merge pull request #110 from nicolelim02/feat/communication
feliciagan Nov 7, 2024
af2dfe3
resolve merge conflicts
feliciagan Nov 7, 2024
cf24c32
Add verifytoken check for qn history
feliciagan Nov 7, 2024
df8ef53
Fix lint error
feliciagan Nov 7, 2024
97d6ced
Merge branch 'development' into feat/communication
nicolelim02 Nov 7, 2024
4f18fb7
Remove unused import
nicolelim02 Nov 7, 2024
4e1c332
Add pop up before session end
ruiqi7 Nov 7, 2024
40fd3f0
Define types in separate file
feliciagan Nov 7, 2024
1429351
Fix collab page stuck on loading
ruiqi7 Nov 7, 2024
bd96074
Merge branch 'development' of https://github.com/ruiqi7/peer-prep int…
ruiqi7 Nov 7, 2024
0551489
Refactor env
jolynloh Nov 8, 2024
f50c891
Merge dev
jolynloh Nov 8, 2024
f490f9a
Refactor code
nicolelim02 Nov 8, 2024
32f27c1
Merge pull request #112 from nicolelim02/feat/communication
ruiqi7 Nov 8, 2024
fd03c79
Merge branch 'development' into qnhist
feliciagan Nov 8, 2024
403a3d8
Merge branch 'development' of https://github.com/ruiqi7/peer-prep int…
ruiqi7 Nov 8, 2024
f9498b0
Resolve comment issues
feliciagan Nov 8, 2024
be86ef9
Config and edits
jolynloh Nov 8, 2024
3132abd
Remove unused files
jolynloh Nov 8, 2024
53c6a23
Comment out unused import
jolynloh Nov 8, 2024
1c043de
Remove console log...
jolynloh Nov 8, 2024
01fc14b
Fix frontend testcases
nicolelim02 Nov 8, 2024
c29ba6b
Merge pull request #115 from nicolelim02/feat/communication
feliciagan Nov 8, 2024
17de192
Merge pull request #111 from feliciagan/qnhist
nicolelim02 Nov 8, 2024
fd2a2d2
fix linting error
feliciagan Nov 8, 2024
5e939fd
Fix excessive re-rendering of components that use collab context
ruiqi7 Nov 8, 2024
5f85c7f
Preview test case and code template
guanquann Nov 8, 2024
1f5712f
Merge branch 'development' of https://github.com/ruiqi7/peer-prep int…
ruiqi7 Nov 8, 2024
f16b0d0
Remove unused function
feliciagan Nov 8, 2024
e7daae4
Fix update qn history bug
ruiqi7 Nov 8, 2024
683f032
Get doc from redis if not found on server
ruiqi7 Nov 9, 2024
d7aaa90
Handle collab end on client refresh
ruiqi7 Nov 9, 2024
77e231a
Prevent code editor from re-rendering on code change
ruiqi7 Nov 9, 2024
7a55edd
Merge pull request #113 from ruiqi7/feature/collab-service
guanquann Nov 9, 2024
75529bb
Merge branch 'development' into qnhist
feliciagan Nov 9, 2024
394921a
Merge pull request #116 from feliciagan/qnhist
guanquann Nov 10, 2024
d1e3dbc
Merge pull request #117 from guanquann/qn-service-preview
jolynloh Nov 10, 2024
086f03b
Merge branch 'development' into deployment
jolynloh Nov 10, 2024
40700b4
Fix test
guanquann Nov 10, 2024
1342ab4
Merge pull request #119 from guanquann/test-fix
jolynloh Nov 10, 2024
4ab2040
Merge branch 'development' into deployment
jolynloh Nov 10, 2024
e8cc259
Fix qns history
guanquann Nov 10, 2024
eabdce9
Merge pull request #120 from guanquann/test-fix
nicolelim02 Nov 10, 2024
db722a0
Define location state type
ruiqi7 Nov 10, 2024
0d744bf
Merge pull request #121 from ruiqi7/bugfix/general
nicolelim02 Nov 10, 2024
1961f3c
Add build script
nicolelim02 Nov 10, 2024
96b68cd
Merge branch 'development' into chore/build
nicolelim02 Nov 10, 2024
73b4439
Add build script
nicolelim02 Nov 10, 2024
241114f
Add build step
nicolelim02 Nov 10, 2024
3f9359c
Add response check
jolynloh Nov 10, 2024
81a87f8
Refactor
ruiqi7 Nov 11, 2024
e5be523
Update readme
ruiqi7 Nov 11, 2024
c147f6c
Update collab service readme
ruiqi7 Nov 11, 2024
db94a59
Update matching service readme
ruiqi7 Nov 12, 2024
e98e697
Add tests for matching socket
ruiqi7 Nov 12, 2024
66d6b0e
Merge pull request #123 from ruiqi7/refactor/matching-service
nicolelim02 Nov 12, 2024
20ce8bb
Add tests for collab socket
ruiqi7 Nov 12, 2024
b5e834b
Merge branch 'development' of https://github.com/ruiqi7/peer-prep int…
ruiqi7 Nov 12, 2024
453f25f
Remove commented code
ruiqi7 Nov 12, 2024
2281996
Remove console.log
ruiqi7 Nov 12, 2024
3fb91e0
Merge pull request #114 from jolynloh/deployment
ruiqi7 Nov 12, 2024
228209c
Merge branch 'development' of https://github.com/ruiqi7/peer-prep int…
ruiqi7 Nov 12, 2024
64d4c12
Remove console.log
ruiqi7 Nov 12, 2024
ac083cd
Merge branch 'development' into chore/build
nicolelim02 Nov 12, 2024
74b8cd5
Fix rematch bug and log queue states
ruiqi7 Nov 12, 2024
1beb4f4
Fix sockets auth
ruiqi7 Nov 12, 2024
30d7a0a
Remove useMatch in collab components
ruiqi7 Nov 12, 2024
8af2be2
Remove useMatch in code editor
ruiqi7 Nov 12, 2024
86c50ff
Add missing dependency
ruiqi7 Nov 12, 2024
1fcddd8
Remove duplicate uid
ruiqi7 Nov 12, 2024
07415e8
Update usematch mock
ruiqi7 Nov 13, 2024
614dde5
Merge pull request #124 from ruiqi7/qa/test-cases
nicolelim02 Nov 13, 2024
2a64d0a
Merge branch 'development' into chore/build
nicolelim02 Nov 13, 2024
44e5aa3
Add chat notificiation
nicolelim02 Nov 13, 2024
87089d8
Merge branch 'development' of https://github.com/ruiqi7/peer-prep int…
ruiqi7 Nov 13, 2024
52c9224
Update dockerignore and readme
nicolelim02 Nov 13, 2024
e5461dd
Merge pull request #126 from nicolelim02/feat/communication
guanquann Nov 13, 2024
6561d2f
Fix matching service tests
nicolelim02 Nov 13, 2024
0d78b27
Fix frontend linting
nicolelim02 Nov 13, 2024
af35589
Fix dockerfile warnings
nicolelim02 Nov 13, 2024
a516ac4
Merge pull request #127 from nicolelim02/feat/communication
guanquann Nov 13, 2024
d4009ba
Merge pull request #122 from nicolelim02/chore/build
guanquann Nov 13, 2024
71b883a
Merge branch 'development' of https://github.com/ruiqi7/peer-prep int…
ruiqi7 Nov 13, 2024
fe3e5b6
Comment out build step
nicolelim02 Nov 13, 2024
5c17ab7
Add reference
guanquann Nov 13, 2024
e6dfd6a
Merge pull request #128 from nicolelim02/chore/build
guanquann Nov 13, 2024
8e5d960
Merge branch 'development' of https://github.com/guanquann/cs3219-ay2…
guanquann Nov 13, 2024
5927898
Merge pull request #129 from guanquann/readme
nicolelim02 Nov 13, 2024
f871392
Update test
guanquann Nov 13, 2024
56518d4
Update tsconfig
nicolelim02 Nov 13, 2024
7d2f7fe
Fix test
guanquann Nov 13, 2024
30db5ca
Update api
guanquann Nov 13, 2024
dff9969
Merge pull request #125 from ruiqi7/bugfix/general
feliciagan Nov 13, 2024
bb20400
Merge pull request #130 from nicolelim02/chore/build
feliciagan Nov 13, 2024
eac5b8f
Fix conflicts
guanquann Nov 13, 2024
d37b252
Merge pull request #131 from guanquann/readme
nicolelim02 Nov 13, 2024
1d8e71a
Modify README
jolynloh Nov 13, 2024
015d195
Merge pull request #133 from jolynloh/development
jolynloh 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
16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,22 @@ jobs:
run: npm run lint
- name: Test
run: docker compose -f docker-compose-test.yml run --rm test-frontend
# - name: Build
# run: docker compose -f docker-compose-prod.yml build frontend
backend-ci:
runs-on: ubuntu-latest
strategy:
matrix:
service: [question-service, user-service, matching-service]
service:
[
question-service,
user-service,
matching-service,
collab-service,
code-execution-service,
communication-service,
qn-history-service,
]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -54,4 +65,7 @@ jobs:
FIREBASE_CLIENT_EMAIL: ${{ secrets.FIREBASE_CLIENT_EMAIL }}
FIREBASE_STORAGE_BUCKET: ${{ secrets.FIREBASE_STORAGE_BUCKET }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
ONE_COMPILER_KEY: ${{ secrets.ONE_COMPILER_KEY }}
run: docker compose -f docker-compose-test.yml run --rm test-${{ matrix.service }}
# - name: Build
# run: docker compose -f docker-compose-prod.yml build ${{ matrix.service }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ node_modules
dist
dist-ssr
*.local
*.tsbuildinfo

# Coverage
coverage
Expand Down
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CS3219 Project (PeerPrep) - AY2425S1 Group 28

## Deployment

We deployed PeerPrep on AWS ECS. It is accessible [here](http://peerprep-frontend-alb-1935920115.ap-southeast-1.elb.amazonaws.com/).

## Setting up

We will be using Docker to set up PeerPrep. Install Docker [here](https://docs.docker.com/get-started/get-docker).
Expand All @@ -24,9 +28,40 @@ To stop all the services, use the following command:
docker-compose down
```

## Running in Production Mode

1. Build all the services (without using cache).

```
docker-compose -f docker-compose-prod.yml build --no-cache
```

2. Run all the services (in detached mode).

```
docker-compose -f docker-compose-prod.yml up -d
```

To stop all the services, use the following command:

```
docker-compose -f docker-compose-prod.yml down
```

## Useful links

- User Service: http://localhost:3001

- Question Service: http://localhost:3000

- Matching Service: http://localhost:3002

- Collab Service: http://localhost:3003

- Code Execution Service: http://localhost:3004

- Communication Service: http://localhost:3005

- Question History Service: http://localhost:3006

- Frontend: http://localhost:5173
16 changes: 14 additions & 2 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@

> Before proceeding to each microservice for more instructions:

1. Set up 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.
1. Set up cloud MongoDB if you are 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. Otherwise, if you are using `docker-compose.yml` to run PeerPrep, check out the READMEs in the different backend microservices to set up the `.env` files for the local MongoDB instances.

2. Set up Firebase.

3. Follow the instructions [here](https://nodejs.org/en/download/package-manager) to set up Node v20.
3. For the microservices that use Redis, to view the contents stored:

1. Go to [http://localhost:5540](http://localhost:5540).

2. Click on "Add Redis Database".

3. Enter `host.docker.internal` as the Host.

4. Enter the port used by the respective service:
- User Service: `6379`
- Collab Service: `6380`

4. Follow the instructions [here](https://nodejs.org/en/download/package-manager) to set up Node v20.

## Setting-up cloud MongoDB (in production)

Expand Down
6 changes: 6 additions & 0 deletions backend/code-execution-service/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
coverage
node_modules
tests
.env*
*.md
dist
12 changes: 12 additions & 0 deletions backend/code-execution-service/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
NODE_ENV=development
SERVICE_PORT=3004

# Origins for cors
ORIGINS=http://localhost:5173,http://127.0.0.1:5173

# Other service APIs
QUESTION_SERVICE_URL=http://question-service:3000/api/questions

# One Compiler configuration
ONE_COMPILER_URL=https://onecompiler-apis.p.rapidapi.com/api/v1/run
ONE_COMPILER_KEY=<ONE_COMPILER_KEY>
25 changes: 25 additions & 0 deletions backend/code-execution-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM node:20-alpine AS base

WORKDIR /code-execution-service

COPY package*.json .

RUN npm ci

COPY . .

EXPOSE 3004

# DEV

FROM base AS dev

CMD ["npm", "run", "dev"]

# PROD

FROM base AS prod

RUN npm run build

CMD ["npm", "start"]
29 changes: 29 additions & 0 deletions backend/code-execution-service/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Code Execution Service Guide

## Setting-up Code Execution Service

1. In the `code-execution-service` directory, create a copy of the `.env.sample` file and name it `.env`.

2. Sign up for a free OneCompiler API [here](https://rapidapi.com/onecompiler-onecompiler-default/api/onecompiler-apis).

3. Update `ONE_COMPILER_KEY` in the `.env` file with the value of `x-rapidapi-key`.

## Running Code Execution Service Locally

1. Open Command Line/Terminal and navigate into the `code-execution-service` directory.

2. Run the command: `npm install`. This will install all the necessary dependencies.

3. Run the command `npm start` to start the Code Execution Service in production mode, or use `npm run dev` for development mode, which includes features like automatic server restart when you make code changes.

## Running Code Execution Service with Docker

1. Open the Command Line/Terminal.

2. Run the command `docker compose run code-execution-service` to start up the Code Execution Service and its dependencies.

## After running

1. To view Code Execution Service documentation, go to http://localhost:3004/docs.

2. Using applications like Postman, you can interact with the Code Execution Service on port 3004. If you wish to change this, please update the `.env` file.
10 changes: 10 additions & 0 deletions backend/code-execution-service/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";

export default [
{ files: ["**/*.{js,mjs,cjs,ts}"] },
{ languageOptions: { globals: globals.node } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
];
Loading