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 741 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
741 commits
Select commit Hold shift + click to select a range
d297328
Resolved merge conflicts
IsabelChong Oct 25, 2023
6d7ab98
Clean up CodeSpace.tsx
IsabelChong Oct 25, 2023
c4064f3
Add listener for code run
IsabelChong Oct 25, 2023
8686159
Update docker compose
ExtraShotLatte Oct 25, 2023
78595e1
Cleanup
ExtraShotLatte Oct 25, 2023
a4b82b3
Update user-service
ExtraShotLatte Oct 25, 2023
8480f43
Update user-service
ExtraShotLatte Oct 25, 2023
8cd8563
Update dockercompose
ExtraShotLatte Oct 25, 2023
a818a7a
Enable logging of variables
ExtraShotLatte Oct 25, 2023
5e03edc
Update dockercompose
ExtraShotLatte Oct 25, 2023
d9eb0a7
Fix history saving bug
IsabelChong Oct 25, 2023
7b84c24
Merge pull request #53 from CS3219-AY2324S1/Branch-standardize-routes
IsabelChong Oct 25, 2023
f74f822
Resolved merge conflicts
IsabelChong Oct 25, 2023
6f9695a
Rename env variables in matching service and clean up code
IsabelChong Oct 25, 2023
f098964
Fix console header ui
angjunkang Oct 26, 2023
082cee6
Fix success status on console header
angjunkang Oct 26, 2023
beed4a8
Align matching labels
angjunkang Oct 26, 2023
14ebcf6
Change labels of components for consistency
angjunkang Oct 26, 2023
0ffa186
Add margin to bottm of the page
angjunkang Oct 26, 2023
9af9083
Add space between loading spinner and matching label
angjunkang Oct 26, 2023
9970225
Remove code execution icon before user run code
IsabelChong Oct 26, 2023
d5f00c1
Remove console output before user run code
IsabelChong Oct 26, 2023
f5e543f
Add margin bottom to match button
angjunkang Oct 26, 2023
f321a16
Fix disabled topic button style for consistency
angjunkang Oct 26, 2023
9c7e4f0
Fix header margins and padding
angjunkang Oct 26, 2023
ec51a20
Route analytics page to question attempt history page
kalarisng Oct 26, 2023
2328e43
Merge pull request #57 from CS3219-AY2324S1/branch-collaboration-codexec
angjunkang Oct 26, 2023
653ce3a
Clean up code and remove comments
kalarisng Oct 26, 2023
846568f
Create cloudbuild.yaml
Evande1 Oct 26, 2023
312bc49
testing
Evande1 Oct 26, 2023
19c1548
update and test
Evande1 Oct 26, 2023
8ac5764
Fix submission bug
angjunkang Oct 26, 2023
679ea37
Update cloudbuild.yaml
Evande1 Oct 26, 2023
7f06966
next changes
Evande1 Oct 26, 2023
77eef53
Update cloudbuild.yaml
Evande1 Oct 26, 2023
97a7c80
Merge pull request #61 from CS3219-AY2324S1/branch-collaboration-codexec
IsabelChong Oct 26, 2023
775f297
Make changes to UI, navigation and make landing page home page
kalarisng Oct 27, 2023
e0c524e
test run
Evande1 Oct 27, 2023
872a7a1
added question service
Evande1 Oct 27, 2023
b6d7d82
comment
Evande1 Oct 27, 2023
6f4cabd
update
Evande1 Oct 27, 2023
957b85c
cloudbuild cd
Evande1 Oct 27, 2023
700a4f4
Update cloudbuild.yaml
Evande1 Oct 27, 2023
1300ddb
changed cloudbuild yaml file
Evande1 Oct 27, 2023
f627bc6
Update Dockerfile.stage
Evande1 Oct 27, 2023
7ee87f0
Update Dockerfile.stage
Evande1 Oct 27, 2023
33a4427
Merge branch 'master' of https://github.com/CS3219-AY2324S1/ay2324s1-…
Evande1 Oct 27, 2023
f7bcb3c
Update cloudbuild.yaml
Evande1 Oct 27, 2023
812fb1f
Merge pull request #62 from CS3219-AY2324S1/branch-cicd
ExtraShotLatte Oct 27, 2023
66cca9a
Merge pull request #63 from CS3219-AY2324S1/master
ExtraShotLatte Oct 27, 2023
6201eb0
Fix code run route
ExtraShotLatte Oct 27, 2023
3bef33e
Merge pull request #64 from CS3219-AY2324S1/branch-collaboration-codexec
Evande1 Oct 27, 2023
76c5f6a
Fix component margins and sequeunce of action buttons
angjunkang Oct 27, 2023
4d8f45c
Change height and width of question card
angjunkang Oct 27, 2023
ad0f3c1
Fix tag container
angjunkang Oct 27, 2023
60c8ad9
Revamp question page ui
angjunkang Oct 27, 2023
8e275ad
Revamp add question form ui
angjunkang Oct 27, 2023
11a2d20
Revamp edit question form ui
angjunkang Oct 27, 2023
64676e0
Swap cancel and update button for consistency
angjunkang Oct 27, 2023
c1ca438
Change add question and back button color
angjunkang Oct 27, 2023
df769cf
Remove delete button for admin
ExtraShotLatte Oct 27, 2023
b055604
Increase question table container size
angjunkang Oct 27, 2023
1318130
Remove unnecessary routes
ExtraShotLatte Oct 27, 2023
33f8e5d
Enhance code clarity
ExtraShotLatte Oct 27, 2023
a695eb2
Merge pull request #68 from CS3219-AY2324S1/branch-collaboration-codexec
ExtraShotLatte Oct 27, 2023
38da601
Merge pull request #67 from CS3219-AY2324S1/branch-question-ui
ExtraShotLatte Oct 27, 2023
4f20203
Update new history route
kalarisng Oct 27, 2023
637893a
Merge pull request #66 from CS3219-AY2324S1/branch-usersvc-cleanup
angjunkang Oct 27, 2023
9794567
Merge pull request #65 from CS3219-AY2324S1/branch-admin-optimisation
angjunkang Oct 27, 2023
cc2a3a2
Close navbar upon clicking on nav links
angjunkang Oct 27, 2023
811d211
Adjust padding
kalarisng Oct 28, 2023
e40c232
Disable textfield after saving profile
angjunkang Oct 28, 2023
1cbb16a
Change label font size and media query of card
angjunkang Oct 28, 2023
a51a409
Revamp profile page ui
angjunkang Oct 28, 2023
d380c22
Fix columns of components on profile
angjunkang Oct 28, 2023
6d47ee5
Bind the socket to http server
angjunkang Oct 29, 2023
3e9f4d7
Merge pull request #70 from CS3219-AY2324S1/branch-profile-ui
ExtraShotLatte Oct 29, 2023
b3cf061
Merge pull request #69 from CS3219-AY2324S1/branch-nav-bar
ExtraShotLatte Oct 29, 2023
6ac19f0
Adjust box
kalarisng Oct 29, 2023
a76152c
Remove comments
kalarisng Oct 29, 2023
777e1f5
Fix merge conflicts
kalarisng Oct 29, 2023
c5fe1ad
Protect home page route
kalarisng Oct 29, 2023
c81a151
Route root to home
kalarisng Oct 29, 2023
44506da
Remove ws due to implementation error
angjunkang Oct 30, 2023
a868cdc
Update route
kalarisng Oct 30, 2023
079a7ac
Merge pull request #60 from CS3219-AY2324S1/Analytics
Evande1 Oct 30, 2023
c4d03fe
Remove topics with no question in some difficulties
angjunkang Oct 30, 2023
6348cc7
Add soft delete function in controller
angjunkang Oct 30, 2023
4ba45d1
Change delete route to soft delete
angjunkang Oct 30, 2023
4637256
Change question controller functions with the addition of soft delete
angjunkang Oct 30, 2023
ad4c4e3
Merge branch 'master' of https://github.com/CS3219-AY2324S1/ay2324s1-…
angjunkang Oct 30, 2023
be39aa5
Change mongoose structure and delete request to patch request
angjunkang Oct 30, 2023
7e00ca2
Hide edit and delete button if question has been soft deleted
angjunkang Oct 30, 2023
424e92d
Navigate user to 404 page if question does not exist
angjunkang Oct 30, 2023
1107792
Soft deleted questions will redirect users to 404 page
angjunkang Oct 30, 2023
0b83153
Allow soft deleted question to be viewed
angjunkang Oct 30, 2023
12791e0
Remove topics that has no questions for both forms
angjunkang Oct 30, 2023
a0743af
Revamp attempt page UI to be responsive
angjunkang Oct 30, 2023
87214e4
Change question history tags to be responsive
angjunkang Oct 30, 2023
c497270
Add loading to allow circular progress to finish fetching data
angjunkang Oct 30, 2023
c90066c
Merge pull request #72 from CS3219-AY2324S1/branch-question
IsabelChong Oct 31, 2023
a3c2cd4
Merge pull request #73 from CS3219-AY2324S1/branch-matching
IsabelChong Oct 31, 2023
1f92a8b
Merge branch 'master' of https://github.com/CS3219-AY2324S1/ay2324s1-…
angjunkang Oct 31, 2023
f8fded7
Create cloudbuild.test.yaml
Evande1 Oct 31, 2023
394503d
Merge branch 'branch-collaboration' of https://github.com/CS3219-AY23…
angjunkang Oct 31, 2023
b084823
Change codemirror to monaco
angjunkang Oct 31, 2023
3e3c865
Clean up console.log
angjunkang Nov 1, 2023
3dd5642
Edit code change event to prevent receiving self emitted event
angjunkang Nov 1, 2023
9eaa84a
Fix syntax error for broadcast
angjunkang Nov 1, 2023
83f5d81
Revert from monaco to codemirror
angjunkang Nov 2, 2023
3bdff43
Change codespace background colour and timer
angjunkang Nov 2, 2023
847460e
Add console.log for matching queue
angjunkang Nov 2, 2023
58716cc
Change cloudbuild.yaml back to master version
angjunkang Nov 2, 2023
c39e723
removed cloudbuild test and disabled cloud build
Evande1 Nov 2, 2023
ec866f7
Merge branch 'branch-collaboration' of https://github.com/CS3219-AY23…
Evande1 Nov 2, 2023
33a2f9a
Merge pull request #75 from CS3219-AY2324S1/branch-collaboration
Evande1 Nov 2, 2023
dbdd4a1
Merge pull request #74 from CS3219-AY2324S1/branch-analytics
ExtraShotLatte Nov 2, 2023
73bb46e
Add reset form after error
ExtraShotLatte Nov 2, 2023
141dccd
Add Admin Protected route to addquestions
ExtraShotLatte Nov 2, 2023
bebfd8d
Add additional user verification
ExtraShotLatte Nov 2, 2023
ef4a5ff
Merge pull request #77 from CS3219-AY2324S1/branch-protect-admin-routes
Evande1 Nov 2, 2023
dd843e7
Merge pull request #76 from CS3219-AY2324S1/branch-fix-userprofile
Evande1 Nov 2, 2023
01c5f28
Fix HTTP Code
ExtraShotLatte Nov 3, 2023
482d62a
update git ignore, testing assignment 3
Evande1 Nov 3, 2023
62fa319
Update auth response for security
ExtraShotLatte Nov 4, 2023
060567d
Change 401 redirect message to countdown
angjunkang Nov 4, 2023
467880e
Change loading spinner
angjunkang Nov 4, 2023
df32c5c
Change admin protected loading spinner
angjunkang Nov 4, 2023
828d040
Fix admin protected loading spinner style
angjunkang Nov 4, 2023
0eebd8d
Fix protected loading spinner style
angjunkang Nov 4, 2023
8d3f763
Add update questions to admin protected routes
ExtraShotLatte Nov 4, 2023
f5c7f8b
Merge branch 'branch-fix-httpcode' of https://github.com/CS3219-AY232…
ExtraShotLatte Nov 4, 2023
5facf57
Add loading spinner for profile page
angjunkang Nov 4, 2023
ab507ec
Merge branch 'branch-fix-httpcode' of https://github.com/CS3219-AY232…
angjunkang Nov 4, 2023
9810adb
Fix loading spinner bug for profile page
angjunkang Nov 4, 2023
a11abc7
Remove unnecessary css files from protected pages and make loading sp…
angjunkang Nov 4, 2023
8421154
Merge pull request #78 from CS3219-AY2324S1/branch-fix-httpcode
angjunkang Nov 4, 2023
6f54d81
Fix create question validation for soft delete
angjunkang Nov 6, 2023
80a96da
Fix update question for soft delete
angjunkang Nov 6, 2023
2b243bf
Merge pull request #79 from CS3219-AY2324S1/branch-question
ExtraShotLatte Nov 6, 2023
a848ab7
Delete nginx (not needed)
ExtraShotLatte Nov 6, 2023
e438a5f
Update main README
ExtraShotLatte Nov 6, 2023
fc22872
Add docs folder
ExtraShotLatte Nov 6, 2023
fb6958b
Add more documentation in root
ExtraShotLatte Nov 6, 2023
a4ea2b1
Fix link
ExtraShotLatte Nov 6, 2023
bed7d42
Remove README in microservices page
ExtraShotLatte Nov 6, 2023
4b15c19
Fix homepage route for unauthenticated user
angjunkang Nov 6, 2023
bd062d2
Add welcome message
ExtraShotLatte Nov 6, 2023
287ebb8
Fix navigation active home style
IsabelChong Nov 6, 2023
6e313fa
Merge pull request #81 from CS3219-AY2324S1/branch-route-protection
IsabelChong Nov 6, 2023
9397b71
Add Running locally readme
ExtraShotLatte Nov 6, 2023
37806e1
Add Docker README
ExtraShotLatte Nov 6, 2023
5bf3c1d
Fix code end block
ExtraShotLatte Nov 6, 2023
821627c
Update docker README to match local
ExtraShotLatte Nov 6, 2023
41d9d77
Add API endpoints documentations
ExtraShotLatte Nov 6, 2023
f896d70
Add API End points for User auth
ExtraShotLatte Nov 6, 2023
ee717e0
Tidy end points doc
ExtraShotLatte Nov 6, 2023
42248c2
Add comments for user history routes
ExtraShotLatte Nov 6, 2023
f878c26
Add user history to API end points
ExtraShotLatte Nov 6, 2023
d6ee56f
Update question service comment
ExtraShotLatte Nov 6, 2023
d39650c
Add route comments for question-service
ExtraShotLatte Nov 6, 2023
1952fe1
Update API Endpoints
ExtraShotLatte Nov 6, 2023
eb3650c
Add API Documentation for matching-service
ExtraShotLatte Nov 6, 2023
7f0cb5d
Add section headers
ExtraShotLatte Nov 6, 2023
aeb1f07
Add intro
ExtraShotLatte Nov 6, 2023
ed763d2
Add team message
ExtraShotLatte Nov 6, 2023
a3289da
Test logo
ExtraShotLatte Nov 6, 2023
f83cd5b
Test icons
ExtraShotLatte Nov 6, 2023
f0eb154
Select icons for README
ExtraShotLatte Nov 6, 2023
e10969a
Fix JS Icon in README
ExtraShotLatte Nov 6, 2023
e59d86b
Add more logos
ExtraShotLatte Nov 6, 2023
66a48d4
Fix icon
ExtraShotLatte Nov 6, 2023
ac37685
Add icons
ExtraShotLatte Nov 6, 2023
a262526
Remove loggings
ExtraShotLatte Nov 7, 2023
3eebb18
Add comments for clarity
ExtraShotLatte Nov 7, 2023
cc427be
Refactor axios
kalarisng Nov 7, 2023
a1b55fa
Refactor Analytics component
kalarisng Nov 7, 2023
d7737a6
Clean up code
kalarisng Nov 7, 2023
1f5dc76
Merge branch 'master' into branch-refactor-kalaris
kalarisng Nov 7, 2023
7957653
Fix bugs and remove console logs
kalarisng Nov 7, 2023
e92eb4b
Remove unused routes and controller functions for user history
kalarisng Nov 7, 2023
f3ca6d5
Remove console logs in history controller
kalarisng Nov 7, 2023
58cb4ef
Remove unused hooks and functions
kalarisng Nov 7, 2023
c96eb27
Update comments for Profile component
kalarisng Nov 7, 2023
0b8139e
Remove back button unused style declaration in Profile component
kalarisng Nov 7, 2023
2ea7c57
Update README.md to add in code exec
ExtraShotLatte Nov 7, 2023
5cebae4
Update README.md
ExtraShotLatte Nov 7, 2023
9ed431b
Update docs/RunningLocally.md
ExtraShotLatte Nov 7, 2023
ea49cb6
Update docs/RunningOnDocker.md
ExtraShotLatte Nov 7, 2023
423664e
Update docs/RunningOnDocker.md
ExtraShotLatte Nov 7, 2023
2f3ca0f
Update docs/RunningLocally.md
ExtraShotLatte Nov 7, 2023
df68feb
Add comments
ExtraShotLatte Nov 7, 2023
8067e88
Remove unused middleware function
ExtraShotLatte Nov 7, 2023
5685a0e
Enhance docs clarity
ExtraShotLatte Nov 7, 2023
2bd6c9f
Remove unused API routes from APIEndpoints
ExtraShotLatte Nov 7, 2023
f5e7288
Merge branch 'master' into branch-documentation
ExtraShotLatte Nov 7, 2023
ddbc259
Fix middleware
ExtraShotLatte Nov 7, 2023
de61d12
Merge pull request #80 from CS3219-AY2324S1/branch-documentation
IsabelChong Nov 7, 2023
d0e1f67
Merge branch 'master' into branch-usersvc-cleanup
ExtraShotLatte Nov 8, 2023
7448fdf
Remove unused css
ExtraShotLatte Nov 8, 2023
6d330c5
Moved images and css in matching component
ExtraShotLatte Nov 8, 2023
022bb91
Delete unused css
ExtraShotLatte Nov 8, 2023
288f659
Remove unused CSS
ExtraShotLatte Nov 8, 2023
6587766
Refactor file structure
ExtraShotLatte Nov 8, 2023
8db1697
Shift more files
ExtraShotLatte Nov 8, 2023
5e577b9
Update frontend/src/components/Analytics.tsx
kalarisng Nov 9, 2023
c71f1b9
Update frontend/src/components/Analytics.tsx
kalarisng Nov 9, 2023
2f243ba
Update user-service/controllers/history.controller.js
kalarisng Nov 9, 2023
d329d3f
Update user-service/controllers/history.controller.js
kalarisng Nov 9, 2023
89a91cc
Update user-service/controllers/history.controller.js
kalarisng Nov 9, 2023
b7397ea
Update user-service/controllers/history.controller.js
kalarisng Nov 9, 2023
5f54a2f
Update user-service/routes/history.routes.js
kalarisng Nov 9, 2023
0f335b5
Update user-service/routes/history.routes.js
kalarisng Nov 9, 2023
703471a
Merge branch 'master' into branch-refactor-kalaris
kalarisng Nov 9, 2023
2e36169
Fix timer disappearance bug
IsabelChong Nov 9, 2023
2a32022
Merge pull request #84 from CS3219-AY2324S1/branch-matching
Evande1 Nov 9, 2023
ed8d6f6
Merge branch 'master' of https://github.com/CS3219-AY2324S1/ay2324s1-…
angjunkang Nov 9, 2023
60cea51
Add margin bottom to attempted question component
angjunkang Nov 9, 2023
e5f9092
Refactor frontend and change naming conventions
angjunkang Nov 9, 2023
cdc7113
Remove package and package-lock at root
angjunkang Nov 9, 2023
467e5f7
Remove unused code in components
angjunkang Nov 9, 2023
c4db7de
Remove unused code in pages
angjunkang Nov 9, 2023
f7dcce4
Remove unused code in question-service
angjunkang Nov 9, 2023
af6dff1
does not allow null
Evande1 Nov 10, 2023
a4be32f
Merge pull request #85 from CS3219-AY2324S1/branch-sql-fix
angjunkang Nov 10, 2023
392e2aa
Merge pull request #83 from CS3219-AY2324S1/branch-usersvc-cleanup
IsabelChong Nov 10, 2023
013847c
Fix merge conflicts
kalarisng Nov 10, 2023
2f038c2
Remove unused routes
kalarisng Nov 10, 2023
5c0fc9b
Fix bug
kalarisng Nov 10, 2023
065e4e4
Fix attempt newline not shown in history bug
IsabelChong Nov 10, 2023
ac2aac2
Merge pull request #82 from CS3219-AY2324S1/branch-refactor-kalaris
IsabelChong Nov 10, 2023
cff90ff
changes
Evande1 Nov 12, 2023
c2d8328
removed some comments
Evande1 Nov 12, 2023
87306c6
removed comments
Evande1 Nov 12, 2023
788b7f8
nodemon
Evande1 Nov 12, 2023
3d27183
Add nodemon for matching service
angjunkang Nov 12, 2023
48aaa66
Merge pull request #86 from CS3219-AY2324S1/branch-nodemon
ExtraShotLatte Nov 12, 2023
7dcc7bd
Change user history get questions endpoint
kalarisng Nov 12, 2023
1698dd7
Merge pull request #87 from CS3219-AY2324S1/branch-refactor-kalaris
kalarisng Nov 12, 2023
76e6158
Merge branch 'master' of https://github.com/CS3219-AY2324S1/ay2324s1-…
Evande1 Nov 14, 2023
8864482
attached report
Evande1 Nov 14, 2023
3301b01
Merge pull request #88 from CS3219-AY2324S1/code-walkthrough
angjunkang Nov 14, 2023
97861a5
Update package.json
Evande1 Nov 14, 2023
5010a52
Update Dockerfile.prod
Evande1 Nov 14, 2023
6e69263
Final code comment
Evande1 Nov 14, 2023
6d0a9d2
Merge pull request #89 from CS3219-AY2324S1/code-walkthrough
angjunkang Nov 14, 2023
67c70d5
Update Report
Evande1 Nov 15, 2023
3c1d960
Merge branch 'master' of https://github.com/CS3219-AY2324S1/ay2324s1-…
angjunkang Nov 15, 2023
8b630d9
Fix minor grammer changes in the report
angjunkang Nov 15, 2023
f6839aa
Merge pull request #90 from CS3219-AY2324S1/code-walkthrough
angjunkang Nov 15, 2023
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
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
*/node_modules
node_modules
*/.pnp
*.pnp.js

