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

feat: D5 to D7 #82

Merged
merged 314 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
314 commits
Select commit Hold shift + click to select a range
5943995
Implement authentication blocked pages using middleware
chiaryan Oct 27, 2024
9f804b1
Add history service and frontend code submission
solomonng2001 Oct 27, 2024
b1fa2ec
Add Dockerise history service and update readme and environment example
solomonng2001 Oct 27, 2024
5d0c765
Merge branch 'staging' into solomon/code-execute
solomonng2001 Oct 27, 2024
8928086
Update test.yml and add history-service and firebase for history-service
solomonng2001 Oct 27, 2024
0aa84e3
Update test.yml
solomonng2001 Oct 27, 2024
0693873
Update test.yml
solomonng2001 Oct 27, 2024
e5b7293
Update test.yml
solomonng2001 Oct 27, 2024
56dd8e6
Update test.yml
solomonng2001 Oct 27, 2024
aadd46c
Update test.yml
solomonng2001 Oct 27, 2024
63dd460
Update test.yml
solomonng2001 Oct 28, 2024
f50b89a
Update test.yml
solomonng2001 Oct 28, 2024
81c4e36
Update test.yml
solomonng2001 Oct 28, 2024
6ad4bff
Update test.yml
solomonng2001 Oct 28, 2024
b3bc499
Update test.yml
solomonng2001 Oct 28, 2024
49dbd3c
Update test.yml
solomonng2001 Oct 28, 2024
0bde1d1
Update test.yml
solomonng2001 Oct 28, 2024
ae4f691
Update test.yml
solomonng2001 Oct 28, 2024
3ee517c
Change connected user status to fetch using provider awareness
bensohh Oct 28, 2024
5a51c70
clean up unused imports
chiaryan Oct 28, 2024
81a09c5
Update test.yml
solomonng2001 Oct 28, 2024
cab2b2c
Update test.yml
solomonng2001 Oct 28, 2024
cf36fca
remove client-side redirects
chiaryan Oct 28, 2024
de59434
Merge branch 'staging' into ryan/auth-guard
chiaryan Oct 28, 2024
b6a32db
Implement end collaboration session for both users, fix minor bugs wi…
bensohh Oct 28, 2024
5be7f3c
Minor UI adjustment for modal
bensohh Oct 28, 2024
3502e42
Sync submission across webrtc and update history-service routing
solomonng2001 Oct 28, 2024
ba383ad
Merge pull request #55 from CS3219-AY2425S1/solomon/code-execute
solomonng2001 Oct 28, 2024
5f284c8
Merge branch 'staging' into ben/misc-collab
bensohh Oct 29, 2024
1fc5c9f
Fix commented providerRef error
bensohh Oct 29, 2024
09708e1
Add dockerfile and remove immediate redirect upon closing collab editor
bensohh Oct 29, 2024
b70f478
Update docker-compose.yml to include signalling server
bensohh Oct 29, 2024
5fdbaa8
Replace providerRef with outer ref reference and update test.yml
bensohh Oct 29, 2024
02b9a80
Merge pull request #57 from CS3219-AY2425S1/ben/misc-collab
bensohh Oct 29, 2024
6f8952f
Fix code saved message appearing on end session
solomonng2001 Oct 29, 2024
af68728
merge
chiaryan Oct 30, 2024
7bced3b
Merge branch 'staging' into frontend-changes2
chiaryan Oct 30, 2024
f558075
Remove cancel, join button from Found UI
chiaryan Oct 30, 2024
de92010
feat: update backend routes
tituschewxj Oct 30, 2024
6772a30
delete cookie by setting expiry to 0
chiaryan Oct 30, 2024
1475c05
Merge pull request #56 from CS3219-AY2425S1/ryan/auth-guard
chiaryan Oct 30, 2024
483525f
setup jest
chiaryan Nov 1, 2024
53016e1
update action
chiaryan Nov 1, 2024
365616a
add trigger workflow-dispatch
chiaryan Nov 1, 2024
0d77bfe
asd
chiaryan Nov 1, 2024
ac09202
asd
chiaryan Nov 1, 2024
06b839c
asd
chiaryan Nov 1, 2024
1d0f6fe
asd
chiaryan Nov 1, 2024
fe78391
Merge branch 'staging' into titus/history-service
tituschewxj Nov 1, 2024
54ad800
asd
chiaryan Nov 1, 2024
415161e
asd2
chiaryan Nov 1, 2024
8b054f7
asd
chiaryan Nov 1, 2024
62a72a9
asd
chiaryan Nov 1, 2024
b23580a
Add code execution service
solomonng2001 Nov 1, 2024
aa8be69
Add .env.example
solomonng2001 Nov 1, 2024
a1232e7
Add api test cases and api usage examples
solomonng2001 Nov 1, 2024
0427229
Merge pull request #58 from CS3219-AY2425S1/solomon/fix-code-saved-me…
bensohh Nov 1, 2024
547a2a1
unit testing for question api functions
chiaryan Nov 2, 2024
ed871a9
Merge branch 'staging' into frontend-unit-test
chiaryan Nov 2, 2024
97d6b6c
mock getToken for question.test.ts
chiaryan Nov 2, 2024
c7a72bf
Add accepted or attempted status and dockerise
solomonng2001 Nov 2, 2024
2e99740
Merge branch 'staging' into solomon/code-execute
solomonng2001 Nov 2, 2024
7994e7f
Update test.yml
solomonng2001 Nov 2, 2024
a23a7b4
add unit test for utils/encode
chiaryan Nov 2, 2024
435765a
Add testing workflow part 1..
chiaryan Nov 2, 2024
5a8f8ff
asd
chiaryan Nov 2, 2024
8eb66f4
feat: update frontend for question page
tituschewxj Nov 2, 2024
00497c6
Create VideoPanel component
bensohh Nov 3, 2024
1fc36fa
Integrate videopanel into existing collab page
bensohh Nov 3, 2024
0e5ee2e
Swap chat template to video panel and edit styling
bensohh Nov 3, 2024
a3e02a2
Add some minor comments
bensohh Nov 3, 2024
81b48c9
Update dependencies
bensohh Nov 3, 2024
8b7fa39
Implement end session due to inactivity that triggers after 15s
bensohh Nov 3, 2024
3528c9d
Clear timeout when user end before auto trigger
bensohh Nov 3, 2024
9574769
Change default language to python for code editor
bensohh Nov 3, 2024
31579dc
Comment out isvalidtoken check for docker to run properly
bensohh Nov 3, 2024
4a89600
feat: use codemirror editor
tituschewxj Nov 3, 2024
3b810cf
fix: add token expire check and comment out backend token check request
tituschewxj Nov 3, 2024
5484438
feat; update history service model
tituschewxj Nov 3, 2024
4297c31
feat: fetch from backend for a submission
tituschewxj Nov 3, 2024
d3d5b05
Link frontend code execution to execution service and sync across mat…
solomonng2001 Nov 3, 2024
f32dd72
Update submission and execution logic
solomonng2001 Nov 3, 2024
fdb4c1a
add "unit test" for ReadQuestion
chiaryan Nov 3, 2024
ca7864d
Update README APIs
solomonng2001 Nov 3, 2024
d047aa1
add test for not found
chiaryan Nov 3, 2024
ba541a5
update workflow to add credentials
chiaryan Nov 3, 2024
3d66e85
fix: use historyDocRefId
tituschewxj Nov 3, 2024
89577e4
asd
chiaryan Nov 3, 2024
07131a8
asd2
chiaryan Nov 3, 2024
f1a0e36
asd3
chiaryan Nov 3, 2024
0208df5
asd3
chiaryan Nov 3, 2024
77b8d46
asd4
chiaryan Nov 3, 2024
221d737
remove file
chiaryan Nov 3, 2024
259e462
feat: clickable row entries
tituschewxj Nov 3, 2024
657a29d
feat: modify create so that history is always created
tituschewxj Nov 3, 2024
75a5c35
Merge branch 'frontend-unit-test' into n11-unit-tests
chiaryan Nov 3, 2024
da6001d
fix test.yml
chiaryan Nov 3, 2024
1ae0f5b
feat: order by created at desc
tituschewxj Nov 3, 2024
a3bcb12
fix: swap matched user and user on frontend for specific submission
tituschewxj Nov 3, 2024
4015266
fix: backend history sorting
tituschewxj Nov 3, 2024
36d7b07
feat: implement pagination for histories on question page
tituschewxj Nov 3, 2024
fb89725
fix: heights of submission editor
tituschewxj Nov 3, 2024
a488d26
fix: disable editor
tituschewxj Nov 3, 2024
1d5a38d
fix: other user query
tituschewxj Nov 3, 2024
b1dd96c
feat: add history page
tituschewxj Nov 3, 2024
76ce6c7
fix: pagination
tituschewxj Nov 3, 2024
4c4ada9
feat: remove buttons in match found modal
tituschewxj Nov 3, 2024
d00edf0
feat: remove cancel button in match found modal
tituschewxj Nov 3, 2024
f79896f
Add sandbox for python execution (to be debugged)
solomonng2001 Nov 4, 2024
bcd29d3
merge n11
chiaryan Nov 4, 2024
8dd1799
Add back go test in workflow
chiaryan Nov 4, 2024
0d2a3bc
Merge pull request #65 from CS3219-AY2425S1/n11-unit-tests
chiaryan Nov 4, 2024
e28bf0f
Add end call function, ammend styling and fix bugs
bensohh Nov 4, 2024
e6e1df0
Update lockfile
bensohh Nov 4, 2024
e0192bc
Upgrate lockfile version to v9
bensohh Nov 4, 2024
f0f13ec
Merge branch 'staging' into ben/n1-communication
bensohh Nov 4, 2024
521ac4a
Merge pull request #64 from CS3219-AY2425S1/ben/n1-communication
bensohh Nov 4, 2024
1bffd5c
Merge branch 'staging' into titus/history-service
tituschewxj Nov 4, 2024
1716efa
Dockerise execution of python code
solomonng2001 Nov 4, 2024
48d6745
Merge pull request #60 from CS3219-AY2425S1/titus/history-service
solomonng2001 Nov 4, 2024
3ff07c4
Merge branch 'staging' into frontend-changes2
chiaryan Nov 4, 2024
f77bbfa
Merge pull request #59 from CS3219-AY2425S1/frontend-changes2
bensohh Nov 4, 2024
dd90eaf
Resolve merge conflicts and additional fixes
solomonng2001 Nov 4, 2024
fdd7a13
Update test.yml
solomonng2001 Nov 5, 2024
b5324e2
update test.yml
solomonng2001 Nov 5, 2024
70c52bd
Update optional population of tests
solomonng2001 Nov 5, 2024
66be207
Update test.yml
solomonng2001 Nov 5, 2024
eab5a68
Fix populate bug
solomonng2001 Nov 5, 2024
911ff0f
move decode_test to tests folder
chiaryan Nov 5, 2024
3396c29
Merge pull request #62 from CS3219-AY2425S1/solomon/code-execute
solomonng2001 Nov 5, 2024
4c58547
feat: add test cases to question service
tituschewxj Nov 5, 2024
324463e
branch name
chiaryan Nov 5, 2024
eb946d7
fix: implement check to ensure correct user shows up in matchedUser f…
tituschewxj Nov 6, 2024
b236251
feat: add loading to submission
tituschewxj Nov 6, 2024
afaef67
feat: adjust padding
tituschewxj Nov 6, 2024
a81e280
feat: adjust css
tituschewxj Nov 6, 2024
8a0e046
feat: implement rabbitmq msg queue
tituschewxj Nov 6, 2024
e48bc7e
feat: update docker compose
tituschewxj Nov 6, 2024
64a1bad
fix: update docker-compose
tituschewxj Nov 6, 2024
fbd3a4d
feat: update log msg
tituschewxj Nov 6, 2024
8bd3d10
feat: update readme
tituschewxj Nov 6, 2024
b8e3004
docs: update readme
tituschewxj Nov 6, 2024
bf0c096
docs: update readme
tituschewxj Nov 6, 2024
95a82dc
ci: update docker compose test
tituschewxj Nov 6, 2024
2b2bbd5
docs: update readme
tituschewxj Nov 6, 2024
fac4430
docs: update readme
tituschewxj Nov 6, 2024
d75215c
style(execution-service): :fire: remove commented code
tituschewxj Nov 7, 2024
e5e41ce
fix(frontend): :bug: mounts component before accessing local storage
tituschewxj Nov 7, 2024
1bde600
Fix python sandbox container not found
solomonng2001 Nov 7, 2024
fdce97a
fix(videoPanel): :bug: default for undefined partnerId
tituschewxj Nov 8, 2024
ee60055
Merge pull request #72 from CS3219-AY2425S1/solomon/fix-python-sandbo…
solomonng2001 Nov 9, 2024
b4e499d
Ammend styling issues with question page
bensohh Nov 9, 2024
439b410
Merge pull request #68 from CS3219-AY2425S1/titus/add-test-cases-to-q…
tituschewxj Nov 9, 2024
9656dec
Merge branch 'commit-signalling-.dockerignore' into browser-tests
chiaryan Nov 9, 2024
ab4cc47
try selenium test
chiaryan Nov 10, 2024
8958cb6
asd
chiaryan Nov 10, 2024
240c839
asd
chiaryan Nov 10, 2024
5b79d8b
asd
chiaryan Nov 10, 2024
6796083
asd
chiaryan Nov 10, 2024
9f1efaf
asd
chiaryan Nov 10, 2024
cc46721
asd
chiaryan Nov 10, 2024
f5b521a
asd
chiaryan Nov 10, 2024
f1e7e40
asd
chiaryan Nov 10, 2024
45ebeb4
asd
chiaryan Nov 10, 2024
3570555
asd
chiaryan Nov 10, 2024
cccfa54
install pnpm
chiaryan Nov 10, 2024
2f97a34
asd
chiaryan Nov 10, 2024
c784496
asd
chiaryan Nov 10, 2024
f58f035
asd
chiaryan Nov 10, 2024
862051a
asd
chiaryan Nov 10, 2024
311be82
set up browser tests for Chrome
chiaryan Nov 10, 2024
bf9f160
Merge branch 'browser-compatibility-tests' into browser-tests
chiaryan Nov 10, 2024
f86888b
Increase timeout for browser tests, verbosify jest
chiaryan Nov 10, 2024
7d931ee
Merge pull request #70 from CS3219-AY2425S1/titus/add-message-queue
bensohh Nov 11, 2024
3fd5752
Merge branch 'staging' into titus/fix-local-storage-bug
bensohh Nov 11, 2024
31a6bd1
Merge pull request #71 from CS3219-AY2425S1/titus/fix-local-storage-bug
bensohh Nov 12, 2024
b0b9fb5
Merge branch 'browser-compatibility-tests' into browser-tests
chiaryan Nov 12, 2024
9663688
asd add browsers
chiaryan Nov 12, 2024
3a975ff
asd
chiaryan Nov 12, 2024
e92e186
asd
chiaryan Nov 12, 2024
e400a71
asd
chiaryan Nov 12, 2024
c4ccd11
Merge branch 'staging' into browser-tests
chiaryan Nov 12, 2024
4c405f4
asd
chiaryan Nov 12, 2024
64e2651
asd
chiaryan Nov 12, 2024
3657a9c
asd
chiaryan Nov 12, 2024
7555976
asd
chiaryan Nov 12, 2024
d3eb518
asd
chiaryan Nov 12, 2024
e0c62de
asd
chiaryan Nov 12, 2024
266971d
Squashed commit of the following:
chiaryan Nov 12, 2024
d3ad549
quit driver only if present
chiaryan Nov 12, 2024
8f9d98a
Merge branch 'browser-compatibility-tests' into browser-tests
chiaryan Nov 12, 2024
e3a384e
asd
chiaryan Nov 12, 2024
77f62db
Squashed commit of the following:
chiaryan Nov 12, 2024
1be60da
revert to chrome whoops
chiaryan Nov 12, 2024
4b50754
Squashed commit of the following:
chiaryan Nov 12, 2024
55a424b
Add create test
solomonng2001 Nov 12, 2024
60966ab
Update readme for create test
solomonng2001 Nov 12, 2024
5553b32
docs: :memo: add images
tituschewxj Nov 12, 2024
727a510
docs(matching-service): update comment
tituschewxj Nov 12, 2024
6742eec
docs: :memo: update docs with report details
tituschewxj Nov 12, 2024
bbd8a96
docs: add lines to ci/cd guide
tituschewxj Nov 12, 2024
562e014
docs: add more spaces for ci/cd guide
tituschewxj Nov 12, 2024
9b0c302
fix(frontend): :bug: remove modifiability of username
tituschewxj Nov 12, 2024
d417105
Add back localstorage clear method
bensohh Nov 12, 2024
87d1299
Implement change code functionality for N4 frontend
bensohh Nov 12, 2024
6067412
fix: error handling on frontend
tituschewxj Nov 12, 2024
471b7c7
fix: history service pagination
tituschewxj Nov 12, 2024
75804d5
fix: use response.text instead
tituschewxj Nov 12, 2024
68b64ac
fix: update tests to pass
tituschewxj Nov 12, 2024
4081654
fix: fix test
tituschewxj Nov 12, 2024
540f23f
fix: fix test
tituschewxj Nov 12, 2024
86114a7
fix(tests): put ok in mocked fetch fn
tituschewxj Nov 12, 2024
b3e1d61
Add update test
solomonng2001 Nov 13, 2024
513fc88
Merge pull request #74 from CS3219-AY2425S1/browser-compatibility-tests
tituschewxj Nov 13, 2024
8a31a6f
Add delete and update tests
solomonng2001 Nov 13, 2024
014d5b8
add create_test.go, update_test.go,
chiaryan Nov 13, 2024
1255bb1
feat: update frontend ui for crud testcases
tituschewxj Nov 13, 2024
4a01689
Add session status tooltip
solomonng2001 Nov 13, 2024
c8f437c
Merge branch 'staging' into ben/n4-attempt
bensohh Nov 13, 2024
fbafcdd
Merge pull request #84 from CS3219-AY2425S1/solomon/add-session-tool-tip
bensohh Nov 13, 2024
9f5833b
Merge pull request #78 from CS3219-AY2425S1/titus/remove-update-for-u…
bensohh Nov 13, 2024
4b971e6
Merge branch 'staging' into titus/fix-frontend-error-handling
chiaryan Nov 13, 2024
d16fb22
Store session info in localstorage
solomonng2001 Nov 13, 2024
4243ae9
feat(frontend): add fetch functions for testcases
tituschewxj Nov 13, 2024
368fa90
Merge pull request #80 from CS3219-AY2425S1/titus/fix-frontend-error-…
chiaryan Nov 13, 2024
9ca9d21
Add RabbitMQ URL to environment variables
chiaryan Nov 13, 2024
ed24f5a
feat: add read for hidden tests
tituschewxj Nov 13, 2024
f14b98d
feat(execution): fetch all tests for a qn
tituschewxj Nov 13, 2024
cd73994
Update README.md to include docker-compose version reminder
bensohh Nov 13, 2024
926427b
Update README.md to include troubleshooting comments
bensohh Nov 13, 2024
c7aaf40
Merge pull request #76 from CS3219-AY2425S1/titus/update-readme
tituschewxj Nov 13, 2024
91be737
Merge pull request #87 from CS3219-AY2425S1/add-rabbitmq-url-to-workflow
tituschewxj Nov 13, 2024
bd95eb0
Merge pull request #85 from CS3219-AY2425S1/ben/n4-attempt
bensohh Nov 13, 2024
8f08639
Merge branch 'staging' into solomon/save-submission-status-in-local-s…
bensohh Nov 13, 2024
983d9ae
feat: link with backend
tituschewxj Nov 13, 2024
dc6fc17
feat: add loading icon
tituschewxj Nov 13, 2024
1b8eddb
feat: use active key for tabs
tituschewxj Nov 13, 2024
542f9bb
Add javascript execution
solomonng2001 Nov 13, 2024
e5642a7
Merge pull request #86 from CS3219-AY2425S1/solomon/save-submission-s…
solomonng2001 Nov 13, 2024
e23725b
resolve merge conflicts
solomonng2001 Nov 13, 2024
abf4605
Merge pull request #81 from CS3219-AY2425S1/question-tests-create-upd…
tituschewxj Nov 13, 2024
c236012
Merge pull request #83 from CS3219-AY2425S1/titus/add-ui-for-testcases
chiaryan Nov 13, 2024
bb8cc46
Merge pull request #88 from CS3219-AY2425S1/solomon/add-execute-javas…
tituschewxj Nov 13, 2024
780aa3d
Merge branch 'staging' into solomon/add-create-test
tituschewxj Nov 13, 2024
f01ba09
Merge pull request #75 from CS3219-AY2425S1/solomon/add-create-test
tituschewxj Nov 13, 2024
6e57576
fix(matching-service): :ambulance: fix some issues with matching algo…
tituschewxj Nov 13, 2024
e110913
fix: use matched user instead
tituschewxj Nov 13, 2024
609b491
Merge pull request #89 from CS3219-AY2425S1/titus/fix-matching-algo
tituschewxj Nov 13, 2024
f7fd78d
fix: enable scrolling in code editor
tituschewxj Nov 13, 2024
60f044f
Merge pull request #90 from CS3219-AY2425S1/titus/fix-code-editor-scroll
bensohh Nov 14, 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
166 changes: 159 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,82 @@ on:
branches:
- main
- staging
workflow_dispatch:

