Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
202 commits
Select commit Hold shift + click to select a range
42db0c0
Setting up GitHub Classroom Feedback
github-classroom[bot] Aug 26, 2022
410787b
add gitignore
Moley456 Sep 1, 2022
713ae85
complete FR2.2 and FR2.3
tenebrius1 Sep 5, 2022
eec9e28
implement features to fulfill FR 1.2 and FR 1.3
Moley456 Sep 5, 2022
9c520d5
feat: barebones dashboard page
kheekheekhee Sep 9, 2022
44c3473
update repository.js to be responsible for initializing database
tenebrius1 Sep 9, 2022
7278853
update socket to emit matchsuccess or matchfail
tenebrius1 Sep 10, 2022
059e51f
fix alignment issue with coding page
kheekheekhee Sep 11, 2022
2fa9743
add gitignore for user-service and frontend
Moley456 Sep 12, 2022
4291e38
update frontend .gitignore
Moley456 Sep 12, 2022
555aae2
add logout and account deletion routes and functionality
Moley456 Sep 12, 2022
deac3b9
configure socket.io cors
tenebrius1 Sep 13, 2022
b527095
Create add-to-project.yml
kheekheekhee Sep 14, 2022
d29209b
Update add-to-project.yml
kheekheekhee Sep 14, 2022
1becec7
refactor: move business logic from user-controller to user-orm
Moley456 Sep 15, 2022
34a6b4a
refactor authorization code from index.js into user-orm.js
Moley456 Sep 15, 2022
e2848ba
complete FR 1.6: add change password function
Moley456 Sep 19, 2022
9267051
refactor regular functions to arrow functions
Moley456 Sep 19, 2022
08f0bed
clean up code
Moley456 Sep 19, 2022
17d145f
Merge pull request #3 from tenebrius1/main
Moley456 Sep 19, 2022
6ef30ae
fix merge conflicts
kheekheekhee Sep 19, 2022
29b39b7
Add matching page for frontend
tsinyee Sep 19, 2022
ff27044
Implement password hashing for user-service
tsinyee Sep 19, 2022
434dc2a
Update user-orm.js
tsinyee Sep 19, 2022
96c175d
Merge pull request #40 from tsinyee/main
Moley456 Sep 19, 2022
1e89536
add status above countdown timer in matching page
tsinyee Sep 19, 2022
965afe7
Merge branch 'main' of https://github.com/tsinyee/cs3219-project-ay22…
tsinyee Sep 19, 2022
2d831d4
chore: resolve merge conflicts
kheekheekhee Sep 19, 2022
6a4f80c
Merge pull request #43 from tsinyee/main
tsinyee Sep 19, 2022
cee57f5
Merge pull request #41 from kheekheekhee/main
Moley456 Sep 19, 2022
111d3f4
fix matching page layout issues
tsinyee Sep 19, 2022
6159566
Merge branch 'main' of upstream
Moley456 Sep 19, 2022
dd1cf3e
feat: integrate use of salted and hashed passwords for user actions
Moley456 Sep 20, 2022
3a025b4
Merge pull request #42 from Moley456/main
Moley456 Sep 20, 2022
93690ed
chore: delete add-to-project.yaml
kheekheekhee Sep 20, 2022
65bc358
fix merge conflicts
tsinyee Sep 20, 2022
4ee9c85
Merge pull request #44 from tsinyee/main
tsinyee Sep 20, 2022
db81718
fix minor styling issues
tenebrius1 Sep 20, 2022
f67d922
emit 'match' event every second and 'matchCancel' event when user can…
tsinyee Sep 20, 2022
5b0fbfa
Route practise button to matching page
tsinyee Sep 20, 2022
82952fb
dockerize application
tenebrius1 Sep 20, 2022
e0bcbcb
update files to use arrow functions
tenebrius1 Sep 23, 2022
142fbcd
update backend to allow matching cancellation
tenebrius1 Sep 23, 2022
4d57f41
delete user after 30s timeout
tenebrius1 Sep 24, 2022
1b0afef
feat: add required "email" field to user account creation
Moley456 Sep 30, 2022
b1ad80e
feat: implement password reset via email
Moley456 Oct 1, 2022
2dc88a6
fix: hash and salt passwords when changing passwords
Moley456 Oct 1, 2022
60b39f0
Merge branch 'main' into user-service
Moley456 Oct 1, 2022
8500d3d
Refactor styling for matching page
tsinyee Oct 6, 2022
8fc8867
Remove firing of match event every second
tsinyee Oct 6, 2022
97fc9a5
Merge pull request #50 from Moley456/user-service
kheekheekhee Oct 6, 2022
1e99af2
Merge pull request #46 from tenebrius1/docker
Moley456 Oct 6, 2022
b7f91a1
feat: add judge0 integration and prevent practising without selecting…
kheekheekhee Oct 6, 2022
5b6b8f0
chore: fix merge conflicts in MatchingPage
kheekheekhee Oct 6, 2022
4463aa4
Merge pull request #49 from tenebrius1/matching
Moley456 Oct 7, 2022
51aa375
Merge pull request #51 from tsinyee/main
Moley456 Oct 7, 2022
cb946b1
set up question service
tenebrius1 Oct 8, 2022
5c96e65
chore: resolve merge conflicts
kheekheekhee Oct 10, 2022
c099bde
feat: add user and difficulty contexts
kheekheekhee Oct 10, 2022
90417b3
fix issue with CORS and setting client cookies
Moley456 Oct 11, 2022
303212a
Merge pull request #55 from Moley456/main
Moley456 Oct 11, 2022
0f1536c
feat: add private routes to non-login or signup pages
kheekheekhee Oct 12, 2022
cd56080
chore: fix merge conflicts
kheekheekhee Oct 12, 2022
9584c03
Merge pull request #52 from kheekheekhee/main
Moley456 Oct 12, 2022
d6e2647
feat: coding-service set up
Moley456 Oct 12, 2022
33f0529
Merge branch 'main' into dev
Moley456 Oct 12, 2022
8795b56
Merge pull request #56 from CS3219-AY2223S1/dev
Moley456 Oct 12, 2022
930573d
Merge branch 'main' into coding-service
Moley456 Oct 12, 2022
85e8f3e
fix: resolve conflicts
Moley456 Oct 12, 2022
22b7cf6
feat: add private routes
kheekheekhee Oct 12, 2022
61ce8d5
chore: resolve merge conflicts
kheekheekhee Oct 12, 2022
75bc2a3
Merge pull request #57 from kheekheekhee/main
Moley456 Oct 12, 2022
853faa3
feat: set up sockets for code collaboration
Moley456 Oct 12, 2022
ca5dfb4
Merge branch 'main' into coding-service
Moley456 Oct 12, 2022
27be429
fix private routes and sign in page functionality
Moley456 Oct 13, 2022
9a01249
feat: integrate dashboard with matching service backend
Moley456 Oct 13, 2022
bd91959
Merge pull request #58 from Moley456/coding-service
Moley456 Oct 13, 2022
f938c5d
fix dockerizing of application; dockerize coding-service
Moley456 Oct 13, 2022
53198ce
Merge pull request #59 from Moley456/coding-service
Moley456 Oct 13, 2022
aca57f6
remove firing of match event every second
tsinyee Oct 14, 2022
491a468
feat: integrate logout
kheekheekhee Oct 14, 2022
891fb2f
[chore] matching: emit message success to both users
tenebrius1 Oct 14, 2022
58fb34d
Merge branch 'main' of https://github.com/CS3219-AY2223S1/cs3219-proj…
tenebrius1 Oct 14, 2022
5455916
chore: resolve merge conflicts
kheekheekhee Oct 14, 2022
5d7f7b4
edit matching page and dashboard to match changes in matching service
tsinyee Oct 14, 2022
1ac67cc
Merge pull request #61 from tsinyee/main
tenebrius1 Oct 14, 2022
2646e30
Merge pull request #60 from tenebrius1/matching
tsinyee Oct 14, 2022
3e2f19b
feat: add logout feature
kheekheekhee Oct 14, 2022
a2782ea
feat: add logout feature
kheekheekhee Oct 14, 2022
d1e779d
Merge branch 'main' of https://github.com/CS3219-AY2223S1/cs3219-proj…
kheekheekhee Oct 14, 2022
523a595
chore: pull updated code
kheekheekhee Oct 14, 2022
671fefd
chore: fix file path conflict
kheekheekhee Oct 14, 2022
fc6b274
Merge pull request #62 from kheekheekhee/main
Moley456 Oct 14, 2022
e2542f5
emit matchfail after 30s timeout
tsinyee Oct 14, 2022
0f05383
Merge branch 'main' of https://github.com/CS3219-AY2223S1/cs3219-proj…
tsinyee Oct 14, 2022
eec0fd8
Merge pull request #63 from tsinyee/main
Moley456 Oct 14, 2022
b1850ff
Merge branch 'main' of https://github.com/tenebrius1/cs3219-project-a…
tenebrius1 Oct 14, 2022
9feb712
feat: complete code collaboration on coding page
Moley456 Oct 14, 2022
52114a8
[chore](question-service) dockerize question service
tenebrius1 Oct 17, 2022
04bfc61
set up video service
tsinyee Oct 17, 2022
bcfd293
Add frontend logic for video calling
tsinyee Oct 17, 2022
15d3382
Fix VideoCall bug
tsinyee Oct 31, 2022
86e2c47
Merge pull request #64 from Moley456/coding-service
Moley456 Nov 2, 2022
e283c6c
Merge pull request #53 from tenebrius1/question
Moley456 Nov 2, 2022
b435dff
Merge pull request #65 from tsinyee/main
Moley456 Nov 2, 2022
6d4e237
add and use middleware to authenticate jwt token in user service
Moley456 Nov 2, 2022
4f3113e
Merge pull request #66 from Moley456/user-service
Moley456 Nov 2, 2022
be9badc
feat: add profile page
kheekheekhee Nov 3, 2022
9fde1cb
chore: resolve merge conflicts
kheekheekhee Nov 3, 2022
7368127
feat: add route to sign up page from sign in
kheekheekhee Nov 3, 2022
c247881
add api gateway
Moley456 Nov 3, 2022
0662db8
Merge pull request #67 from kheekheekhee/main
Moley456 Nov 3, 2022
68b8c0a
Merge branch 'main' into gateway
Moley456 Nov 3, 2022
47ffc9a
set up docker for api gateway
Moley456 Nov 4, 2022
86b95c9
clean up code
Moley456 Nov 4, 2022
eed78ac
Merge pull request #68 from Moley456/gateway
Moley456 Nov 4, 2022
6b01021
integrate image hosting into user service
Moley456 Nov 4, 2022
c85788a
refactor AuthContext into UserContext and auth API
Moley456 Nov 4, 2022
a043360
integrate profile image upload backend with frontend
Moley456 Nov 4, 2022
e889a38
remove batch mui component imports
Moley456 Nov 4, 2022
bf316d4
fix and complete password change functionality
Moley456 Nov 4, 2022
a36bc32
implement user service route to remove profile picture
Moley456 Nov 4, 2022
c0729d0
integrate profile picture removal with frontend
Moley456 Nov 4, 2022
2ad5b88
feat: minor update of sign in and sign up page
kheekheekhee Nov 5, 2022
ef44fd9
Merge branch 'main' of https://github.com/CS3219-AY2223S1/cs3219-proj…
kheekheekhee Nov 5, 2022
f00965a
feat: create password reset page
kheekheekhee Nov 5, 2022
ec38736
feat: add history page
kheekheekhee Nov 5, 2022
07e8eba
implement delete account feature
Moley456 Nov 5, 2022
8957d3a
users logout after account deletion passes
Moley456 Nov 5, 2022
5006241
Merge pull request #71 from kheekheekhee/main
Moley456 Nov 5, 2022
03eca2e
Merge branch 'main' into user-service
Moley456 Nov 5, 2022
3d8ee6b
Merge pull request #69 from Moley456/user-service
Moley456 Nov 5, 2022
f6f6537
feat: add delete account modal
kheekheekhee Nov 5, 2022
f596f2b
chore: remove morgan to prevent unnecessary logging
kheekheekhee Nov 5, 2022
df085cd
chore: remove morgan to prevent unnecessary logging
kheekheekhee Nov 5, 2022
0aa21d3
chore: remove morgan to prevent unnecessary logging
kheekheekhee Nov 5, 2022
1877332
implement password reset feature
Moley456 Nov 5, 2022
5985db6
chore: resolve merge conflicts in frontend
kheekheekhee Nov 5, 2022
8f1abfa
chore: resolve merge conflicts
kheekheekhee Nov 5, 2022
3aee9c7
fix authentication in api gateway when dockerized
Moley456 Nov 6, 2022
20d1fc9
complete history backend
tenebrius1 Nov 6, 2022
132015e
update docker-compose
tenebrius1 Nov 6, 2022
41f5235
Add dockerfile for video service
tsinyee Nov 6, 2022
79eac06
Merge pull request #72 from tenebrius1/history
Moley456 Nov 6, 2022
00f6811
Merge pull request #73 from Moley456/user-service
Moley456 Nov 6, 2022
45a74a6
initial set up
tenebrius1 Nov 6, 2022
5c0fd33
Merge remote-tracking branch 'origin/main' into deployment
tenebrius1 Nov 6, 2022
9d421cc
shift judge0 calls into coding service
Moley456 Nov 6, 2022
1ef040d
integrate judge0's docker compose into project's docker compose
Moley456 Nov 6, 2022
888cfc7
set up deployment
tenebrius1 Nov 6, 2022
febe206
update docker-compose for local deployment
tenebrius1 Nov 6, 2022
4c3bcfa
feat: link history page with dashboard
kheekheekhee Nov 6, 2022
29f8beb
chore: resolve merge conflicts
kheekheekhee Nov 6, 2022
b186851
feat: ui changes for profile page
kheekheekhee Nov 6, 2022
1d636db
Merge remote-tracking branch 'upstream/main'
tsinyee Nov 7, 2022
3688a8b
update docker compose
Moley456 Nov 7, 2022
eaf7bc2
update localhost to live site
tenebrius1 Nov 7, 2022
e79e196
integrate video
tsinyee Nov 7, 2022
97e6785
integrate automerge
Moley456 Nov 7, 2022
2e2e74e
Merge pull request #74 from tenebrius1/deployment
Moley456 Nov 7, 2022
8621679
Merge branch 'main' into main
Moley456 Nov 7, 2022
fda0675
Merge pull request #75 from kheekheekhee/main
Moley456 Nov 7, 2022
8e3febc
feat: integrate get history service with frontend
kheekheekhee Nov 7, 2022
3ebf5be
chore: resolve merge conflict
kheekheekhee Nov 7, 2022
cb5ede9
Merge branch 'main' into coding-service
Moley456 Nov 7, 2022
65723a1
Merge pull request #76 from Moley456/coding-service
Moley456 Nov 7, 2022
da8a9c3
Merge branch 'main' of https://github.com/CS3219-AY2223S1/cs3219-proj…
kheekheekhee Nov 7, 2022
8a4e498
feat: integrate question service with frontend and password strength …
kheekheekhee Nov 7, 2022
d92f382
feat: change matching page to a modal
kheekheekhee Nov 7, 2022
1fc0b8b
feat: fix bug where countdown timer still runs in the background afte…
kheekheekhee Nov 8, 2022
145c4eb
feat: add logo
kheekheekhee Nov 8, 2022
783cf55
feat: add loading page
kheekheekhee Nov 8, 2022
30bf981
set up room service backend
Moley456 Nov 8, 2022
2a12d2a
update api gateway to proxy room service
Moley456 Nov 8, 2022
8920ed6
feat: ui changes for all pages
kheekheekhee Nov 8, 2022
c0ba10b
integrate room service
Moley456 Nov 8, 2022
36f7e9a
Merge pull request #77 from kheekheekhee/main
Moley456 Nov 8, 2022
a24ef5e
Merge branch 'main' into room-service
Moley456 Nov 8, 2022
0f68147
Complete video chat service and integrate into coding page
tsinyee Nov 8, 2022
c9d4106
Merge branch 'video'
tsinyee Nov 8, 2022
8a65585
Merge branch 'main' of https://github.com/CS3219-AY2223S1/cs3219-proj…
tsinyee Nov 8, 2022
35ea168
fix bug
tsinyee Nov 8, 2022
b85a601
Fix errors in syntax
tsinyee Nov 8, 2022
5fa3346
Add loading spinner to coding page when fetching questions
tsinyee Nov 8, 2022
bf3bd77
feat: improve ui in dashboard
kheekheekhee Nov 8, 2022
e3fd80c
Merge branch 'main' of https://github.com/CS3219-AY2223S1/cs3219-proj…
kheekheekhee Nov 8, 2022
dee1532
Merge pull request #78 from tsinyee/main
kheekheekhee Nov 8, 2022
069cc53
Merge branch 'main' of https://github.com/CS3219-AY2223S1/cs3219-proj…
kheekheekhee Nov 8, 2022
c936eeb
feat: resolve unique key errors in history and coding pages
kheekheekhee Nov 8, 2022
5171371
partially integrate room service
Moley456 Nov 8, 2022
e7298cd
Merge pull request #79 from kheekheekhee/main
kheekheekhee Nov 9, 2022
98d24d6
Update README.md
tenebrius1 Nov 9, 2022
dfb0bfa
checkpoint
Moley456 Nov 9, 2022
1a1d160
remove reconnect on refresh
Moley456 Nov 9, 2022
5c5bd68
Add files via upload
kheekheekhee Nov 9, 2022
9eef510
Merge branch 'main' into room-service
Moley456 Nov 9, 2022
9a678da
clean up code
Moley456 Nov 9, 2022
45d657f
finalise docker and clean up
Moley456 Nov 9, 2022
0fdbb2f
styling changes and final changes
Moley456 Nov 9, 2022
a1a2606
Merge pull request #80 from Moley456/room-service
Moley456 Nov 9, 2022
750c28f
docker change
Moley456 Nov 9, 2022
20cc6f0
Merge pull request #81 from Moley456/room-service
Moley456 Nov 9, 2022
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
npm-debug.log
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
*/.env
*.sqlite
.vscode
build
Binary file added 15-ProjectReport.pdf
Binary file not shown.
37 changes: 26 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
# CS3219-AY22-23-Project-Skeleton
# PeerPrep

