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 1,076 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1076 commits
Select commit Hold shift + click to select a range
073cb22
feat: convert to MatchDto
yunruu Nov 3, 2024
99e51de
feat: add repo methods to retrieve paginated matches
yunruu Nov 3, 2024
baa1e93
feat: add controller to handle paginated matches
yunruu Nov 3, 2024
509d91a
feat: route get api call to request handler
yunruu Nov 3, 2024
69fbce5
Clean up code
Nov 3, 2024
09f9087
feat: synchronise code execution and show test result tab on execution
shishirbychapur Nov 3, 2024
ce210c3
Merge pull request #185 from CS3219-AY2425S1/175-be-get-past-sessions
yunruu Nov 3, 2024
e9799ae
Merge branch 'main' into lynn-chat
shishirbychapur Nov 3, 2024
8c807f4
Merge pull request #180 from CS3219-AY2425S1/lynn-chat
lynnlow175 Nov 3, 2024
7788719
Merge branch 'main' of https://github.com/CS3219-AY2425S1/cs3219-ay24…
shishirbychapur Nov 3, 2024
0202981
add: docker compose local
Daviancold Nov 3, 2024
054dd35
feat: add collab svc to docker compose for VPS
Daviancold Nov 3, 2024
b97a54d
feat: add base jest test for matching service
Daviancold Nov 3, 2024
e6a7669
refactor: export all types in index
yunruu Nov 3, 2024
cd80b5b
refactor: uncomment mock sessions data due to incompatible type with …
yunruu Nov 3, 2024
6337531
feat: add option to declare table header label
yunruu Nov 3, 2024
0079e7d
feat: change input label name
yunruu Nov 3, 2024
0d644d5
feat: add API action enum
yunruu Nov 3, 2024
eeb27a6
feat: add session types and class manager
yunruu Nov 3, 2024
85ff71d
feat: integrate api with sessions datatable
yunruu Nov 3, 2024
b38a868
fix: matching service test
Daviancold Nov 3, 2024
58fc6eb
Merge pull request #186 from CS3219-AY2425S1/184-nginx-for-collab-ser…
Daviancold Nov 3, 2024
5eaf196
refactor: remove config env for judge zero
Daviancold Nov 3, 2024
59ec090
Merge pull request #188 from CS3219-AY2425S1/184-nginx-for-collab-ser…
Daviancold Nov 3, 2024
f26efb8
feat: integrate pagination handler
yunruu Nov 4, 2024
e630e00
Merge branch 'main' of https://github.com/CS3219-AY2425S1/cs3219-ay24…
shishirbychapur Nov 4, 2024
14bd8f1
feat: allow sorting of sessions
yunruu Nov 4, 2024
7dca0c7
feat: show appropriate results
shishirbychapur Nov 4, 2024
ee33d8a
fix: solve build error
shishirbychapur Nov 4, 2024
a3bccf7
fix: revert docker change
shishirbychapur Nov 4, 2024
ec2191c
fix: revert docker change
shishirbychapur Nov 4, 2024
6b2a80c
fix: add reflect-metadata header
shishirbychapur Nov 4, 2024
eb96404
fix: attempt fix build
shishirbychapur Nov 4, 2024
378d476
fix
shishirbychapur Nov 4, 2024
14a92bd
fix: resolve ci
shishirbychapur Nov 4, 2024
ce826d3
fix: remove log
shishirbychapur Nov 4, 2024
71f1e8d
fix: resolve ci
shishirbychapur Nov 4, 2024
cda4f2e
feat: change datetime label
yunruu Nov 5, 2024
97ea331
feat: add spacing between error key value
yunruu Nov 5, 2024
2cc079f
feat: add api to check for ongoing match
yunruu Nov 5, 2024
7c7a1d4
feat: add controller to return ongoing match id if any
yunruu Nov 5, 2024
a554c25
feat: add api route to get ongoing match
yunruu Nov 5, 2024
2617ba8
feat: integrate api to display resume session dialog if there is ongo…
yunruu Nov 5, 2024
938217e
feat: include error messages
shishirbychapur Nov 5, 2024
d5ad1a0
feat: show no data feedback if datatable is empty
yunruu Nov 5, 2024
882bdd3
fix: only render matches user is in
yunruu Nov 5, 2024
379491c
fix: update paginated sessions api query
yunruu Nov 5, 2024
4322591
Merge pull request #190 from CS3219-AY2425S1/integrate-judge0-fe
shishirbychapur Nov 5, 2024
17eb5d9
Add indent
Nov 5, 2024
62ac0a4
feat: include datetime sorting
yunruu Nov 5, 2024
ea6084c
fix: error message and prevent undefined access
yunruu Nov 5, 2024
a4f8983
Merge pull request #192 from CS3219-AY2425S1/lynn-fix-indent
shishirbychapur Nov 5, 2024
b0f2afd
Handle no question
Nov 5, 2024
2275f59
fix: include completed matches in matches pagination
yunruu Nov 5, 2024
7b51801
Merge branch 'main' into 140-fe-sessions-table
yunruu Nov 5, 2024
6c91cf0
fix: remove unexpected div tag
yunruu Nov 5, 2024
7aa3079
Merge pull request #187 from CS3219-AY2425S1/140-fe-sessions-table
yunruu Nov 5, 2024
59e3a07
refactor: export all types in index
yunruu Nov 3, 2024
1f06b4c
refactor: uncomment mock sessions data due to incompatible type with …
yunruu Nov 3, 2024
6e512be
feat: add option to declare table header label
yunruu Nov 3, 2024
e49fe01
feat: change input label name
yunruu Nov 3, 2024
e92f289
feat: add API action enum
yunruu Nov 3, 2024
b43d1e4
feat: add session types and class manager
yunruu Nov 3, 2024
a35455c
feat: integrate api with sessions datatable
yunruu Nov 3, 2024
c519ae2
feat: integrate pagination handler
yunruu Nov 4, 2024
73ae250
feat: allow sorting of sessions
yunruu Nov 4, 2024
487cc21
feat: change datetime label
yunruu Nov 5, 2024
9661f2b
feat: add spacing between error key value
yunruu Nov 5, 2024
507a9a9
feat: show no data feedback if datatable is empty
yunruu Nov 5, 2024
116ba0b
fix: only render matches user is in
yunruu Nov 5, 2024
9f2065a
fix: update paginated sessions api query
yunruu Nov 5, 2024
49267a6
feat: include datetime sorting
yunruu Nov 5, 2024
c36980b
fix: error message and prevent undefined access
yunruu Nov 5, 2024
1ef8fb6
fix: include completed matches in matches pagination
yunruu Nov 5, 2024
550bf43
feat: synchronise code execution and show test result tab on execution
shishirbychapur Nov 3, 2024
11b5883
feat: show appropriate results
shishirbychapur Nov 4, 2024
10545ed
fix: solve build error
shishirbychapur Nov 4, 2024
5985f94
fix: revert docker change
shishirbychapur Nov 4, 2024
2654926
fix: revert docker change
shishirbychapur Nov 4, 2024
fe517df
fix: add reflect-metadata header
shishirbychapur Nov 4, 2024
31739a7
fix: attempt fix build
shishirbychapur Nov 4, 2024
f6c42c1
fix
shishirbychapur Nov 4, 2024
ab1c552
fix: resolve ci
shishirbychapur Nov 4, 2024
6fa4ce0
fix: remove log
shishirbychapur Nov 4, 2024
440a193
fix: resolve ci
shishirbychapur Nov 4, 2024
add40b1
feat: include error messages
shishirbychapur Nov 5, 2024
a225281
Add indent
Nov 5, 2024
d84b29d
fix: remove unexpected div tag
yunruu Nov 5, 2024
5a752f4
fix: add missing import
Daviancold Nov 5, 2024
c058402
ci: add required package for FE CI/CD
Daviancold Nov 5, 2024
598de73
fix: missing submission type import
Daviancold Nov 5, 2024
6408d0a
ci: update lock file
Daviancold Nov 5, 2024
2f71565
feat: return full ongoing match data if any
yunruu Nov 6, 2024
679f253
refactor: remove unnecessary data field
yunruu Nov 6, 2024
0f56efa
feat: display topic and complexity of ongoing match if any
yunruu Nov 6, 2024
d87dee1
Merge branch 'main' into 136-fe-rejoin-dialog
yunruu Nov 6, 2024
9108424
fix: remove duplicate identifier
yunruu Nov 6, 2024
685680e
[#196] fix: change websocket servers to be env variables
glemenneo Nov 6, 2024
39f6a5a
[#196] fix: add proxy pass for websocket ports
glemenneo Nov 6, 2024
2e563ed
[#196] fix: change websocket url nullish coalesing to properly append…
glemenneo Nov 6, 2024
cfcf041
[#196] fix: remove hardcoded url and add properly suffixed ws url to …
glemenneo Nov 6, 2024
7ec4d67
[#196] refactor: remove redundant console log
glemenneo Nov 6, 2024
163f6a1
ci: add config to debug deployment
Daviancold Nov 6, 2024
f856b05
fix: parse id field from dto to model
yunruu Nov 6, 2024
14a9074
feat: add props for custom dialog
yunruu Nov 6, 2024
bfe06da
feat: add dialog to indicate if ongoing session is terminated by coll…
yunruu Nov 6, 2024
75c8448
feat: add category col in sessions datatable
yunruu Nov 6, 2024
98766e2
feat: add custom action prop
yunruu Nov 6, 2024
7f9ea24
add: netlify.toml
Daviancold Nov 4, 2024
4426d85
refactor: move toml file
Daviancold Nov 5, 2024
9dcda2a
ci: testing toml changes
Daviancold Nov 5, 2024
a28e573
ci: toml update
Daviancold Nov 5, 2024
3d530c4
ci: rename toml temporarily to prevent use from deployment
Daviancold Nov 5, 2024
a719214
feat: display error feedback if collaborator left session while user …
yunruu Nov 6, 2024
4219f22
fix: revert code tab change
yunruu Nov 6, 2024
29b9456
Merge pull request #197 from CS3219-AY2425S1/136-fe-rejoin-dialog
Daviancold Nov 6, 2024
6525a7c
feat: include id in match api
yunruu Nov 6, 2024
3b2d1c8
Merge pull request #198 from CS3219-AY2425S1/196-be-integrate-collabo…
glemenneo Nov 6, 2024
e0e52fa
feat: add custom formatter for custom actions prop
yunruu Nov 6, 2024
1d70507
Merge pull request #193 from CS3219-AY2425S1/lynn-fix-match
shishirbychapur Nov 6, 2024
6627fa0
Merge pull request #195 from CS3219-AY2425S1/194-fix-fe-missing-import
Daviancold Nov 6, 2024
ce5f1fe
fix: display toast instead of routing user to home if error retrievin…
yunruu Nov 6, 2024
e6500e8
refactor: return match res data and show error toast if any
yunruu Nov 6, 2024
839dc3b
feat: refactor handling logic for match and session creation in front…
Daviancold Nov 6, 2024
89792db
fix: unprotected post route
Daviancold Nov 6, 2024
bfbbed0
fix: typo in mq service
Daviancold Nov 6, 2024
ccb124c
refactor: log errors in match and session creation
yunruu Nov 6, 2024
642379d
feat: refactor handling logic for match and session creation in front…
Daviancold Nov 6, 2024
5747170
fix: remove duplicate dependency
Daviancold Nov 6, 2024
1e3e1f9
refactor: change Partial to use new interface in CollabDto
Daviancold Nov 6, 2024
977e219
Merge pull request #201 from CS3219-AY2425S1/199-bug-fix-for-frontend…
Daviancold Nov 6, 2024
177fd4d
[#196] fix: change websocket servers to be env variables
glemenneo Nov 6, 2024
636f02b
[#196] fix: add proxy pass for websocket ports
glemenneo Nov 6, 2024
93cc752
[#196] fix: change websocket url nullish coalesing to properly append…
glemenneo Nov 6, 2024
d471ab8
[#196] fix: remove hardcoded url and add properly suffixed ws url to …
glemenneo Nov 6, 2024
ce413ff
[#196] refactor: remove redundant console log
glemenneo Nov 6, 2024
29f8387
Handle no question
Nov 5, 2024
2c7cab6
fix: add missing import
Daviancold Nov 5, 2024
b1b62c7
ci: add required package for FE CI/CD
Daviancold Nov 5, 2024
c9ee5df
fix: missing submission type import
Daviancold Nov 5, 2024
49ed154
ci: update lock file
Daviancold Nov 5, 2024
20ebdf5
ci: add config to debug deployment
Daviancold Nov 6, 2024
d152b3f
add: netlify.toml
Daviancold Nov 4, 2024
63695e0
refactor: move toml file
Daviancold Nov 5, 2024
316f60f
ci: testing toml changes
Daviancold Nov 5, 2024
c5a5144
ci: toml update
Daviancold Nov 5, 2024
f983c5e
ci: rename toml temporarily to prevent use from deployment
Daviancold Nov 5, 2024
ab000b2
fix: display toast instead of routing user to home if error retrievin…
yunruu Nov 6, 2024
764055a
refactor: return match res data and show error toast if any
yunruu Nov 6, 2024
ac1bbd6
feat: refactor handling logic for match and session creation in front…
Daviancold Nov 6, 2024
17b3437
fix: unprotected post route
Daviancold Nov 6, 2024
2b4bcfb
fix: typo in mq service
Daviancold Nov 6, 2024
39535f3
refactor: log errors in match and session creation
yunruu Nov 6, 2024
b1a7082
feat: refactor handling logic for match and session creation in front…
Daviancold Nov 6, 2024
72ece06
fix: remove duplicate dependency
Daviancold Nov 6, 2024
806ba58
refactor: change Partial to use new interface in CollabDto
Daviancold Nov 6, 2024
e31b0b7
feat: display error when match data not found
yunruu Nov 7, 2024
4efc69f
fix: allow fetching of completed match detail
yunruu Nov 7, 2024
16f8240
feat: sort default paginated matches by descending datetime
yunruu Nov 7, 2024
9e77d0c
feat: add view only option and disable all editables if view only
yunruu Nov 7, 2024
9ea0a97
Merge branch 'main' into 138-fe-view-previous-session
yunruu Nov 7, 2024
c878b8f
feat: view previous sessions in dashboard
yunruu Nov 7, 2024
41e3aee
fix: add collab service url in local compose matching service
yunruu Nov 8, 2024
ffe9d39
chore: remove console log
yunruu Nov 8, 2024
8b71966
feat: hide collab avatar and run test button in view only mode
yunruu Nov 8, 2024
617b26a
fix: prevent chat box overflow
yunruu Nov 8, 2024
4273ba0
fix: prevent premature closure of socket
yunruu Nov 8, 2024
39a8f57
feat: increase rate limit to 20r/s
yunruu Nov 8, 2024
c7c6ea5
fix: add missing collaboration service url to docker compose for depl…
Daviancold Nov 8, 2024
f55ce7f
fix: add conditional ws path for chat
Daviancold Nov 8, 2024
29d5f8b
feat: show 5 items in datatable on default
yunruu Nov 8, 2024
78b5d12
fix: convert question complexity for datatable display
yunruu Nov 8, 2024
04b3708
Merge pull request #203 from CS3219-AY2425S1/138-fe-view-previous-ses…
yunruu Nov 8, 2024
0fe0fef
fix: prevent undefined access
yunruu Nov 8, 2024
1d97962
feat: route user back to login page on successful registration
yunruu Nov 8, 2024
d9724fc
fix: login and register page height inconsistency
yunruu Nov 8, 2024
d413b4f
refactor: name variable clearly
yunruu Nov 8, 2024
1f473dc
fix: wrap signout icon in button elem
yunruu Nov 8, 2024
783a025
Change termination logic
Nov 8, 2024
55352d5
feat: store execution result in DB
shishirbychapur Nov 8, 2024
d181e9d
feat: setup collab api endpoint
shishirbychapur Nov 8, 2024
df9b497
fix: show code in read only editor
shishirbychapur Nov 8, 2024
97d2738
fix: solve chat issue
shishirbychapur Nov 8, 2024
7af5d05
feat: show execution result in read only view
shishirbychapur Nov 8, 2024
c68ff0d
fix: sign out from next-auth upon deleting account
Daviancold Nov 8, 2024
00eefa3
fix: solve bug in disconnection
shishirbychapur Nov 8, 2024
2b8ac9d
fix: remove unused packages from FE
Daviancold Nov 8, 2024
4dfd76c
refactor: using existing dialog
shishirbychapur Nov 8, 2024
ca8d595
fix: loading wheel for login button
Daviancold Nov 8, 2024
1ac940d
Fix test result bug
Nov 8, 2024
a50733c
chore: small gitignore change to ignore shell script
Daviancold Nov 8, 2024
96af9d7
ci: test api route change
Daviancold Nov 8, 2024
1a21c5e
ci: testing long polling for deployment
Daviancold Nov 8, 2024
60d3a0f
refactor: chat logic to test bug fix
Daviancold Nov 8, 2024
48858db
Fix bugs
Nov 8, 2024
04e6f1f
Merge pull request #209 from CS3219-AY2425S1/store-execution-result
lynnlow175 Nov 8, 2024
e13283e
Merge branch 'main' into lynn-end-sess
shishirbychapur Nov 8, 2024
f95a79b
ci: print debug messages for deployment test
Daviancold Nov 8, 2024
5716408
Fix sessions bug
Nov 8, 2024
45fe4b6
feat: store execution result in DB
shishirbychapur Nov 8, 2024
25d7639
feat: setup collab api endpoint
shishirbychapur Nov 8, 2024
349fa44
fix: show code in read only editor
shishirbychapur Nov 8, 2024
3a62e73
Merge pull request #208 from CS3219-AY2425S1/lynn-end-sess
shishirbychapur Nov 8, 2024
d1cde4e
fix: solve chat issue
shishirbychapur Nov 8, 2024
faba325
feat: show execution result in read only view
shishirbychapur Nov 8, 2024
d7315f1
Fix test result bug
Nov 8, 2024
a7386d9
Fix bugs
Nov 8, 2024
14d1de6
ci: fix chat merge conflict
Daviancold Nov 8, 2024
bc1e703
fix: index merge conflict
Daviancold Nov 8, 2024
ee4c8b2
ci: testing different path for socketio
Daviancold Nov 8, 2024
335efca
Merge pull request #207 from CS3219-AY2425S1/205-fe-bug-fix
Daviancold Nov 9, 2024
f09194d
feat: add key down listener to login/sign up on enter key
yunruu Nov 9, 2024
2836d2d
[#206] feat: add api suffix for all public api calls
glemenneo Nov 9, 2024
a651dd4
feat: change button focus color to lighter gray for visual integration
yunruu Nov 9, 2024
5f876d2
feat: even out spacing between columns in questions datatable
yunruu Nov 9, 2024
397e27b
feat: show session end toast
yunruu Nov 9, 2024
600de35
[#206] feat: add rewrite rule to strip /api prefixes
glemenneo Nov 9, 2024
8929f9b
Merge pull request #213 from CS3219-AY2425S1/206-be-fix-nginx-routing…
Daviancold Nov 9, 2024
f3915a0
feat: show custom action icon only if exists
yunruu Nov 10, 2024
859a792
feat: show success toast on delete
yunruu Nov 10, 2024
d77ed96
feat: show specific dialog header
yunruu Nov 10, 2024
d020f6c
feat: put dialog above navbar
yunruu Nov 10, 2024
a31b8d5
feat: encode the match id in url for security
yunruu Nov 10, 2024
9be2ba5
fix: allow user to instantly queue after refreshing while in queue
shishirbychapur Nov 12, 2024
29a720b
feat: improve loading
shishirbychapur Nov 12, 2024
b56494b
fix: resolve bug in landing page
shishirbychapur Nov 12, 2024
df06106
fix: undefined handling in string decoder
yunruu Nov 13, 2024
4d0d75b
feat: standardize primary buttons
yunruu Nov 13, 2024
fb8c4c4
[#206] feat: add api suffix for all public api calls
glemenneo Nov 9, 2024
2612094
[#206] feat: add rewrite rule to strip /api prefixes
glemenneo Nov 9, 2024
6d5eca7
chore: remove unnecessary optional op
yunruu Nov 13, 2024
0dc80cd
Merge pull request #214 from CS3219-AY2425S1/212-fe-visual-and-user-e…
yunruu Nov 13, 2024
f90a59e
Merge branch 'main' into fix-refresh-matchmaking
shishirbychapur Nov 13, 2024
0e40b12
Merge pull request #216 from CS3219-AY2425S1/fix-refresh-matchmaking
shishirbychapur Nov 13, 2024
ed5c27b
[#141] feat: add question counts dto
glemenneo Nov 13, 2024
9cf6d54
[#141] fix: add missing question counts dto export
glemenneo Nov 13, 2024
8839067
[#141] feat: add get all question counts by complexity api
glemenneo Nov 13, 2024
b62fc8d
[#141] feat: add get all completed question counts by complexity api
glemenneo Nov 13, 2024
b635620
[#141] feat: modify dashboard tracker to use data from api calls
glemenneo Nov 13, 2024
4f0653a
[#141] fix: move copy of complexity and category into question types …
glemenneo Nov 13, 2024
db844a5
[#141] feat: capitalise only first level of complexity
glemenneo Nov 13, 2024
714b694
Merge pull request #218 from CS3219-AY2425S1/141-Integrate-tracker-fo…
glemenneo Nov 13, 2024
8169ccc
fix: differentiate session ending from disconnecting
yunruu Nov 13, 2024
62f2240
fix: standardize primary button color
yunruu Nov 13, 2024
e665274
fix: display clearer error message
yunruu Nov 13, 2024
528d41b
fix: capitalize all languages
yunruu Nov 13, 2024
e7a9a00
fix: sessions page count
yunruu Nov 13, 2024
967b474
fix: reload session after failed resume
yunruu Nov 13, 2024
0e9afb4
fix: disable updating of email
yunruu Nov 13, 2024
d49d36d
Merge pull request #220 from CS3219-AY2425S1/219-final-bug-fix
yunruu Nov 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**/node_modules
**/.next
**/dist
**/coverage
.git
.gitignore
.vscode
.github
.husky
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ['@repo/eslint-config/eslint-base.js'],
}
75 changes: 75 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CD

on:
push:
branches: ['main']

jobs:
push:
name: Build and Push
timeout-minutes: 15
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: glemenneo/cs3219-ay2425s1-project-g31-user-service
dockerfile: ./backend/user-service/Dockerfile
- image: glemenneo/cs3219-ay2425s1-project-g31-question-service
dockerfile: ./backend/question-service/Dockerfile
- image: glemenneo/cs3219-ay2425s1-project-g31-matching-service
dockerfile: ./backend/matching-service/Dockerfile
- image: glemenneo/cs3219-ay2425s1-project-g31-collaboration-service
dockerfile: ./backend/collaboration-service/Dockerfile
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ matrix.image }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
deploy:
name: Deploy to VPS
needs: push
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Deploy
uses: appleboy/ssh-action@v1.1.0
env:
VPS_HOST: ${{ secrets.VPS_HOST }}
VPS_SSL_KEY_FILE: ${{ secrets.VPS_SSL_KEY_FILE }}
VPS_SSL_CERT_FILE: ${{ secrets.VPS_SSL_CERT_FILE }}
ACCESS_TOKEN_PUBLIC_KEY: ${{ secrets.ACCESS_TOKEN_PUBLIC_KEY }}
ACCESS_TOKEN_PRIVATE_KEY: ${{ secrets.ACCESS_TOKEN_PRIVATE_KEY }}
NODEMAILER_EMAIL: ${{ secrets.NODEMAILER_EMAIL }}
NODEMAILER_PASSWORD: ${{ secrets.NODEMAILER_PASSWORD }}
RMQ_USER: ${{ secrets.RMQ_USER }}
RMQ_PASSWORD: ${{ secrets.RMQ_PASSWORD }}
MONGO_USER: ${{ secrets.MONGO_USER }}
MONGO_PASSWORD: ${{ secrets.MONGO_PASSWORD }}
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
envs: VPS_HOST,VPS_SSL_KEY_FILE,VPS_SSL_CERT_FILE,ACCESS_TOKEN_PUBLIC_KEY,ACCESS_TOKEN_PRIVATE_KEY,NODEMAILER_EMAIL,NODEMAILER_PASSWORD,RMQ_USER,RMQ_PASSWORD,MONGO_USER,MONGO_PASSWORD
script: |
cd cs3219-ay2425s1-project-g31
git switch main
git pull
docker compose down
docker compose pull
docker compose up -d
95 changes: 95 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: CI

on:
pull_request:
types: [opened, synchronize]

jobs:
build:
name: Build
timeout-minutes: 15
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: glemenneo/cs3219-ay2425s1-project-g31-user-service
dockerfile: ./backend/user-service/Dockerfile
- image: glemenneo/cs3219-ay2425s1-project-g31-question-service
dockerfile: ./backend/question-service/Dockerfile
- image: glemenneo/cs3219-ay2425s1-project-g31-matching-service
dockerfile: ./backend/matching-service/Dockerfile
- image: glemenneo/cs3219-ay2425s1-project-g31-collaboration-service
dockerfile: ./backend/collaboration-service/Dockerfile
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.dockerfile }}
push: false # Do not push to Docker Hub, only cache the image for later use in CD
tags: ${{ matrix.image }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
test:
name: Test
timeout-minutes: 15
runs-on: ubuntu-latest
# To use Remote Caching, uncomment the next lines and follow the steps below.
# env:
# TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
# TURBO_TEAM: ${{ vars.TURBO_TEAM }}
# TURBO_REMOTE_ONLY: true

steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: Cache turbo artifacts
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Build
run: npm run build # Required to build the internal

- name: Test
run: npm run test
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.git
.vscode

/node_modules
**/node_modules

**/.env
**/.env.*

**/dist
**/coverage

**/*.log

**/.turbo

**/*.tsbuildinfo

/nginx/ssl

# Local Netlify folder
.netlify

# Local shell scripts
**/*.sh
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run lint-staged
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore artifacts:
**/coverage/*
**/dist/*
**/public/*
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": false,
"singleQuote": true,
"printWidth": 120
}
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @shishirbychapur @glemenneo @Daviancold @lynnlow175 @yunruu
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
![build_test_workflow](https://github.com/CS3219-AY2425S1/cs3219-ay2425s1-project-g31/actions/workflows/ci.yml/badge.svg)

# 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: G31

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

[![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-22041afd0340ce965d47ae6ef1cefeee28c7c493a6346c4f15d667ab976d596c.svg)](https://classroom.github.com/a/bzPrOe11)
9 changes: 9 additions & 0 deletions backend/collaboration-service/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ['@repo/eslint-config/eslint-service.js'],
parserOptions: {
root: true,
tsconfigRootDir: __dirname,
sourceType: 'module',
},
}
4 changes: 4 additions & 0 deletions backend/collaboration-service/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore artifacts:
**/coverage/*
**/dist/*
**/public/*
39 changes: 39 additions & 0 deletions backend/collaboration-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# ---- Node 22 on Alpine Linux ----
FROM node:22-alpine AS base

FROM base AS builder
RUN apk update && apk add --no-cache libc6-compat

WORKDIR /app

COPY . .

# Generate a partial monorepo with a pruned lockfile for the app
RUN npx turbo prune --scope=collaboration-service --docker

FROM base AS installer
RUN apk update && apk add --no-cache libc6-compat
WORKDIR /app

#############################################
# ---- Dependencies ----
COPY --from=builder /app/out/json/ .
RUN npm install

#############################################
# ---- App ----
COPY --from=builder /app/out/full/ .
RUN npx turbo build --filter=collaboration-service

#############################################
# ---- Start ----
FROM base AS runner
WORKDIR /app

# Don't run production as root
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 collaboration-service
USER collaboration-service

COPY --from=installer /app .

CMD ["node", "backend/collaboration-service/dist/server"]
19 changes: 19 additions & 0 deletions backend/collaboration-service/__mocks__/config.mock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { generateKeyPairSync } from 'crypto'

// Generate RSA key pair for testing
const { publicKey, privateKey } = generateKeyPairSync('rsa', {
modulusLength: 2048,
publicKeyEncoding: { type: 'spki', format: 'pem' },
privateKeyEncoding: { type: 'pkcs8', format: 'pem' },
})

export default {
NODE_ENV: 'test',
PORT: '3008',
ACCESS_TOKEN_PUBLIC_KEY: Buffer.from(publicKey).toString('base64'),
ACCESS_TOKEN_PRIVATE_KEY: Buffer.from(privateKey).toString('base64'),
DB_URL: 'mongodb://localhost:27017/user-service',
USER_SERVICE_URL: 'http://localhost:3002',
QUESTION_SERVICE_URL: 'http://localhost:3004',
MATCHING_SERVICE_URL: 'http://localhost:3006',
}
14 changes: 14 additions & 0 deletions backend/collaboration-service/__tests__/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import request from 'supertest'
import configMock from '../__mocks__/config.mock'
import app from '../src/index'

jest.mock('../src/common/config.util', () => configMock)

describe('Index', () => {
describe('GET /', () => {
it('should return 200 OK', async () => {
const response = await request(app).get('/')
expect(response.status).toBe(200)
})
})
})
19 changes: 19 additions & 0 deletions backend/collaboration-service/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
// [...]
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
// '^.+\\.[tj]sx?$' to process ts,js,tsx,jsx with `ts-jest`
// '^.+\\.m?[tj]sx?$' to process ts,js,tsx,jsx,mts,mjs,mtsx,mjsx with `ts-jest`
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
},
],
},
collectCoverage: true,
}
Loading
Loading