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 218 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
218 commits
Select commit Hold shift + click to select a range
e04c9f9
Setting up GitHub Classroom Feedback
github-classroom[bot] Sep 3, 2024
dfa5d44
add deadline
github-classroom[bot] Sep 3, 2024
0bd9eaa
Initialize frontend
samuelim01 Sep 12, 2024
a67ed8e
Frontend: Add ESLint
samuelim01 Sep 12, 2024
f51961b
Initialize GitHubActions
samuelim01 Sep 12, 2024
4836980
Frontend: Add Prettier
samuelim01 Sep 12, 2024
d5a11c1
Remove ghost files
samuelim01 Sep 12, 2024
8d2d223
Slim Prettier
samuelim01 Sep 12, 2024
8c48a6e
Remove vscode files
samuelim01 Sep 12, 2024
cf324f1
Fix Prettier CR issue
samuelim01 Sep 12, 2024
fd36cdf
Initialize Question Service
samuelim01 Sep 12, 2024
8706ca1
Added DB for question service
samuelim01 Sep 12, 2024
936c926
Restrict DB access
samuelim01 Sep 12, 2024
6f1d393
Initialize sample questions
samuelim01 Sep 12, 2024
e9cb3a7
Tighten question schema
samuelim01 Sep 12, 2024
f038e25
Add demo questions API
samuelim01 Sep 12, 2024
5f75429
Clean up code
samuelim01 Sep 12, 2024
e527baf
Merge pull request #2 from CS3219-AY2425S1/init-frontend
samuelim01 Sep 12, 2024
b1fccbf
Update Question to use TS
samuelim01 Sep 12, 2024
eb18069
Add basic GHA for question
samuelim01 Sep 12, 2024
6ea2372
Rename server.ts to index.ts
samuelim01 Sep 12, 2024
403e1f3
Clean up code
samuelim01 Sep 12, 2024
88dc1fc
Add middleware
samuelim01 Sep 13, 2024
dad68c4
Add ESLint to Question
samuelim01 Sep 13, 2024
7e1f596
Question: Add Prettier and GHA
samuelim01 Sep 13, 2024
6b52f74
Simplify GHA
samuelim01 Sep 13, 2024
3ec6a5d
Revert tsconfig.json
samuelim01 Sep 13, 2024
9e2e78e
compose: Add networks
samuelim01 Sep 13, 2024
1d1065b
Clean up code
samuelim01 Sep 13, 2024
4376a62
Update README.md
KhoonSun47 Sep 15, 2024
ba95e71
Update Readme.md to original format
KhoonSun47 Sep 15, 2024
85df44d
Update README.md for Question Service
KhoonSun47 Sep 15, 2024
909b93a
Update README.md
KhoonSun47 Sep 15, 2024
d4938d9
Update getQuestions function declaration
McNaBry Sep 16, 2024
ff17dd9
Rename complexity to difficulty
samuelim01 Sep 16, 2024
7a3db93
Specify question schema
samuelim01 Sep 16, 2024
2171c15
Rename categories to topics
samuelim01 Sep 16, 2024
6cf6298
Fix getHealth fuction parameters
samuelim01 Sep 17, 2024
fdcd930
Merge branch 'CS3219-AY2425S1:init-question' into init-question
KhoonSun47 Sep 18, 2024
1209688
Merge pull request #4 from CS3219-AY2425S1/init-question
McNaBry Sep 18, 2024
5a6faf3
Add PrimeNG
McNaBry Sep 18, 2024
a2e130c
Add ng lint fix
McNaBry Sep 18, 2024
789b9d7
Merge pull request #27 from CS3219-AY2425S1/init-primeng
McNaBry Sep 18, 2024
423a305
init question components
limcaaarl Sep 18, 2024
e15dd72
Add route for questions page
limcaaarl Sep 18, 2024
6a0114e
Add PrimeFlex
McNaBry Sep 19, 2024
e35083b
Add table component
limcaaarl Sep 19, 2024
b335b67
Fix primeflex import
limcaaarl Sep 19, 2024
fc39edc
Change primeflex import from css to scss
McNaBry Sep 19, 2024
017fe91
Add async animations provider
McNaBry Sep 19, 2024
6fdd8ec
Add .env to .gitignore
McNaBry Sep 19, 2024
87601d0
Fix linting
McNaBry Sep 19, 2024
330999c
Add delete question event handling
limcaaarl Sep 19, 2024
2a21887
Merge branch 'init-primeflex' of https://github.com/limcaaarl/cs3219-…
limcaaarl Sep 20, 2024
7691aa8
Merge branch 'init-primeflex' into question-spa-frontend
limcaaarl Sep 20, 2024
eca9c80
Add node_modules to .gitignore
KhoonSun47 Sep 20, 2024
6049982
Add dialog box for creating new question
limcaaarl Sep 20, 2024
8ee7707
Add edit button for each row
limcaaarl Sep 20, 2024
19dfe9d
Add Prime Icons
limcaaarl Sep 20, 2024
3fe7f78
Merge pull request #28 from CS3219-AY2425S1/init-primeflex
McNaBry Sep 20, 2024
29b0cff
Add new get endpoint and update models
KhoonSun47 Sep 20, 2024
5c69685
feat: Update and add new endpoints for question service
KhoonSun47 Sep 21, 2024
0a9794f
Fix edit bugs
limcaaarl Sep 21, 2024
a1eebb9
Fix spacing issues
limcaaarl Sep 21, 2024
398a915
Fix row duplicate bug
limcaaarl Sep 21, 2024
669c329
Update question data to read locally
limcaaarl Sep 21, 2024
6c3c4ea
Fix pagination bug
limcaaarl Sep 21, 2024
87be2f4
Update README.md for Question Service
KhoonSun47 Sep 21, 2024
7498b25
Update README.md and endpoint
KhoonSun47 Sep 22, 2024
7a8e2f4
Reformat code for consistent indetation
limcaaarl Sep 22, 2024
807dc1b
Refactor classes and enums into separate files
limcaaarl Sep 22, 2024
e5f14bf
Update README.md and Endpoints:
KhoonSun47 Sep 22, 2024
599addf
Fix bug where selected row is not getting updated after edit
limcaaarl Sep 22, 2024
b0bae2a
Remove redundant component
limcaaarl Sep 22, 2024
56d7831
Merge pull request #29 from limcaaarl/question-spa-frontend
limcaaarl Sep 22, 2024
25ce3b8
Fix lint error
limcaaarl Sep 22, 2024
6aee0ac
Merge pull request #31 from limcaaarl/question-spa-frontend
limcaaarl Sep 22, 2024
c771655
Merge branch 'CS3219-AY2425S1:main' into main
KhoonSun47 Sep 22, 2024
acdc854
Update README.md and MongoDB settings:
KhoonSun47 Sep 23, 2024
8f5b53c
Fix EsLint Issues
KhoonSun47 Sep 23, 2024
41c79e6
Update README.md
KhoonSun47 Sep 23, 2024
558105c
Update prettier to format html files (#34)
McNaBry Sep 23, 2024
bc38e0a
Merge branch 'CS3219-AY2425S1:main' into main
KhoonSun47 Sep 23, 2024
ad5d1aa
Minor Fixes on Question Service
KhoonSun47 Sep 24, 2024
98932ce
Update README.md and functionality of Endpoints:
KhoonSun47 Sep 24, 2024
04d1b5d
Use ESlint for indentation
KhoonSun47 Sep 24, 2024
541b2c0
Added .idea to .gitignore
KhoonSun47 Sep 24, 2024
68d682e
Merge branch 'main' into question-spa-frontend
limcaaarl Sep 24, 2024
6323496
Update minor changes
limcaaarl Sep 24, 2024
78872ba
Fix indentations inconsistencies for .html files
limcaaarl Sep 24, 2024
31dd2a8
Update budget limit
limcaaarl Sep 24, 2024
4fa3ee9
Add .idea to .gitignore and remove from Git tracking
KhoonSun47 Sep 25, 2024
37a03f5
Merge branch 'main' into init-question
KhoonSun47 Sep 25, 2024
8edfb05
Remove .idea from tracking and update .gitignore
KhoonSun47 Sep 25, 2024
31200b1
Merge branch 'init-question' of https://github.com/KhoonSun47/cs3219-…
KhoonSun47 Sep 25, 2024
a0b9392
Merge pull request #33 from KhoonSun47/init-question
KhoonSun47 Sep 25, 2024
c91c83c
Merge branch 'main' into question-spa-frontend
limcaaarl Sep 25, 2024
0c7e193
PR template (#3)
samuelim01 Sep 25, 2024
90173d7
Generate template for service caller
limcaaarl Sep 25, 2024
f20f99c
Refactor models into separate files
limcaaarl Sep 25, 2024
20205c6
Add config file to store base url
limcaaarl Sep 25, 2024
f8b1544
Implement QuestionService with getQuestions method
limcaaarl Sep 25, 2024
ddb9c84
Fix linting
limcaaarl Sep 25, 2024
193e33f
Implement getTopics method
limcaaarl Sep 26, 2024
ca65293
Add forkJoin to combine question and topic API calls
limcaaarl Sep 26, 2024
bbbf308
Add API calls
limcaaarl Sep 26, 2024
abd4117
Integrate API calls with UI
limcaaarl Sep 26, 2024
ef6cf74
Merge branch 'main' of https://github.com/KhoonSun47/cs3219-ay2425s1-…
KhoonSun47 Sep 26, 2024
f2df810
Add Login and Registration Pages (#32)
McNaBry Sep 26, 2024
752876d
Update README.md and Error Messages:
KhoonSun47 Sep 27, 2024
5f376cb
Remove .idea from tracking and update .gitignore
KhoonSun47 Sep 27, 2024
154b802
Merge pull request #37 from KhoonSun47/init-question
limcaaarl Sep 27, 2024
ce558d0
Update error message handling
limcaaarl Sep 27, 2024
a354be1
Fix merge conflicts
limcaaarl Sep 27, 2024
7a3313c
Add loading spinner when fetching all data
limcaaarl Sep 27, 2024
dc4279b
Update loading spinner style
limcaaarl Sep 27, 2024
1ddb1f9
Remove locally stored questions
limcaaarl Sep 27, 2024
b84cb20
Update id column to be sortable
limcaaarl Sep 27, 2024
efc6e14
Fix topics field validation
limcaaarl Sep 27, 2024
9e8fc42
Update form errors to use the new Angular @if syntax
limcaaarl Sep 27, 2024
60464d3
Update to use formGroup.value instead of field listeners
limcaaarl Sep 27, 2024
129e4b0
Fix dialog header text
limcaaarl Sep 27, 2024
8ce20c2
Move question.service.ts to shared services folder
limcaaarl Sep 27, 2024
7450fca
Merge branch 'main' of https://github.com/CS3219-AY2425S1/cs3219-ay24…
samuelim01 Sep 27, 2024
b33dc0e
Copy user service
samuelim01 Sep 27, 2024
1291b29
Dockerise user-service
LimZiJia Sep 23, 2024
0d1984e
Dockerise user-service
LimZiJia Sep 23, 2024
d91d061
Merge with main
LimZiJia Sep 23, 2024
3ae459f
Create .gitignore
LimZiJia Sep 23, 2024
dbbef27
Fix POST causing SEGSEGV
LimZiJia Sep 24, 2024
e63f15c
Extract dialog box into a new component
limcaaarl Sep 27, 2024
fd7d2bc
Add test
LimZiJia Sep 24, 2024
5dbe575
Basic user service
LimZiJia Sep 27, 2024
667f3b5
Move user service folder
samuelim01 Sep 27, 2024
7f27325
Fix minor user service issues
samuelim01 Sep 27, 2024
6fc2041
Update topics dropdown to allow addition of new topics
limcaaarl Sep 27, 2024
ab2ce43
Change login to use username
samuelim01 Sep 27, 2024
5c490d0
Fix user env typo
samuelim01 Sep 27, 2024
b5168bb
Fix margin issue with dialog box
limcaaarl Sep 27, 2024
4d03d12
Fix css issue with add new topic button
limcaaarl Sep 27, 2024
4d3cb1c
Improve add new topic behaviour
samuelim01 Sep 27, 2024
a4ea983
Fix minor issues
limcaaarl Sep 27, 2024
4d25437
Fix merge conflicts
limcaaarl Sep 27, 2024
3ca9b79
Update README.md and questionController.ts
KhoonSun47 Sep 28, 2024
c1861bb
Init user service (#39)
LimZiJia Sep 28, 2024
ae4ba44
Fix bugs
limcaaarl Sep 28, 2024
30f8d8f
Update README.md based on comments
KhoonSun47 Sep 28, 2024
aaf5883
Merge pull request #40 from KhoonSun47/init-question
limcaaarl Sep 28, 2024
28dbdd2
Merge branch 'main' into question-spa-frontend
limcaaarl Sep 28, 2024
e5a32f0
Update questionController.ts
KhoonSun47 Sep 28, 2024
363d91d
Merge pull request #41 from KhoonSun47/init-question
limcaaarl Sep 28, 2024
0db5a22
Merge pull request #30 from CS3219-AY2425S1/question-spa-frontend
limcaaarl Sep 28, 2024
e011fba
Update README and questionController.ts (#42)
KhoonSun47 Sep 28, 2024
661a430
Enable login
LimZiJia Sep 28, 2024
8605f38
Same commit as before
LimZiJia Sep 28, 2024
8be5003
Implement login and register
LimZiJia Sep 28, 2024
f906bf1
Improve README and docker compose files (#43)
samuelim01 Sep 29, 2024
dbf74f6
Rename files
LimZiJia Sep 29, 2024
3114a9e
Merge remote-tracking branch 'origin/main' into connect-frontend-with…
LimZiJia Sep 29, 2024
ac136c6
Fix wrong merge
LimZiJia Sep 29, 2024
b01dceb
Init guards
LimZiJia Sep 29, 2024
4d48539
Implement auth-guard and interceptors
LimZiJia Sep 30, 2024
d3a9e4c
Convert user service to typescript (#45)
samuelim01 Sep 30, 2024
4545df7
Fix prettier
LimZiJia Sep 30, 2024
fb9e5c4
Fix silly issues
LimZiJia Sep 30, 2024
dad4d75
Fix linting
LimZiJia Sep 30, 2024
f23b4fd
Temp commit
LimZiJia Sep 30, 2024
c9cec7b
Improve questions (#49)
samuelim01 Oct 3, 2024
26ac65f
Dockerize user-db locally (#53)
samuelim01 Oct 6, 2024
6f8ab95
Initialize API gateway (#51)
samuelim01 Oct 11, 2024
095ca84
Fix error handling
LimZiJia Oct 16, 2024
b7b1c39
Fix linting
LimZiJia Oct 16, 2024
0e8e918
Changed SPA
LimZiJia Oct 16, 2024
fa522fd
Connect frontend with user service (#47)
LimZiJia Oct 17, 2024
a04cd68
Add Navigation Bar (#48)
limcaaarl Oct 19, 2024
b858491
Add Match Page (#44)
McNaBry Oct 20, 2024
b13bd16
Add and integrate match service (#56)
samuelim01 Oct 20, 2024
374d8da
Nav bar fix (#55)
limcaaarl Oct 20, 2024
1c3d593
Merge branch 'main' into role-based-authorization-spa
LimZiJia Oct 23, 2024
1b8cb53
Merge with main
LimZiJia Oct 23, 2024
d5c4faa
Small modifications
LimZiJia Oct 24, 2024
75d2106
Merge branch 'main' into role-based-authorization-spa
LimZiJia Oct 24, 2024
bc65ef7
Add dozzle (#59)
samuelim01 Oct 24, 2024
6bf6136
Organise env variables and authorization (#60)
samuelim01 Oct 26, 2024
89cb0bb
Enhance Login & Registration Pages (#57)
McNaBry Oct 26, 2024
ee93410
Add resizing for navbar (#65)
McNaBry Oct 29, 2024
f85a63b
Add Collab Page (#52)
limcaaarl Oct 31, 2024
fcd5022
Use @if directive and fix bugs
LimZiJia Nov 1, 2024
1667d91
Merge branch 'main' into role-based-authorization-spa
LimZiJia Nov 1, 2024
2939dff
Remove extra whitespace
LimZiJia Nov 1, 2024
097b6b7
Ensure codebase is production-ready (#68)
samuelim01 Nov 1, 2024
5272e5d
Fix questions routes (#73)
samuelim01 Nov 2, 2024
33e19d8
Merge pull request #58 from CS3219-AY2425S1/role-based-authorization-spa
LimZiJia Nov 2, 2024
cf4f491
Collab enhancement + Chat + Homepage (#76)
limcaaarl Nov 3, 2024
c00b72e
Minor Fix To Handle isForfeit Status (#78)
KhoonSun47 Nov 3, 2024
dea4987
History Service (#69)
samuelim01 Nov 3, 2024
ccd3d92
Create GitHub Actions for auto deployment to AWS (#66)
McNaBry Nov 3, 2024
3ce9ac7
Add validation for registration details on user service (#79)
McNaBry Nov 6, 2024
c2cbdfa
Bug Fix for Submit Button and Forfeit (#81)
limcaaarl Nov 6, 2024
65f37ff
Deploy history (#82)
samuelim01 Nov 6, 2024
517f526
Fix history build (#83)
samuelim01 Nov 7, 2024
1794597
Update project title and favicon (#84)
limcaaarl Nov 7, 2024
9ff60da
Minor Fix on the Collaboration Service (#86)
KhoonSun47 Nov 8, 2024
86d2601
Database per service pattern (#85)
samuelim01 Nov 10, 2024
c49d008
Rename Match Queue (#88)
samuelim01 Nov 10, 2024
952b613
Add backend deploy script (#89)
samuelim01 Nov 12, 2024
82f1389
Modify history port (#90)
samuelim01 Nov 12, 2024
1a61971
Fix bug for collab (#92)
limcaaarl Nov 13, 2024
d4439c9
Fix font issue (#93)
McNaBry Nov 13, 2024
3ccae10
Implement responsive design for question page (#94)
McNaBry Nov 13, 2024
3164014
Profile history pages (#80)
LimZiJia Nov 13, 2024
a3e960e
Fix forfeit not retrieving snapshot (#95)
samuelim01 Nov 13, 2024
de92e85
Bug fix for #77 (#91)
limcaaarl Nov 13, 2024
deb6415
Fixed bugs (#99)
LimZiJia Nov 13, 2024
fdd794d
Add backend validation when updating user and update documentation (#98)
McNaBry Nov 13, 2024
8520762
Fix question page error (#100)
samuelim01 Nov 13, 2024
0c24387
Update history page styles (#101)
McNaBry Nov 13, 2024
d93643a
Testing (#87)
LimZiJia Nov 14, 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
  •  
  •  
  •  
33 changes: 33 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This is a sample environment configuration file.
# Copy this file to .env and replace the placeholder values with your own.

# Question Service
QUESTION_DB_CLOUD_URI=<FILL-THIS-IN>
QUESTION_DB_LOCAL_URI=mongodb://question-db:27017/question

# User Service
USER_DB_CLOUD_URI=<FILL-THIS-IN>
USER_DB_LOCAL_URI=mongodb://user-db:27017/user

# Match Service
MATCH_DB_CLOUD_URI=<FILL-THIS-IN>
MATCH_DB_LOCAL_URI=mongodb://match-db:27017/match

# Collaboration Service
COLLAB_DB_CLOUD_URI=<FILL-THIS-IN>
COLLAB_DB_LOCAL_URI=mongodb://collaboration-db:27017/collaboration
YJS_DB_CLOUD_URI=<FILL-THIS-IN>
YJS_DB_LOCAL_URI=mongodb://collaboration-db:27017/room

# History Service
HISTORY_DB_CLOUD_URI=<FILL-THIS-IN>
HISTORY_DB_LOCAL_URI=mongodb://history-db:27017/history

# Broker
BROKER_URL=amqp://broker:5672

# Secret for creating JWT signature
JWT_SECRET=you-can-replace-this-with-your-own-secret

# Node environment
NODE_ENV=development
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Description

Please include a summary of the changes made in this pull request.

## Checklist

- [ ] I have updated documentation
- [ ] All tests passing

## Screenshots (if applicable)
64 changes: 64 additions & 0 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Deploy Backend Services

on:
push:
branches: [ 'production' ]

workflow_dispatch:

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

env:
AWS_REGION: ap-southeast-1
ECS_CLUSTER: backend-cluster

jobs:
deploy:
name: Deploy Backend Service
runs-on: ubuntu-latest
environment: production

strategy:
matrix:
service: [ 'question', 'user', 'match', 'collaboration', 'history' ]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure AWS credentials
id: aws-configure
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.AWS_BACKEND_ROLE }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ env.AWS_REGION }}

- name: Login to AWS ECR
id: login-ecr
uses: aws-actions/[email protected]

- name: Build and push ${{ matrix.service }} image to AWS ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ matrix.service }}
IMAGE_TAG: latest
run: |
echo "Building $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG ./services/${{ matrix.service }}
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG

- name: Update AWS Service (${{ matrix.service }}) # Trigger re-deployment with latest image
id: update-service
env:
ECS_SERVICE: ${{ matrix.service }}-service
run: |
echo "Updating $ECS_SERVICE for $ECS_CLUSTER"
aws ecs update-service \
--cluster $ECS_CLUSTER \
--service $ECS_SERVICE \
--force-new-deployment \
--region $AWS_REGION
44 changes: 44 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy Frontend

on:
push:
branches: [ 'production' ]

workflow_dispatch:

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

env:
AWS_REGION: ap-southeast-1
S3_BUCKET_NAME: app.peerprep.org

jobs:
deploy:
name: Deploy Frontend
runs-on: ubuntu-latest
environment: production

steps:
- uses: actions/checkout@v4

- name: Configure AWS credentials
id: aws-configure
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.AWS_FRONTEND_ROLE }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ env.AWS_REGION }}

- name: Build frontend distribution
working-directory: frontend
run: npm ci && npm run build

- name: Sync distribution to S3
run: |
aws s3 sync ./frontend/dist/frontend/browser/ s3://$S3_BUCKET_NAME --delete

- name: Invalidate Cloudfront Cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_ID }} --paths "/*"
61 changes: 61 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
## https://docs.github.com/en/actions
name: CI

# Controls when the workflow will run
on:
push:
branches: [ 'main' ]
pull_request:
branches: [ 'main' ]
types: [ 'opened', 'reopened', 'synchronize']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
node-version: '20.x'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-service:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
service: [frontend, services/user, services/match]
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
- name: Install Node Modules
run: cd ${{ matrix.service }} && npm ci
- name: Linting
run: cd ${{ matrix.service }} && npm run lint
- name: Build App
run: cd ${{ matrix.service }} && npm run build


build-service-and-test:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
service: [services/question, services/collaboration, services/history]
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
- name: Install Node Modules
run: cd ${{ matrix.service }} && npm ci
- name: Linting
run: cd ${{ matrix.service }} && npm run lint
- name: Build App
run: cd ${{ matrix.service }} && npm run build
- name: Run tests
run: cd ${{ matrix.service }} && npm run test
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/node_modules
**/.env
**/.idea
# Vim temp files
*~
*.swp
*.swo
80 changes: 75 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,77 @@
[![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-22041afd0340ce965d47ae6ef1cefeee28c7c493a6346c4f15d667ab976d596c.svg)](https://classroom.github.com/a/bzPrOe11)

# CS3219 Project (PeerPrep) - AY2425S1
## Group: Gxx

### Note:
- You can choose to develop individual microservices within separate folders within this repository **OR** use individual repositories (all public) for each microservice.
- In the latter scenario, you should enable sub-modules on this GitHub classroom repository to manage the development/deployment **AND** add your mentor to the individual repositories as a collaborator.
- The teaching team should be given access to the repositories as we may require viewing the history of the repository in case of any disputes or disagreements.
## Group: G03

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

## Pre-requisites

1. Install [Docker Desktop](https://www.docker.com/products/docker-desktop/)
2. Clone the GitHub repository

```
git clone https://github.com/CS3219-AY2425S1/cs3219-ay2425s1-project-g03.git
```

## Getting Started

**Step 1: Copy Environment Configuration File**

To get started, copy the contents of `.env.sample` into a new `.env` file located at the root level of the project.

**Step 2: Build the Docker containers**

Next, run the following command to build the Docker containers.

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

**Step 3: Start the Docker containers**

Once the build is complete, you can start the Docker containers.

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

After spinning up the services, you may access the frontend client at `127.0.0.1:4200`. Specifically, you can navigate
to the Question SPA at `127.0.0.1:4200/questions` and the login page at `127.0.0.1/account`.

If you would like to spin up the services in development mode, you may use the following command. This enables hot
reloading and exposes the ports for all microservices.

```bash
docker compose -f compose.yml -f compose.dev.yml up -d
```

| Service | Port |
|------------------------------|------|
| Frontend | 4200 |
| API Gateway | 8080 |
| Question Service | 8081 |
| User Service | 8082 |
| Match Service | 8083 |
| Collaboration & Room Service | 8084 |
| History Service | 8085 |

**Step 4: Stop the Docker containers**

Once you are done, stop and remove the containers using:

```bash
docker compose down -v
```

Note that this will clear any data stored in volumes associated with the containers. If you would like to keep your
data, you can run the command without the `-v` flag, which will remove the containers but retain the data in the volumes
for future use.
77 changes: 77 additions & 0 deletions compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
services:
frontend:
volumes:
- /app/node_modules
- ./frontend:/app

question:
command: npm run dev
ports:
- 8081:8081
volumes:
- /app/node_modules
- ./services/question:/app

question-db:
ports:
- 27017:27017

user:
command: npm run dev
ports:
- 8082:8082
volumes:
- /app/node_modules
- ./services/user:/app

user-db:
ports:
- 27018:27017

match:
command: npm run dev
ports:
- 8083:8083
volumes:
- /app/node_modules
- ./services/match:/app

match-db:
ports:
- 27019:27017

collaboration:
command: npm run dev
ports:
- 8084:8084
volumes:
- /app/node_modules
- ./services/collaboration:/app

collaboration-db:
ports:
- 27020:27017

history:
command: npm run dev
ports:
- 8085:8085
volumes:
- /app/node_modules
- ./services/history:/app

history-db:
ports:
- 27021:27017

broker:
ports:
- 5672:5672

dozzle:
image: amir20/dozzle:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 8000:8080
restart: always
Loading