This is a template repository for CS3219 project.
## Overview
PeerPrep is an application designed for programmers to find like-minded individuals to practice technical questions with. It mimics a typical technical interview format where you can perform both the role of an interviewer and interviewee, receive feedbacks and voice out your thoughts in realtime using voice or video.

## User Service
1. Rename `.env.sample` file to `.env`.
2. Create a Cloud DB URL using Mongo Atlas.
3. Enter the DB URL created as `DB_CLOUD_URI` in `.env` file.
4. Install npm packages using `npm i`.
5. Run User Service using `npm run dev`.
## Team Members
The team consists of the following members:
- [Ong Xing Wei](https://github.com/Moley456)
- [Ee Kar Hee, Nicholas](https://github.com/kheekheekhee)
- [Tan Yi Guan](https://github.com/tenebrius1)
- [Teo Sin Yee](https://github.com/tsinyee)

## Frontend
1. Install npm packages using `npm i`.
2. Run Frontend using `npm start`.
## Dependencies
### Node.js
This project uses Node.js 16 which could be downloaded from their [official website](https://nodejs.org/en/).

### Docker
Deployment of the local dev environment is achieved using Docker and Docker Compose.

## Contributing to PeerPrep
### Installation
First, clone this repository:
```
git clone https://github.com/CS3219-AY2223S1/cs3219-project-ay2223s1-g15.git
```
Since this project follows a microservice architecture, you can choose to work on any of the services we developed by navigating to `root/<service>` and running `npm install`.

### Docker-compose
To get a locally deployed version of the app running, you can run the command `docker-compose -f docker-compose-dev.yml up --build -d`
2 changes: 2 additions & 0 deletions api-gateway/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
npm-debug.log
104 changes: 104 additions & 0 deletions api-gateway/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
9 changes: 9 additions & 0 deletions api-gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:16-alpine

WORKDIR /app

COPY . /app/

RUN npm install

CMD ["npm", "run", "start"]
42 changes: 42 additions & 0 deletions api-gateway/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import express from 'express';
import cors from 'cors';
// import morgan from "morgan";
import cookieParser from 'cookie-parser';
import 'dotenv/config';
import {
userProxy,
matchingProxy,
codingProxy,
videoProxy,
questionProxy,
historyProxy,
roomProxy,
} from './proxy.js';
import authenticate from './middleware/auth.js';

const app = express();
const LIVE_URL =
process.env.ENV === 'PROD' ? process.env.LIVE_URL : 'http://localhost:3000';
app.use(
cors({
// replace with deployed endpoint
origin: LIVE_URL,
credentials: true,
})
); // config cors so that front-end can use
app.options('*', cors());
app.use(cookieParser());
// app.use(morgan('combined'));

app.use('/user', userProxy);
app.use(matchingProxy);
app.use(codingProxy);
app.use(roomProxy);

app.use('/video', authenticate, videoProxy);
app.use('/question', authenticate, questionProxy);
app.use('/history', authenticate, historyProxy);

const server = app.listen(8080, () => {
console.log('api gateway running on port 8080');
});
21 changes: 21 additions & 0 deletions api-gateway/middleware/auth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import axios from 'axios';

export const authenticate = async (req, res, next) => {
const { token } = req.cookies;
if (!token) {
console.log(req);
return res.status(401).json({ message: 'Missing JWT token' });
}
await axios
.get(process.env.USER_URL + '/user/checkAuth', {
headers: { Cookie: `token=${token}` },
})
.then((resp) => {
next();
})
.catch((err) => {
return res.status(401).json({ message: 'JWT token authentication failed' });
});
};

export default authenticate;
Loading