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 617 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
617 commits
Select commit Hold shift + click to select a range
e94b6a8
feat: Add SubmissionView component for displaying user submissions
tim-pipi Nov 2, 2024
a0efcd2
refactor: Update question numbering in QuestionView component
tim-pipi Nov 2, 2024
6a2b246
refactor: Update attempted code in seed data for question 1
tim-pipi Nov 2, 2024
cc1353b
refactor: Update code-editor component to use provided initialValue a…
tim-pipi Nov 2, 2024
bad7bff
refactor: Update code-editor component to use provided initialValue a…
tim-pipi Nov 2, 2024
c4e8209
refactor: Update id type in SubmissionSchema to be a number
tim-pipi Nov 2, 2024
76881ac
refactor: Update SubmissionSchema to use 'code' and 'attemptedAt' pro…
tim-pipi Nov 2, 2024
895380d
refactor: Update attempted code in seed data for question 1
tim-pipi Nov 2, 2024
aba8ae0
refactor: Update SubmissionView component to include a button for vie…
tim-pipi Nov 2, 2024
59248d8
refactor: Update History model to use 'code' and 'attemptedAt' proper…
tim-pipi Nov 2, 2024
2036fd5
refactor: Update HistoryRepository to use 'attemptedAt' instead of 'A…
tim-pipi Nov 2, 2024
45122dd
refactor: Update Submission.ts to include SubmissionsArraySchema
tim-pipi Nov 2, 2024
c721da5
refactor: Update useSubmissions hook to include SubmissionsArraySchema
tim-pipi Nov 2, 2024
ff01784
refactor: Refactor History model to use Integer for id field
tim-pipi Nov 2, 2024
2f4ca90
refactor: Update attemptedAt transformation in SubmissionSchema
tim-pipi Nov 2, 2024
875e989
refactor: Update CodeEditor component to include value prop
tim-pipi Nov 2, 2024
a530741
refactor: Update CodeEditor component to use value prop
tim-pipi Nov 2, 2024
97c6ad7
refactor: Remove console.log statement in useSubmissions hook
tim-pipi Nov 2, 2024
c6ccf17
refactor: Add createHistory endpoint to HistoryController
tim-pipi Nov 2, 2024
f8eb247
refactor: Add createSubmission mutation to useSubmissions hook
tim-pipi Nov 2, 2024
1228188
refactor: Add SubmitButton component to QuestionRoute
tim-pipi Nov 2, 2024
e995010
refactor: Add conditional rendering for SubmitButton in QuestionRoute
tim-pipi Nov 2, 2024
59b3b95
Merge branch 'dev' into feat/history-service
tim-pipi Nov 2, 2024
2024ded
refactor: Update HistoryRepository to use Integer as the type for the…
tim-pipi Nov 2, 2024
1dffb62
refactor: Update History model to use Integer for questionId and Long…
tim-pipi Nov 2, 2024
ad316f5
refactor: Update HistoryController and HistoryService to use Long for…
tim-pipi Nov 2, 2024
dbec565
refactor: Add spring-boot-starter-data-jpa dependency to pom.xml
tim-pipi Nov 2, 2024
813ae78
refactor: Update userId and questionId types to match backend API
tim-pipi Nov 2, 2024
e34f799
refactor: Add h2 database dependency to pom.xml
tim-pipi Nov 2, 2024
2826295
refactor: Update userId and questionId types to use numbers instead o…
tim-pipi Nov 2, 2024
3c63504
refactor: Update backend API URLs in frontend code
tim-pipi Nov 2, 2024
860d09f
refactor: Update backend API URLs to use common backend URL constant
tim-pipi Nov 2, 2024
0b47219
refactor: Update LoginPromptView in SubmissionView component
tim-pipi Nov 2, 2024
085edd3
feat: Add DatabaseSequence model for history service
tim-pipi Nov 2, 2024
ebbf095
refactor: Update History model to use Integer for userId and questionId
tim-pipi Nov 2, 2024
9961af6
refactor: Update History model to use Integer for userId and questionId
tim-pipi Nov 2, 2024
0ac685b
refactor: Update useSubmissions hook to use common backend URL constant
tim-pipi Nov 2, 2024
4d00a3f
refactor: Update init-mongo.js to create database_sequences collectio…
tim-pipi Nov 2, 2024
613cafd
fix: Ensure that user is logged in to access submit button
tim-pipi Nov 2, 2024
51766ae
refactor: Update submission types and schemas
tim-pipi Nov 2, 2024
91db29d
refactor: Update useSubmissions hook to use CreateSubmissionData type
tim-pipi Nov 2, 2024
a6efbb1
feat: Add duplicated question error UI
Jnjy Nov 2, 2024
412611e
refactor: Rename code-editor component to MonacoEditor
tim-pipi Nov 2, 2024
6d3dad4
feat: Add duplicated error on question update
Jnjy Nov 2, 2024
60bb0b5
refactor: Update useSubmissions hook to handle fetch errors and provi…
tim-pipi Nov 2, 2024
eb48828
refactor: Update code-editor component to use MonacoEditor
tim-pipi Nov 2, 2024
49a78b0
refactor: Update code-editor component to use MonacoEditor in questio…
tim-pipi Nov 2, 2024
20bf756
feat: Add examples to type
Jnjy Nov 2, 2024
b9f6606
feat: Add examples to SubmitHandler
Jnjy Nov 2, 2024
01725e6
feat: Enable update examples
Jnjy Nov 2, 2024
48d715d
feat: Add constraints to CreateQuestionData type
Jnjy Nov 2, 2024
6d39e4b
feat: Add constraints to SubmitHandler
Jnjy Nov 2, 2024
d9ea141
feat: Enable question update on constraints
Jnjy Nov 2, 2024
9dfd0de
chore: Remove unwanted file
Jnjy Nov 2, 2024
a78674b
feat: Hide create question if user is not admin
Jnjy Nov 2, 2024
d1d0124
feat: Disable update and delete question if user not admin
Jnjy Nov 2, 2024
5e5e5ca
fix: Fix equality to check for admin role
Jnjy Nov 2, 2024
50b1956
Merge pull request #101 from CS3219-AY2425S1/feature/ui-admin-quetion…
Jnjy Nov 2, 2024
2215110
Merge pull request #99 from CS3219-AY2425S1/fix/milestone-feedback-qu…
Jnjy Nov 2, 2024
331e725
Merge pull request #96 from CS3219-AY2425S1/fix/milestone-feedback-ui…
Jnjy Nov 2, 2024
66b513b
feat: Add admin page layout for user management
Jnjy Nov 2, 2024
d4819b1
refactor: Update service-history seed data with additional code submi…
tim-pipi Nov 2, 2024
bf199b5
Merge branch 'dev' into feat/history-service
tim-pipi Nov 2, 2024
ca4b4b4
Merge pull request #91 from CS3219-AY2425S1/feat/history-service
tim-pipi Nov 2, 2024
0ee49eb
feat: Add endpoint to get user summary
Jnjy Nov 3, 2024
650eb70
feat: Set token when user log in
Jnjy Nov 3, 2024
568a711
feat: Add set token method
Jnjy Nov 3, 2024
2c083b5
feat: Update admin page to allow changing roles
Jnjy Nov 3, 2024
afea05c
feat: Add user schema and useUsers hook
Jnjy Nov 3, 2024
5e2362a
feat: Add summary endpoint for user service
Jnjy Nov 3, 2024
aa52d3f
feat: Add response to return user info for admin
Jnjy Nov 3, 2024
830a285
feat: Add user update schema
Jnjy Nov 3, 2024
1132f4e
feat: Add update user hook
Jnjy Nov 3, 2024
7343d6d
feat: Change update user by admin to using dialog
Jnjy Nov 3, 2024
858f151
feat: Add admin only access to user management
Jnjy Nov 3, 2024
1f882d7
feat: Update User schema
Jnjy Nov 3, 2024
f5e990c
Update useUpdateUser hook
Jnjy Nov 3, 2024
fe53e1c
chore: Clean up code
Jnjy Nov 3, 2024
9ce283b
fix: Fix type error
Jnjy Nov 3, 2024
9431613
feat: Add admin user management to navbar
Jnjy Nov 3, 2024
321e335
Merge pull request #102 from CS3219-AY2425S1/feature/admin-ui-user-ma…
Jnjy Nov 3, 2024
af4e8da
Install yjs and yjs-monaco packages
zsh-eng Nov 2, 2024
56769dd
Add collaborative editor servcie boilerplate
zsh-eng Nov 3, 2024
0117065
Add backend websocket implementation
zsh-eng Nov 3, 2024
b587f7f
Add frontend collaborative editor
zsh-eng Nov 3, 2024
b1e3dea
Add shared cursors
zsh-eng Nov 4, 2024
ffdc911
Add collaborative editor to room
zsh-eng Nov 4, 2024
00142ac
Create docker compose for collab service
zsh-eng Nov 4, 2024
ebf2df0
Fix eslint config error
zsh-eng Nov 4, 2024
f38b2ff
Merge pull request #104 from CS3219-AY2425S1/zsheng/collaborative-cod…
zsh-eng Nov 4, 2024
a8b4771
fix: Change label of user management table to action
Jnjy Nov 5, 2024
3b176a7
Merge pull request #109 from CS3219-AY2425S1/fix/issue-108-admin-tabl…
Jnjy Nov 5, 2024
7173d06
[Code Execution] Typescript / javascript code execution (#110)
zsh-eng Nov 5, 2024
ffe6f03
fix: Change backend url to k8s assigned
Jnjy Nov 5, 2024
82ee2dc
Merge pull request #111 from CS3219-AY2425S1/fix/change-url-commons-fe
Jnjy Nov 5, 2024
dc8e377
fix: Update backend url in common.ts for k8s
Jnjy Nov 5, 2024
9ea1a79
Merge pull request #112 from CS3219-AY2425S1/fix/change-url-commons-fe
Jnjy Nov 5, 2024
e17a172
Add postgres in k8s and reset password BE
m1oojv Nov 5, 2024
2203819
feat: Add role field for table and edit UI
Jnjy Nov 5, 2024
f027fc2
feat: Add show password for login
Jnjy Nov 5, 2024
0e7d9cd
feat: Add deployment and service for history-service
tim-pipi Nov 5, 2024
8a23d26
feat: Add history-service to private API gateway
tim-pipi Nov 5, 2024
7c1dfaf
feat: Add show password icon for register page
Jnjy Nov 5, 2024
cd447fb
feat: Add history-service deployment and service for MongoDB
tim-pipi Nov 5, 2024
fa9290f
feat: Add history_service to IMAGE_NAMES in cleanup.sh
tim-pipi Nov 5, 2024
7d10749
feat: Add user email in user interface
Jnjy Nov 5, 2024
aa8d5ec
feat: Display user email when click on avatar
Jnjy Nov 5, 2024
eb17eef
edit: Remove cursor param
Jnjy Nov 5, 2024
7dd3dc7
feat: Change user badge to lighter grey
Jnjy Nov 5, 2024
69c0fc4
chore: Remove unwanted comment
Jnjy Nov 5, 2024
c592ac9
feat: Add error if admin wants to change own role
Jnjy Nov 5, 2024
63f7c24
Merge pull request #113 from CS3219-AY2425S1/feat/ui-enhancement
Jnjy Nov 5, 2024
1142835
fix: Allow individual eye icon activation
Jnjy Nov 5, 2024
ee15f6f
Merge pull request #114 from CS3219-AY2425S1/feat/ui-enhancement
Jnjy Nov 5, 2024
a5be769
refactor: Update useSubmissions hook to include authorization headers
tim-pipi Nov 5, 2024
6554b1b
feat: Add CORS configuration to public API gateway
tim-pipi Nov 5, 2024
ab4cb89
feat: Configure MongoDB container in history-mongodb-statefulset.yaml
tim-pipi Nov 5, 2024
5bb09d7
refactor: Update landing page layout and add links to practice proble…
tim-pipi Nov 5, 2024
be11e95
Merge pull request #115 from CS3219-AY2425S1/feat/landing-page
tim-pipi Nov 5, 2024
63aab0b
feat: Add update user and change password dialog
m1oojv Nov 5, 2024
e3e623b
Add forget password flow
m1oojv Nov 5, 2024
7b4fec2
Merge branch 'dev' into feat/kubernetes-with-FE-update-user
m1oojv Nov 5, 2024
fcca20c
Add checks whether user is verified when reset password
m1oojv Nov 5, 2024
70e0adb
Merge pull request #116 from CS3219-AY2425S1/feat/kubernetes-with-FE-…
m1oojv Nov 5, 2024
93dcce0
Add mongodb for history
m1oojv Nov 5, 2024
782ee95
Add kubenetes for collaborative editor and code execution
m1oojv Nov 5, 2024
8daa606
Merge pull request #117 from CS3219-AY2425S1/feat/kubernetes-with-FE-…
m1oojv Nov 5, 2024
ab97db2
feat: Add video service
LHeng1 Nov 5, 2024
b56f9ab
Merge pull request #118 from CS3219-AY2425S1/feat/video-service
LHeng1 Nov 5, 2024
6d21776
Fix room service
m1oojv Nov 6, 2024
6da3787
Merge pull request #119 from CS3219-AY2425S1/feat/kubernetes-with-FE-…
m1oojv Nov 6, 2024
0d835f4
Add video service for k8s
m1oojv Nov 6, 2024
ba5fb57
fix FE CI
m1oojv Nov 6, 2024
401be17
fix FE CI
m1oojv Nov 6, 2024
30e1ff8
fix FE CI
m1oojv Nov 6, 2024
cda0ccf
fix: Remove unused queue position UI
tim-pipi Nov 6, 2024
84a1a21
Merge pull request #120 from CS3219-AY2425S1/fix/remove-queue-position
tim-pipi Nov 6, 2024
425aac7
feat: Add sound effect for match found in DiscussRoute
tim-pipi Nov 6, 2024
d546ed7
Integrate code execution, disconnect, submit to room (#123)
zsh-eng Nov 6, 2024
687b9b3
Merge branch 'dev' of github.com:CS3219-AY2425S1/cs3219-ay2425s1-proj…
tim-pipi Nov 6, 2024
620fd4e
feat: Add welcome message and trusted logos to landing page
tim-pipi Nov 6, 2024
43c8598
feat: Add logos
tim-pipi Nov 6, 2024
b94deb0
feat: Add submissions route and table
tim-pipi Nov 6, 2024
cd031d9
refactor: Refactor useSubmissions hook and add useAllSubmissions hook
tim-pipi Nov 6, 2024
ef580a9
feat: Add question title to SubmissionSchema
tim-pipi Nov 6, 2024
e0708e2
feat: Add submissions Link
tim-pipi Nov 6, 2024
ea48efe
feat: Add submissions route to main.tsx
tim-pipi Nov 6, 2024
a010c0c
refactor: Remove unused questionTitle field from SubmissionSchema
tim-pipi Nov 6, 2024
af107c4
refactor: Update init seed history
tim-pipi Nov 6, 2024
c79e43b
feat: Add SubmissionsTable component
tim-pipi Nov 6, 2024
59550e4
refactor: Invalidate all submissions queries on submission creation
tim-pipi Nov 6, 2024
2c97e69
refactor: Update SubmissionView component
tim-pipi Nov 6, 2024
e46f925
refactor: Update SubmissionView component in QuestionRoute
tim-pipi Nov 6, 2024
6310e34
refactor: Update SubmissionsRoute component and replace AllSubmission…
tim-pipi Nov 6, 2024
db94fc6
refactor: Update SubmissionView component in RoomRoute
tim-pipi Nov 6, 2024
ff162a6
feat: Add question db deployment workflow
Jnjy Nov 6, 2024
de2f651
Merge pull request #132 from CS3219-AY2425S1/feature/deployment
Jnjy Nov 6, 2024
03b70ff
Merge pull request #131 from CS3219-AY2425S1/feat/history-page
tim-pipi Nov 6, 2024
0ceac63
edit: Change language type to string
Jnjy Nov 6, 2024
8fc79b3
feat: Add languages list
Jnjy Nov 6, 2024
5b35a23
feat: Add language selector menu item:
Jnjy Nov 6, 2024
0cf6a48
feat: Add language selector to question page
Jnjy Nov 6, 2024
bf28156
feat: Add language change with syntax highlighting
Jnjy Nov 6, 2024
0067805
feat: Add python execution
Jnjy Nov 7, 2024
396fdc7
feat: Add java execution code
Jnjy Nov 7, 2024
0260b9e
feat: Add to supported language
Jnjy Nov 7, 2024
2b0d633
feat: Install java jdk for docker image
Jnjy Nov 7, 2024
9a0b12e
feat: Update boiler plate code for languages
Jnjy Nov 7, 2024
3d2674a
feat: Add saving to user's typed code
Jnjy Nov 7, 2024
1496f18
Add headers for private api gateway
m1oojv Nov 7, 2024
75a8fbb
fix: Add language field to editor component
Jnjy Nov 7, 2024
0475e1f
Add auth and user id headers for websocket
m1oojv Nov 7, 2024
fd1aab7
BACKEND_WEBSOCKET_MATCHING
m1oojv Nov 8, 2024
d9c7f7b
Remove user avatar
zsh-eng Nov 8, 2024
d124057
Add hook for delete account
zsh-eng Nov 8, 2024
cebff44
Add dialog for deleting account
zsh-eng Nov 8, 2024
3a6712b
Fix pressing enter key on login dialog
zsh-eng Nov 8, 2024
9f4fc3f
Add user role and update dropdown menu styles
zsh-eng Nov 8, 2024
1692a14
Invalidate auth after updating user
zsh-eng Nov 8, 2024
d6fad60
Update auth logic
zsh-eng Nov 8, 2024
9bd1c3d
Merge pull request #134 from CS3219-AY2425S1/zsheng/bug-fixes
zsh-eng Nov 9, 2024
359566e
[Room] Use participant usernames (#135)
zsh-eng Nov 9, 2024
ce2d8e3
Fix z-index of navbar
zsh-eng Nov 9, 2024
2830d1b
Add padding to top of code editor
zsh-eng Nov 9, 2024
098fa89
Fix z-index for video call
zsh-eng Nov 9, 2024
df75f62
Fix z-index of room buttons
zsh-eng Nov 9, 2024
d672cae
Move video call outside resizable panel
zsh-eng Nov 9, 2024
6a16f75
Standardise font heading size across tabs
zsh-eng Nov 9, 2024
bfcee40
Add shadcn skeleton
zsh-eng Nov 9, 2024
e4871f0
Add skeleton and empty state
zsh-eng Nov 9, 2024
935b763
Merge pull request #136 from CS3219-AY2425S1/zsheng/ui-tweaks
zsh-eng Nov 9, 2024
a8ff4b9
Add authentication for websockets
m1oojv Nov 9, 2024
d20f5cd
Merge branch 'dev' into feat/api-gateway-headers
m1oojv Nov 9, 2024
2d26dab
Merge pull request #137 from CS3219-AY2425S1/feat/api-gateway-headers
m1oojv Nov 9, 2024
13de927
Update api/matching to read from custom headers
m1oojv Nov 9, 2024
4c569ef
Merge pull request #138 from CS3219-AY2425S1/feat/api-gateway-headers
m1oojv Nov 9, 2024
e55461e
Change question filter from public to private
m1oojv Nov 9, 2024
1da42fa
Merge pull request #139 from CS3219-AY2425S1/feat/api-gateway-headers
m1oojv Nov 9, 2024
6c43684
Fix collaborative editor token
m1oojv Nov 9, 2024
d2d101b
Merge pull request #140 from CS3219-AY2425S1/feat/api-gateway-headers
m1oojv Nov 9, 2024
cf284d9
Merge pull request #133 from CS3219-AY2425S1/feature/enhance-code-editor
Jnjy Nov 10, 2024
4242ad1
feat: Update matching algorithm to prioritize exact matches and topic…
tim-pipi Nov 10, 2024
0efc0c5
Merge pull request #144 from CS3219-AY2425S1/feat/matching-service-cr…
tim-pipi Nov 10, 2024
58312f1
Merge pull request #149 from CS3219-AY2425S1/zsheng/docker-api-gateway
zsh-eng Nov 12, 2024
d95d182
Fix csrf in room security config
zsh-eng Nov 12, 2024
a27f396
Handle room close in room service
zsh-eng Nov 12, 2024
2509751
Implement room closing logic in websocket
zsh-eng Nov 12, 2024
f33f163
Add controller endpoint for closing room
zsh-eng Nov 12, 2024
890e5f6
Add loader for matchedview
zsh-eng Nov 12, 2024
cd8960a
Add views for room closed and unavailable
zsh-eng Nov 12, 2024
6c3ffa5
Add useCloseRoom mutation
zsh-eng Nov 12, 2024
3af4209
Update websocket hook for handling room close events
zsh-eng Nov 12, 2024
1f24e61
Integrate room close into room route
zsh-eng Nov 12, 2024
560c798
Room closure (#150)
zsh-eng Nov 12, 2024
70650e3
Add null check for matching controller
zsh-eng Nov 12, 2024
cef803d
Update question service URL for Docker
zsh-eng Nov 13, 2024
775b82f
Add 404 response for rooms not found
zsh-eng Nov 13, 2024
4688cba
Update loading screen for rooms
zsh-eng Nov 13, 2024
8625373
Update connect / disconnect button icon
zsh-eng Nov 13, 2024
58c38d3
Add muted text in participant view when disconnected
zsh-eng Nov 13, 2024
d80792f
Shift position of action buttons
zsh-eng Nov 13, 2024
5b380b7
Fix z-index of language selector
zsh-eng Nov 13, 2024
4d3c648
Change language selector to titlecase
zsh-eng Nov 13, 2024
bd70bf9
Refactor to follow rooms button design
zsh-eng Nov 13, 2024
5a9cc89
Refactor language selector to shadcn dropdown
zsh-eng Nov 13, 2024
6cd1744
Update styling for action buttons
zsh-eng Nov 13, 2024
f350552
Add language selector to collaborative editor
zsh-eng Nov 13, 2024
ad0ac38
Update webpage title
zsh-eng Nov 13, 2024
ef391c7
Update new tab favicon
zsh-eng Nov 13, 2024
bbcee48
Merge pull request #151 from CS3219-AY2425S1/zsheng/more-bug-fixes
zsh-eng Nov 13, 2024
03b5a0a
Separate kubernetes for db
m1oojv Nov 13, 2024
cf6154f
Fix CI for question service
m1oojv Nov 13, 2024
2b3bbc2
Merge branch 'dev' into feat/api-gateway-headers
m1oojv Nov 13, 2024
566d518
Merge pull request #152 from CS3219-AY2425S1/feat/api-gateway-headers
m1oojv Nov 13, 2024
97fe3ca
Add delete user function for admin
m1oojv Nov 13, 2024
2e77f32
Merge pull request #153 from CS3219-AY2425S1/admin-delete-user
m1oojv Nov 13, 2024
30fe092
Fix video not showing bug after retoggle
LHeng1 Nov 13, 2024
b8880d4
Merge pull request #154 from CS3219-AY2425S1/fix/video-not-showing
LHeng1 Nov 13, 2024
577eeaf
fix: Remove deployment workflow
Jnjy Nov 13, 2024
5f2334e
Fix user controller updating details
zsh-eng Nov 13, 2024
6981e61
Fix create question form
zsh-eng Nov 13, 2024
51edf24
Add background colour for video call
zsh-eng Nov 13, 2024
6dc964c
Change icons to lucide
zsh-eng Nov 13, 2024
ddd5478
Move videos to right
zsh-eng Nov 13, 2024
1c4155d
Format questionview
zsh-eng Nov 13, 2024
7d8dcb8
Merge pull request #156 from CS3219-AY2425S1/zsheng/bug-fixes-3
zsh-eng Nov 13, 2024
cbf814f
Merge pull request #155 from CS3219-AY2425S1/fix/remove-deployment-yml
zsh-eng Nov 13, 2024
a83afc3
Remove failing test
zsh-eng Nov 13, 2024
33260e8
Add application properties
zsh-eng Nov 13, 2024
1fa20cb
Merge pull request #157 from CS3219-AY2425S1/dev
zsh-eng 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
  •  
  •  
  •  
87 changes: 87 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: CI

on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]

jobs:
build-and-test-backend:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: maven

- name: Create .env file for question service
run: |
cd backend/service-question/src/main/resources
echo "SPRING_DATASOURCE_URL=${{ secrets.SPRING_DATASOURCE_URL }}" >> .env

- name: Build and test service-question
run: |
cd backend/service-question
mvn clean verify

- name: Clean up .env file for question service
if: always()
run: |
cd backend/service-question/src/main/resources
rm -f .env

- name: Create .env file
run: |
cd backend/service-user/src/main/resources
echo "JWT_SECRET_KEY=${{ secrets.JWT_SECRET_KEY }}" >> .env
echo "SPRING_DATASOURCE_URL=${{ secrets.SPRING_DATASOURCE_URL }}" >> .env
echo "SPRING_DATASOURCE_USERNAME=${{ secrets.SPRING_DATASOURCE_USERNAME }}" >> .env
echo "SPRING_DATASOURCE_PASSWORD=${{ secrets.SPRING_DATASOURCE_PASSWORD }}" >> .env
echo "SUPPORT_EMAIL=${{ secrets.SUPPORT_EMAIL }}" >> .env
echo "APP_PASSWORD=${{ secrets.APP_PASSWORD }}" >> .env

- name: Build and test service-user
run: |
cd backend/service-user
mvn clean verify

- name: Clean up .env file
if: always()
run: |
cd backend/service-user/src/main/resources
rm -f .env

build-and-test-frontend:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '22'

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

- name: Install dependencies
run: |
cd frontend
pnpm install

- name: Build frontend
run: |
cd frontend
pnpm run build

# - name: Run frontend tests
# run: |
# cd frontend
# npm test
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![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
## Group: G55

### Note:
- You can choose to develop individual microservices within separate folders within this repository **OR** use individual repositories (all public) for each microservice.
Expand Down
34 changes: 34 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
service-user/src/main/resources/.env

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
43 changes: 43 additions & 0 deletions backend/kubernetes/01 - questiondb-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: questiondb
namespace: g55
spec:
serviceName: questiondb
replicas: 1
selector:
matchLabels:
app: questiondb
template:
metadata:
labels:
app: questiondb
spec:
containers:
- name: questiondb
image: mongo:6.0
ports:
- containerPort: 27017
env:
- name: MONGO_INITDB_ROOT_USERNAME
value: "root"
- name: MONGO_INITDB_ROOT_PASSWORD
value: "example"
volumeMounts:
- name: mongo-data
mountPath: /data/db
- name: questiondb-seed-volume
mountPath: /docker-entrypoint-initdb.d
volumes:
- name: questiondb-seed-volume
configMap:
name: questiondb-seed-config
volumeClaimTemplates:
- metadata:
name: mongo-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
12 changes: 12 additions & 0 deletions backend/kubernetes/02 - questiondb-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: questiondb
namespace: g55
spec:
ports:
- port: 27017
targetPort: 27017
selector:
app: questiondb
type: ClusterIP
46 changes: 46 additions & 0 deletions backend/kubernetes/03 - user-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: user-service
name: user-service
namespace: g55
spec:
replicas: 2
selector:
matchLabels:
app: user-service
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: user-service
spec:
initContainers:
- name: wait-for-db
image: busybox
command: [ 'sh', '-c', 'until nc -z userdb 5432; do echo waiting for database; sleep 2; done;' ]
containers:
- image: docker_username/user_service:latest
imagePullPolicy: IfNotPresent
name: user-service
env:
- name: SPRING_DATASOURCE_URL
value: "jdbc:postgresql://userdb.g55.svc.cluster.local:5432/user_db"
- name: SPRING_DATASOURCE_USERNAME
value: "postgres"
- name: SPRING_DATASOURCE_PASSWORD
value: "password"
resources:
requests:
memory: "1Gi"
cpu: "500m"
limits:
memory: "1Gi"
cpu: "1000m"
restartPolicy: Always
status: {}
13 changes: 13 additions & 0 deletions backend/kubernetes/04 - user-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: user-service
namespace: g55
spec:
selector:
app: user-service
ports:
- protocol: "TCP"
port: 8080
targetPort: 8080
type: ClusterIP
47 changes: 47 additions & 0 deletions backend/kubernetes/05 - question-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: question-service
name: question-service
namespace: g55
spec:
replicas: 2
selector:
matchLabels:
app: question-service
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: question-service
spec:
initContainers:
- name: wait-for-db
image: busybox
command:
[
"sh",
"-c",
"until nc -z questiondb 27017; do echo waiting for database; sleep 2; done;",
]
containers:
- image: docker_username/question_service:latest
imagePullPolicy: IfNotPresent
name: question-service
env:
- name: SPRING_DATA_MONGODB_URI
value: "mongodb://root:example@questiondb:27017/question_db?authSource=admin"
resources:
requests:
memory: "1Gi"
cpu: "500m"
limits:
memory: "1Gi"
cpu: "1000m"
restartPolicy: Always
status: {}
13 changes: 13 additions & 0 deletions backend/kubernetes/06 - question-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: question-service
namespace: g55
spec:
selector:
app: question-service
ports:
- protocol: "TCP"
port: 8080
targetPort: 8080
type: ClusterIP
36 changes: 36 additions & 0 deletions backend/kubernetes/07 - matching-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: matching-service
name: matching-service
namespace: g55
spec:
replicas: 1
selector:
matchLabels:
app: matching-service
strategy:
type: Recreate
template:
metadata:
labels:
app: matching-service
spec:
initContainers:
- name: wait-for-rabbitmq
image: busybox
command: [ 'sh', '-c', 'until nc -z rabbitmq.g55.svc.cluster.local 5672; do echo waiting for rabbitmq; sleep 2; done;' ]
containers:
- image: docker_username/matching_service:latest
imagePullPolicy: IfNotPresent
name: matching-service
resources:
requests:
memory: "1Gi"
cpu: "500m"
limits:
memory: "1Gi"
cpu: "1000m"
restartPolicy: Always
status: {}
13 changes: 13 additions & 0 deletions backend/kubernetes/08 - matching-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: matching-service
namespace: g55
spec:
selector:
app: matching-service
ports:
- protocol: "TCP"
port: 8080
targetPort: 8080
type: ClusterIP
Loading
Loading