# testing
*/coverage

# production
*/build


gcp-service-account-key.json
# testing prod
# cloudbuild.test.yaml

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

*/.env
.env

gcp-service-account-key.json
Binary file added G06_Report.pdf
Binary file not shown.
99 changes: 98 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,98 @@
# AssignmentTemplate
[![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-24ddc0f5d75046c5622901739e7c5dd533143b0c8e959d652212380cedb1ea36.svg)](https://classroom.github.com/a/6BOvYMwN)

# 👋 Welcome to PeerPrep! 👋

Hello and welcome to the GitHub repository for PeerPrep, a collaborative platform dedicated to empowering and connecting learners from around the globe! This is done by Group G06 for CS3219 in AY23/24 Semester 1!

### What is PeerPrep?
PeerPrep is an innovative platform designed to enhance your learning journey through collaborative preparation. Whether you're gearing up for exams, mastering a new subject, or simply quenching your thirst for knowledge, PeerPrep is here to make the process interactive, effective, and enjoyable.

Check out our deployment of the code on [GCP](https://fe-a2rwifv3ta-dt.a.run.app/)!

---

> **[ IMPORTANT FOR NUS CONNECTIONS!]**\
> If you are connected to the NUS Campus Network (either directly or indirectly), you will not be able to connect to MongoDB Atlas and Google Cloud SQL, which is required by our application. You can circumvent this by going through a VPN.

# Application Installation and Setup

Click for instructions for the respective modes:

- [Running Locally](docs/RunningLocally.md)
- [Running on Docker](docs/RunningOnDocker.md)

# Resources for Developer / Tester

## Software

For development, you may also want to install or subscribe to:

- [Docker Desktop](https://www.docker.com/get-started/)
- [Postman](https://www.postman.com/downloads/)
- [MySQLWorkBench](https://dev.mysql.com/downloads/workbench/)
- [NodeJS](https://nodejs.org/en/download)
- [MySQL](https://dev.mysql.com/downloads/mysql/)
- [OneCompiler on RapidAPI](https://rapidapi.com/onecompiler-onecompiler-default/api/onecompiler-apis/)

## Documentation

- [API Endpoints](docs/APIEndpoints.md)

## Microservices
These are the microservices we defined for our application. Each microservice is a separate folder. You can start individual services separately to test, but there are dependencies among the services, they might not function as expected on it's own.

- [User Service](user-service)
- [Matching Service](matching-service)
- [Question Service](question-service)
- [Frontend](frontend)

To run User-Service
1. `cd user-service`
2. `npm install`
3. `nodemon server.js`

To run Matching-Service
1. `cd matching-service`
2. `npm install`
3. `nodemon server.js`

To run Question-Service
1. `cd question-service`
2. `npm install`
3. `nodemon server.js`

To run Frontend
1. `cd frontend`
2. `npm install`
3. `npm start`

---

<div align="center">
<img width="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/axios.svg"/>
<img width="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/docker-icon.svg"/>
<img width="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/express.svg"/>
<img width="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/google-cloud.svg"/>
<img width="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/google-cloud-functions.svg"/>
<img width="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/google-cloud-run.svg"/>
<img width="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/javascript.svg"/>
<img width="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/jwt-icon.svg"/>
<img width="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/material-ui.svg"/>
<img width="55" height="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/mongodb-icon.svg"/>
<img width="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/mysql-icon.svg"/>
<img width="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/nodejs-icon.svg"/>
<img width="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/nodemon.svg"/>
<img width="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/postman-icon.svg"/>
<img width="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/react.svg"/>
<img width="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/react-router.svg"/>
<img width="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/socket.io.svg"/>
<img width="55" src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/typescript-icon.svg"/>
</div>


---
🌟 Don't forget to star the repo if you find PeerPrep exciting and useful!

Thank you for visiting, and happy coding!

-CS3219 Team G06
89 changes: 89 additions & 0 deletions cloudbuild.test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
steps:
# Build the user-service
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/user-service-test:$COMMIT_SHA',
'-f', './user-service/Dockerfile.prod',
'./user-service']

# Push the user-service image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/user-service-test:$COMMIT_SHA']

# Deploy the user-service to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args: ['run', 'deploy', '${_USR_CLOUD_RUN_NAME}',
'--image', 'gcr.io/$PROJECT_ID/user-service-test:$COMMIT_SHA',
'--region', '${_REGION}',
'--port', '${_USER_PORT}',
"--allow-unauthenticated"
]

# Build the question-service
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/question-service-test:$COMMIT_SHA',
'-f', './question-service/Dockerfile.prod',
'./question-service']

# Push the question-service image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/question-service-test:$COMMIT_SHA']

# Deploy question-service
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args: ['run', 'deploy', '${_QN_CLOUD_RUN_NAME}',
'--image', 'gcr.io/$PROJECT_ID/question-service-test:$COMMIT_SHA',
'--region', '${_REGION}',
'--port', '${_QN_PORT}',
"--allow-unauthenticated"
]

# Build matching-service
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/matching-service-test:$COMMIT_SHA',
'-f', './matching-service/Dockerfile.prod',
'./matching-service']

# Push the matching-service image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/matching-service-test:$COMMIT_SHA']

# Deploy matching-service
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args: ['run', 'deploy', '${_MS_CLOUD_RUN_NAME}',
'--image', 'gcr.io/$PROJECT_ID/matching-service-test:$COMMIT_SHA',
'--region', '${_REGION}',
'--port', '${_MS_PORT}',
"--allow-unauthenticated"
]

# Build the frontend service
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/frontend-service-test:$COMMIT_SHA',
# specifiy which dockerfile to use
'-f', './frontend/Dockerfile.stage',
'./frontend'
]

# Push the frontend-service image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/frontend-service-test:$COMMIT_SHA']

# Deploy frontend-service
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args: ['run', 'deploy', '${_FE_CLOUD_RUN_NAME}',
'--image', 'gcr.io/$PROJECT_ID/frontend-service-test:$COMMIT_SHA',
'--region', '${_REGION}',
'--port', '${_FE_PORT}',
"--allow-unauthenticated"
]

# Images to store in Container Registry
images:
- 'gcr.io/$PROJECT_ID/user-service-test:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/question-service-test:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/matching-service-test:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/frontend-service-test:$COMMIT_SHA'
89 changes: 89 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
steps:
# Build the user-service
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/user-service:$COMMIT_SHA',
'-f', './user-service/Dockerfile.prod',
'./user-service']

# Push the user-service image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/user-service:$COMMIT_SHA']

# Deploy the user-service to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args: ['run', 'deploy', '${_USR_CLOUD_RUN_NAME}',
'--image', 'gcr.io/$PROJECT_ID/user-service:$COMMIT_SHA',
'--region', '${_REGION}',
'--port', '${_USER_PORT}',
"--allow-unauthenticated"
]

# Build the question-service
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/question-service:$COMMIT_SHA',
'-f', './question-service/Dockerfile.prod',
'./question-service']