jobs:
test:
question-service-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up .env
env:
QUESTION_FIREBASE_CREDENTIAL_PATH: ${{ vars.QUESTION_SERVICE_FIREBASE_CREDENTIAL_PATH }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
EXECUTION_SERVICE_URL: ${{ vars.EXECUTION_SERVICE_URL }}
run: |
cd ./apps/question-service
echo "FIREBASE_CREDENTIAL_PATH=$QUESTION_FIREBASE_CREDENTIAL_PATH" >> .env
echo "JWT_SECRET=$JWT_SECRET" >> .env
echo "EXECUTION_SERVICE_URL=$EXECUTION_SERVICE_URL" >> .env

- name: Set up credentials
env:
QUESTION_FIREBASE_JSON: ${{ secrets.QUESTION_SERVICE_FIREBASE_CREDENTIAL }}
QUESTION_FIREBASE_CREDENTIAL_PATH: ${{ vars.QUESTION_SERVICE_FIREBASE_CREDENTIAL_PATH }}
run: |
cd ./apps/question-service
echo "$QUESTION_FIREBASE_JSON" > "./$QUESTION_FIREBASE_CREDENTIAL_PATH"

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23.x'

- name: Install Go dependencies
run: |
cd ./apps/question-service
go mod tidy

- name: Install firebase tools
run: curl -sL firebase.tools | bash

- name: Run Go tests with Firebase emulator
run: firebase emulators:exec --only firestore 'cd ./apps/question-service; go test -v ./tests'

frontend-unit-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup .env
run: |
cd ./apps/frontend
cp .env.example .env

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '22'

- name: Install pnpm
run: npm i -g pnpm

- name: Install dependencies
run: |
cd ./apps/frontend
pnpm i

- name: Run tests
run: |
cd ./apps/frontend
pnpm unit-test

test-docker-compose:
runs-on: ubuntu-latest

steps:
Expand All @@ -29,22 +102,36 @@ jobs:
QUESTION_SERVICE_URL: ${{ vars.QUESTION_SERVICE_URL }}
USER_SERVICE_URL: ${{ vars.USER_SERVICE_URL }}
MATCHING_SERVICE_URL: ${{ vars.MATCHING_SERVICE_URL }}
HISTORY_SERVICE_URL: ${{ vars.HISTORY_SERVICE_URL }}
SIGNALLING_SERVICE_URL: ${{ vars.SIGNALLING_SERVICE_URL }}
EXECUTION_SERVICE_URL: ${{ vars.EXECUTION_SERVICE_URL }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
FIREBASE_CREDENTIAL_PATH: ${{ vars.QUESTION_SERVICE_FIREBASE_CREDENTIAL_PATH }}
QUESTION_FIREBASE_CREDENTIAL_PATH: ${{ vars.QUESTION_SERVICE_FIREBASE_CREDENTIAL_PATH }}
HISTORY_FIREBASE_CREDENTIAL_PATH: ${{ vars.HISTORY_SERVICE_FIREBASE_CREDENTIAL_PATH }}
EXECUTION_FIREBASE_CREDENTIAL_PATH: ${{ vars.EXECUTION_SERVICE_FIREBASE_CREDENTIAL_PATH }}
DB_CLOUD_URI: ${{ secrets.USER_SERVICE_DB_CLOUD_URI }}
USER_SERVICE_PORT: ${{ vars.USER_SERVICE_PORT }}
MATCHING_SERVICE_PORT: ${{ vars.MATCHING_SERVICE_PORT }}
HISTORY_SERVICE_PORT: ${{ vars.HISTORY_SERVICE_PORT }}
SIGNALLING_SERVICE_PORT: ${{ vars.SIGNALLING_SERVICE_PORT }}
EXECUTION_SERVICE_PORT: ${{ vars.EXECUTION_SERVICE_PORT }}
MATCHING_SERVICE_TIMEOUT: ${{ vars.MATCHING_SERVICE_TIMEOUT }}
REDIS_URL: ${{ vars.REDIS_URL }}
RABBITMQ_URL: ${{ vars.RABBITMQ_URL }}
QUESTION_SERVICE_GRPC_URL: ${{ vars.QUESTION_SERVICE_GPRC_URL }}
run: |
cd ./apps/frontend
echo "NEXT_PUBLIC_QUESTION_SERVICE_URL=$QUESTION_SERVICE_URL" >> .env
echo "NEXT_PUBLIC_USER_SERVICE_URL=$USER_SERVICE_URL" >> .env
echo "NEXT_PUBLIC_MATCHING_SERVICE_URL=$MATCHING_SERVICE_URL" >> .env
echo "NEXT_PUBLIC_HISTORY_SERVICE_URL=$HISTORY_SERVICE_URL" >> .env
echo "NEXT_PUBLIC_SIGNALLING_SERVICE_URL=$SIGNALLING_SERVICE_URL" >> .env
echo "NEXT_PUBLIC_EXECUTION_SERVICE_URL=EXECUTION_SERVICE_URL" >> .env

cd ../question-service
echo "FIREBASE_CREDENTIAL_PATH=$FIREBASE_CREDENTIAL_PATH" >> .env
echo "FIREBASE_CREDENTIAL_PATH=$QUESTION_FIREBASE_CREDENTIAL_PATH" >> .env
echo "JWT_SECRET=$JWT_SECRET" >> .env
echo "EXECUTION_SERVICE_URL=$EXECUTION_SERVICE_URL" >> .env

cd ../user-service
echo "DB_CLOUD_URI=$DB_CLOUD_URI" >> .env
Expand All @@ -56,14 +143,39 @@ jobs:
echo "MATCH_TIMEOUT=$MATCHING_SERVICE_TIMEOUT" >> .env
echo "JWT_SECRET=$JWT_SECRET" >> .env
echo "REDIS_URL=$REDIS_URL" >> .env
echo "QUESTION_SERVICE_GRPC_URL=$QUESTION_SERVICE_GRPC_URL" >> .env

cd ../history-service
echo "FIREBASE_CREDENTIAL_PATH=$HISTORY_FIREBASE_CREDENTIAL_PATH" >> .env
echo "PORT=$HISTORY_SERVICE_PORT" >> .env
echo "RABBMITMQ_URL=$RABBITMQ_URL" >> .env

cd ../execution-service
echo "FIREBASE_CREDENTIAL_PATH=$EXECUTION_FIREBASE_CREDENTIAL_PATH" >> .env
echo "PORT=$EXECUTION_SERVICE_PORT" >> .env
echo "HISTORY_SERVICE_URL=$HISTORY_SERVICE_URL" >> .env
echo "RABBMITMQ_URL=$RABBITMQ_URL" >> .env

cd ../signalling-service
echo "PORT=$SIGNALLING_SERVICE_PORT" >> .env

- name: Create Database Credential Files
env:
FIREBASE_JSON: ${{ secrets.QUESTION_SERVICE_FIREBASE_CREDENTIAL }}
FIREBASE_CREDENTIAL_PATH: ${{ vars.QUESTION_SERVICE_FIREBASE_CREDENTIAL_PATH }}
QUESTION_FIREBASE_JSON: ${{ secrets.QUESTION_SERVICE_FIREBASE_CREDENTIAL }}
QUESTION_FIREBASE_CREDENTIAL_PATH: ${{ vars.QUESTION_SERVICE_FIREBASE_CREDENTIAL_PATH }}
HISTORY_FIREBASE_JSON: ${{ secrets.HISTORY_SERVICE_FIREBASE_CREDENTIAL }}
HISTORY_FIREBASE_CREDENTIAL_PATH: ${{ vars.HISTORY_SERVICE_FIREBASE_CREDENTIAL_PATH }}
EXECUTION_FIREBASE_JSON: ${{ secrets.EXECUTION_SERVICE_FIREBASE_CREDENTIAL }}
EXECUTION_FIREBASE_CREDENTIAL_PATH: ${{ vars.EXECUTION_SERVICE_FIREBASE_CREDENTIAL_PATH }}
run: |
cd ./apps/question-service
echo "$FIREBASE_JSON" > "./$FIREBASE_CREDENTIAL_PATH"
echo "$QUESTION_FIREBASE_JSON" > "./$QUESTION_FIREBASE_CREDENTIAL_PATH"

cd ../history-service
echo "$HISTORY_FIREBASE_JSON" > "./$HISTORY_FIREBASE_CREDENTIAL_PATH"

cd ../execution-service
echo "$EXECUTION_FIREBASE_JSON" > "./$EXECUTION_FIREBASE_CREDENTIAL_PATH"

- name: Build and Run Services
run: |
Expand All @@ -85,19 +197,59 @@ jobs:
USER_SERVICE_URL: ${{ vars.USER_SERVICE_URL }}
QUESTION_SERVICE_URL: ${{ vars.QUESTION_SERVICE_URL }}
MATCHING_SERVICE_URL: ${{ vars.MATCHING_SERVICE_URL }}
HISTORY_SERVICE_URL: ${{ vars.HISTORY_SERVICE_URL }}
SIGNALLING_SERVICE_URL: ${{ vars.SIGNALLING_SERVICE_URL }}
EXECUTION_SERVICE_URL: ${{ vars.EXECUTION_SERVICE_URL }}
run: |
docker ps -a
echo "Testing Question Service..."
curl -sSL -o /dev/null $QUESTION_SERVICE_URL && echo "Question Service is up"
echo "Testing User Service..."
curl -fsSL -o /dev/null $USER_SERVICE_URL && echo "User Service is up"
echo "Testing Frontend..."
curl -fsSL -o /dev/null $FRONTEND_URL && echo "Frontend is up"
echo "Testing History Service..."
curl -fsSL -o /dev/null $HISTORY_SERVICE_URL && echo "History Service is up"
echo "Testing Execution Service..."
curl -fsSL -o /dev/null $EXECUTION_SERVICE_URL && echo "Execution Service is up"
echo "Testing Matching Service..."
if ! (echo "Hello" | websocat $MATCHING_SERVICE_URL); then
echo "WebSocket for Matching Service is not live"
else
echo "WebSocket for Matching Service is live"
fi
# Add in test for matching service in the future

echo "Testing Signalling Service..."
if ! (echo "Hello" | websocat $SIGNALLING_SERVICE_URL); then
echo "WebSocket for Signalling Service is not live"
else
echo "WebSocket for Signalling Service is live"
fi
# We can add more tests here

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.1.4

- name: Install dependencies
run: |
cd ./apps/frontend
pnpm i

- name: Install Chrome WebDriver
uses: nanasess/setup-chromedriver@v2
with:
chromedriver-version: '130.0.6723.116'
- name: Install Edge
uses: browser-actions/setup-edge@v1
with:
edge-version: stable

- name: Install Geckodriver
uses: browser-actions/setup-geckodriver@latest

- name: Run Browser Test
run: |
cd ./apps/frontend
pnpm browser-test
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,38 @@
- 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.

---

## Architecture Diagram

![Overall Architecture Diagram](./docs/architecture_diagram.png)

The overall architecture of PeerPrep follows a microservices architecture. The client acts as an orchestrator for the interaction between the different services.

## Screenshots

![Home Page](./docs/home_page.png)

![Collaboration Page](./docs/collab_page_1.png)

![Collaboration Page](./docs/collab_page_2.png)

![Question Page](./docs/question_page.png)

![Question Page](./docs/indiv_question_page.png)

![History Page](./docs/submission_history_page.png)

## More details

- [Frontend](./apps/frontend/README.md)
- [User Service](./apps/user-service/README.md)
- [Question Service](./apps/question-service/README.md)
- [Matching Service](./apps/matching-service/README.md)
- [Signalling Service](./apps/signalling-service/README.md)
- [History Service](./apps/history-service/README.md)
- [Execution Service](./apps/execution-service/README.md)
- [CI/CD Guide](./docs/cicid.md)
- [Docker Compose Guide](./apps/README.md)
- [Set Up Guide](./docs/setup.md)
37 changes: 31 additions & 6 deletions apps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This project uses Docker Compose to manage multiple services such as a frontend, backend, and a database. The configuration is defined in the `docker-compose.yml` file, and environment variables can be stored in environment files for different environments (e.g., development, production).

More details on how to set up Docker Compose can be found [here](../docs/setup.md)

## Prerequisites

Before you begin, ensure you have the following installed on your machine:
Expand Down Expand Up @@ -30,11 +32,25 @@ In the `./apps` directory:
├── user-service
│ ├── Dockerfile # Dockerfile for user-service
│ └── ... (other user-service files)

├── execution-service
│ ├── Dockerfile # Dockerfile for execution-service
│ └── ... (other execution-service files)
├── signalling-service
│ ├── Dockerfile # Dockerfile for signalling-service
│ └── ... (other signalling-service files)
├── history-service
│ ├── Dockerfile # Dockerfile for history-service
│ └── ... (other history-service files)
```

## Docker Compose Setup

Ensure that you are currently using **Docker Compose v2** in your local Docker Desktop.
- Launch your local Docker Desktop application
- Click on settings button at the top right hand corner (beside the name)
- Under the General tab, scroll down until you see a checkbox that says Use Docker Compose V2, ensure that the box is checked then apply and restart (refer to the image below)
![Docker Compose V2](https://github.com/user-attachments/assets/3b8d47c2-c488-4fc1-804d-418ffebbdd9c)

By using multiple Dockerfiles in Docker Compose, we can manage complex multi-container applications where each service has its own environment and build process.

1. Build and Start the Application
Expand All @@ -54,11 +70,15 @@ This will:

Once running, you can access:

- The **frontend** at http://localhost:3000
- The **user service** at http://localhost:3001
- The **question service** at http://localhost:8080
- The **matching service** at http://localhost:8081
- The **redis service** at http://localhost:6379
- The [**frontend**](./frontend/README.md) at http://localhost:3000
- The [**user-service**](./user-service/README.md) at http://localhost:3001
- The [**question-service**](./question-service/README.md) at http://localhost:8080 (REST) and http://localhost:50051 (gRPC)
- The [**matching-service**](./matching-service/README.md) at http://localhost:8081
- The [**history-service**](./history-service/README.md) at http://localhost:8082
- The [**execution-service**](./execution-service/README.md) at http://localhost:8083
- The [**signalling-service**](./signalling-service/README.md) at http://localhost:4444
- The **redis** at http://localhost:6379
- The **rabbitmq** at http://localhost:5672

3. Stopping Services

Expand All @@ -76,6 +96,11 @@ This command will stop and remove the containers, networks, and volumes created

- **Port Conflicts**: If you encounter port conflicts, ensure the host ports specified in docker-compose.yml (e.g., 3000:3000) are not in use by other applications.
- **Environment Variables Not Loaded**: Ensure the `.env` files are in the correct directories as found in the `docker-compose.yml` file.
- **Command execution failed**: When you try running test cases or submitting the code in the collaborative environment, if you encounter the following error message:
```bash
Command execution failed: Unable to find image 'apps-python-sandbox:latest' locally docker: Error response from daemon: pull access denied for apps-python-sandbox, repository does not exist or may require 'docker login': denied: requested access to the resource is denied. See 'docker run --help'. : exit status 125
```
Ensure that you have **Docker Compose V2** enabled for your Docker Desktop application. Please refer to the Docker Compose setup guide above to enable it locally.

### Known Issues

Expand Down
Loading
Loading