# Push the question-service image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/question-service:$COMMIT_SHA']

# Deploy question-service
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args: ['run', 'deploy', '${_QN_CLOUD_RUN_NAME}',
'--image', 'gcr.io/$PROJECT_ID/question-service:$COMMIT_SHA',
'--region', '${_REGION}',
'--port', '${_QN_PORT}',
"--allow-unauthenticated"
]

# Build matching-service
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/matching-service:$COMMIT_SHA',
'-f', './matching-service/Dockerfile.prod',
'./matching-service']

# Push the matching-service image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/matching-service:$COMMIT_SHA']

# Deploy matching-service
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args: ['run', 'deploy', '${_MS_CLOUD_RUN_NAME}',
'--image', 'gcr.io/$PROJECT_ID/matching-service:$COMMIT_SHA',
'--region', '${_REGION}',
'--port', '${_MS_PORT}',
"--allow-unauthenticated"
]

# Build the frontend service
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/frontend-service:$COMMIT_SHA',
# specifiy which dockerfile to use
'-f', './frontend/Dockerfile.prod',
'./frontend'
]

# Push the frontend-service image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/frontend-service:$COMMIT_SHA']

# Deploy frontend-service
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args: ['run', 'deploy', '${_FE_CLOUD_RUN_NAME}',
'--image', 'gcr.io/$PROJECT_ID/frontend-service:$COMMIT_SHA',
'--region', '${_REGION}',
'--port', '${_FE_PORT}',
"--allow-unauthenticated"
]

# Images to store in Container Registry
images:
- 'gcr.io/$PROJECT_ID/user-service:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/question-service:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/matching-service:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/frontend-service:$COMMIT_SHA'
1 change: 0 additions & 1 deletion css/styles.css

This file was deleted.

71 changes: 71 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
version: "3"

services:
user-service:
build:
context: ./user-service
environment:
- USR_SVC_PORT=${USR_SVC_PORT}
- SQL_HOST=${SQL_HOST}
- SQL_USERNAME=${SQL_USERNAME}
- SQL_PASSWORD=${SQL_PASSWORD}
- JWT_SECRET=${JWT_SECRET}
ports:
- 3003:3003
networks:
- service

question-service:
build:
context: ./question-service
environment:
- USR_SVC_AUTH=http://user-service:3003/api/auth
- QNS_SVC_PORT=${QNS_SVC_PORT}
- MONGO_HOST=${MONGO_HOST}
- MONGO_USERNAME=${MONGO_USERNAME}
- MONGO_PASSWORD=${MONGO_PASSWORD}
ports:
- 3000:3000
depends_on:
- user-service
networks:
- service

matching-service:
build:
context: ./matching-service
environment:
- QNS_SVC=http://question-service:3000/api/questions
- USR_SVC_AUTH=http://user-service:3003/api/auth
- MTC_SVC_PORT=${MTC_SVC_PORT}
- JWT_SECRET=${JWT_SECRET}
- CDEX_KEY=${CDEX_KEY}
- CDEX_HOST=${CDEX_HOST}
ports:
- 3002:3002
depends_on:
- user-service
- question-service
networks:
- service

frontend:
build:
context: ./frontend
ports:
- 3001:3001
environment:
- REACT_APP_QNS_SVC=http://localhost:3000/api/questions
- REACT_APP_MTC_SVC=http://localhost:3002
- REACT_APP_USR_SVC_HIST=http://localhost:3003/api/hist
- REACT_APP_USR_SVC_AUTH=http://localhost:3003/api/auth
- REACT_APP_USR_SVC_USER=http://localhost:3003/api/user
depends_on:
- user-service
- question-service
- matching-service
networks:
- service
networks:
service:
driver: bridge
Loading