Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
87d5f10
Setting up GitHub Classroom Feedback
github-classroom[bot] Aug 24, 2022
b8ac5e9
Initial project setup
oeiyiping Sep 11, 2022
7eb0e20
Implement existing user check when attempting creation of new user
oeiyiping Sep 11, 2022
aef91c1
Implement use of bcrypt to use hashed password when creating users
oeiyiping Sep 11, 2022
1e06d84
Implement use of bcrypt to use hashed password when creating users
oeiyiping Sep 11, 2022
4758a2e
Merge branch 'feature/user-service-mvp' of https://github.com/CS3219-…
oeiyiping Sep 11, 2022
f85c651
Implement backend login functionality
oeiyiping Sep 11, 2022
5fc0f30
Abstract password hashing into utility function
oeiyiping Sep 11, 2022
2f22ddd
Modify the existing user check method to return the user object instead
oeiyiping Sep 11, 2022
16dd865
Implement user password change feature
oeiyiping Sep 11, 2022
f716c52
Implement user password change feature
oeiyiping Sep 11, 2022
45852ee
Merge branch 'feature/user-service-mvp' of https://github.com/CS3219-…
oeiyiping Sep 11, 2022
4d993a0
Implement delete user feature
oeiyiping Sep 11, 2022
ac74fb7
Implement new utility functions for auth tokens
oeiyiping Sep 12, 2022
89e936b
Update change user password and delete user endpoints to use auth token
oeiyiping Sep 12, 2022
d444081
[FR 2.1] Add select difficulty page
BenedictBCJJ Sep 12, 2022
b097771
Add feature to blacklist tokens
oeiyiping Sep 12, 2022
76f3a83
Add feature for user logout
oeiyiping Sep 12, 2022
42f801a
Add socket.io to index.js
BenedictBCJJ Sep 12, 2022
92e51ed
Create match request orm and model
BenedictBCJJ Sep 12, 2022
4b7e924
Add match call for socket.io
BenedictBCJJ Sep 12, 2022
b348d03
Update git ignore
BenedictBCJJ Sep 12, 2022
88c97b2
Handle json request for match
BenedictBCJJ Sep 12, 2022
4a28160
FR[2.2] Add matching service with mongoDB for same difficulty
BenedictBCJJ Sep 12, 2022
30fe442
Add matching page to index
BenedictBCJJ Sep 12, 2022
f17a01d
[FR 2.3] Integrate matching with frontend
BenedictBCJJ Sep 12, 2022
e4d7855
[FR 2.5] Add functionality to delete match request after 30 seconds o…
BenedictBCJJ Sep 12, 2022
615ea35
[FR 2.6] Add button to go home from matching page
BenedictBCJJ Sep 12, 2022
ad1ba14
Add navigations in matching service
jacetjy Sep 27, 2022
4d0da18
Create login and signup screens
rgabelarde Sep 28, 2022
bc04abc
Add interim homepage
rgabelarde Sep 28, 2022
29b68a4
Add completed Login and Signup page
rgabelarde Sep 28, 2022
24ca46a
Add cookies to backend
rgabelarde Sep 28, 2022
5579d25
Add cookie parser in backend for jwt
rgabelarde Sep 28, 2022
ef75b87
Merge branch 'matching-service-mvp' into integrated-mvp
rgabelarde Sep 28, 2022
56787cb
Fix merging errors
rgabelarde Sep 28, 2022
691b0ae
Integrate frontend
rgabelarde Sep 28, 2022
f52a5fa
Remove jwt route
rgabelarde Sep 28, 2022
3f5ead0
Update SelectDifficultyPage.js
rgabelarde Sep 28, 2022
e5f651a
Initial commit
oeiyiping Oct 15, 2022
5f6e092
Implement question service controller
oeiyiping Oct 15, 2022
12b35e9
Implement question model
oeiyiping Oct 15, 2022
4ef4bba
Implement question service repository
oeiyiping Oct 15, 2022
b790d71
Implement question service server index
oeiyiping Oct 15, 2022
d78ee75
Update random question poll logic
oeiyiping Oct 15, 2022
08d49ed
Implement question database population logic
oeiyiping Oct 15, 2022
3cd8bc8
Add script for populating db
oeiyiping Oct 15, 2022
308ff8b
Add brief documentation
oeiyiping Oct 18, 2022
feee01b
Implement and use middleware for error handling
oeiyiping Oct 18, 2022
99c94c6
Update README.md
oeiyiping Oct 18, 2022
da68056
Update README.md
oeiyiping Oct 18, 2022
61e59cd
Add basic integration for MS1
rgabelarde Oct 20, 2022
4bf230a
Add account menu component
rgabelarde Oct 20, 2022
d8ef975
Add account menu to screens
rgabelarde Oct 20, 2022
2ce7cc9
Update account menu icon
rgabelarde Oct 20, 2022
19d421a
Update Logo
rgabelarde Oct 20, 2022
fe39930
Amend folder structures
rgabelarde Oct 20, 2022
076a096
Add top nav bar
rgabelarde Oct 20, 2022
17107f6
Add account screens
rgabelarde Oct 20, 2022
2b9bdc7
Fix merging issues
rgabelarde Oct 21, 2022
f6c8f7a
Add cors config to socket.io config
oeiyiping Oct 21, 2022
4a07ec1
Fully linked front to back
jacetjy Oct 21, 2022
66ade4d
Fix logout using native fetch
rgabelarde Oct 30, 2022
442be12
Add error for logout
rgabelarde Oct 30, 2022
97c7db0
Amend account edits
rgabelarde Oct 30, 2022
d5c0a24
Initial commit
oeiyiping Nov 4, 2022
7ae3e1c
Add history mongoose schema
oeiyiping Nov 4, 2022
2b5cd43
Add DB object CRUD methods as repository methods
oeiyiping Nov 4, 2022
ca573d5
Add request/response handling logic
oeiyiping Nov 4, 2022
f5f264d
Add error handling middlewarees
oeiyiping Nov 4, 2022
2f77f22
Implement index.js and add npm scripts
oeiyiping Nov 4, 2022
a254db2
Update history model
oeiyiping Nov 4, 2022
cc15f0a
Add basic documentation to history service readme
oeiyiping Nov 5, 2022
2275061
Update DB history fetch to return records sorted by date in descendin…
oeiyiping Nov 5, 2022
f9c3dde
Remove topic as a filter for get random question, and update get requ…
oeiyiping Nov 5, 2022
c209787
Update question readme in accordance to updated implementation, and w…
oeiyiping Nov 5, 2022
ee1b956
Add chat service v1.0
BenedictBCJJ Nov 5, 2022
7b79347
Merge branch 'integrated-mvp-2' of github.com:CS3219-AY2223S1/cs3219-…
BenedictBCJJ Nov 5, 2022
e1a7283
Update to yjs for collab textbox
BenedictBCJJ Nov 6, 2022
dab6911
Integrate chatroom to matchedpage
jacetjy Nov 6, 2022
7b87631
Run chat service
jacetjy Nov 6, 2022
fdc5ca2
Merge branch 'history-service-backend' into integrate-history-chat-se…
jacetjy Nov 6, 2022
98c9f29
Add history to user settings
jacetjy Nov 6, 2022
2d8fcbc
Missing commit
jacetjy Nov 6, 2022
560f70e
Merge question service in
jacetjy Nov 7, 2022
3515c87
Emit roomID in matching service
jacetjy Nov 7, 2022
5b20dc3
Changed readme
jacetjy Nov 8, 2022
ac9fe23
Update create history to use userId instead of username for "user" field
oeiyiping Nov 8, 2022
3baf734
Merge branch 'integrate-history-chat-services' of https://github.com/…
oeiyiping Nov 8, 2022
c99a917
Make random question tally for both users
oeiyiping Nov 8, 2022
946827a
Update question seeding logic
oeiyiping Nov 8, 2022
50ab2ad
Update TPage to fetch random question of specified difficulty
oeiyiping Nov 8, 2022
0e48017
Reorganise matching service to use it's own code base
BenedictBCJJ Nov 8, 2022
9af024a
Merge branch 'integrate-history-chat-services' of github.com:CS3219-A…
BenedictBCJJ Nov 8, 2022
0b3f167
Update frontend history to fetch only the logged in user's history
oeiyiping Nov 8, 2022
414348a
Merge branch 'integrate-history-chat-services' of https://github.com/…
oeiyiping Nov 8, 2022
425e401
Fix chatroom and collab text box for 2 rooms
BenedictBCJJ Nov 8, 2022
d2753ba
Merge branch 'integrate-history-chat-services' of github.com:CS3219-A…
BenedictBCJJ Nov 8, 2022
3eaae18
Update readme for history service and question service
oeiyiping Nov 8, 2022
9a55d3d
Frontend fix
rgabelarde Nov 8, 2022
21b09da
Add page not found if not authenticated user
jacetjy Nov 8, 2022
2035bce
Updated all pages to reflect page not found
jacetjy Nov 8, 2022
88a4779
Update matching page
jacetjy Nov 8, 2022
4fe110b
Revamp UI of user auth screen
rgabelarde Nov 8, 2022
c0f6b76
Add route for updated user auth
rgabelarde Nov 8, 2022
e8dffff
Add matching timeout/errors dialogs
rgabelarde Nov 8, 2022
fd26e4c
Add more minor UI changes
rgabelarde Nov 8, 2022
c9664f6
Add up more UI stuff
rgabelarde Nov 8, 2022
1486c77
Merge branch 'integrate-history-chat-services' into ui-work
rgabelarde Nov 8, 2022
5fec210
bugfix for random question tally
oeiyiping Nov 9, 2022
9126ba6
Resolve import not working
jacetjy Nov 9, 2022
fcaf413
Merge pull request #3 from CS3219-AY2223S1/integrate-history-chat-ser…
jacetjy Nov 9, 2022
d719367
Fix select difficulty bug
oeiyiping Nov 9, 2022
44b2f54
Add docker files for local docker deployment
oeiyiping Nov 9, 2022
2c3a67a
Update program readme
oeiyiping Nov 9, 2022
f7af760
Merge pull request #4 from CS3219-AY2223S1/integrate-history-chat-ser…
oeiyiping Nov 9, 2022
94353d1
Fix button onsubmit reload bug
oeiyiping Nov 9, 2022
a9e1d40
Merge branch 'main' into ui-work
oeiyiping Nov 9, 2022
2af5fbe
Fix fetch question bug
oeiyiping Nov 9, 2022
0a95b06
Fix auth methods request bugs
oeiyiping Nov 9, 2022
3387f27
Merge pull request #5 from CS3219-AY2223S1/fix-auth-methods
oeiyiping Nov 9, 2022
d410878
Remove irrelevant implementation
oeiyiping Nov 9, 2022
964b9d7
Update readme
oeiyiping Nov 9, 2022
028e5d2
Merge pull request #6 from CS3219-AY2223S1/bug-fixes
oeiyiping Nov 9, 2022
2fc71ac
All force start for frontend if facing legacy issues
rgabelarde Nov 9, 2022
e9cf845
Update README.md
rgabelarde Nov 9, 2022
797c170
Add cookie expiration in 24h
rgabelarde Nov 9, 2022
f869dd8
Merge branch 'main' of https://github.com/CS3219-AY2223S1/cs3219-proj…
rgabelarde Nov 9, 2022
5c0316b
Add final report file
jacetjy 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
Binary file added .DS_Store
Binary file not shown.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<<<<<<< HEAD
chatting-service/client/node_modules/
chatting-service/server/node_modules/.bin/nodemon
chatting-service/server/node_modules/
frontend/node_modules/
matching-service/node_modules/@socket.io/component-emitter/index.d.ts
matching-service/node_modules/
=======
matching-service/node_modules/
frontend/node_modules/
>>>>>>> 97c7db0f44bc18632338897b84defb5736db0247
user-service/node_modules/
node_modules/
3 changes: 3 additions & 0 deletions .vs/ProjectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CurrentProjectSetting": null
}
10 changes: 10 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"ExpandedNodes": [
"",
"\\frontend",
"\\frontend\\src",
"\\matching-service"
],
"SelectedNode": "\\frontend\\src\\App.js",
"PreviewInSolutionExplorer": false
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
Binary file added 32-FinalReport.pdf
Binary file not shown.
55 changes: 48 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,55 @@
# CS3219-AY22-23-Project-Skeleton
# CS3219-AY22-23-Project

This is a template repository for CS3219 project.
CS3219 Project By Team 32.

## User Service
Program initialisation can be done either via Docker local deployment of manually.

## Initialisation by Docker Local Deployment (Docker Compose)
1. Open a terminal in this directory, and run the following command:
`docker compose -f "docker-compose.yml" up -d --build`
2. Wait for all Docker images to run.
3. Access the service via `http://localhost:3000`.

## Manual Initialisation
### 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.
3. Enter your secret string of choice created as `SECRETS` in `.env` file.
4. Install npm packages using `npm i`.
5. Run the service using `npm start`.

### Matching 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 the service using `npm start`.

### Question 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. Populate the question database with preset data using `npm run populate-db`
6. Run the service using `npm start`.

### History 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 the service using `npm start`.

### Chatting 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`.
5. Run the service using `npm start`.

## Frontend
1. Install npm packages using `npm i`.
2. Run Frontend using `npm start`.
### Frontend
1. Install npm packages using `npm i --force`.
2. Run the frontend using `npm i start`.
3. Access the service via `http://localhost:3000`.
Note for (2), if facing issues still, use `npm run start-force`.
6 changes: 6 additions & 0 deletions chatting-service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions chatting-service/server/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store

npm-debug.log*
yarn-debug.log*
yarn-error.log*
21 changes: 21 additions & 0 deletions chatting-service/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Specify node image to build from
FROM node:16

# Create app directory
WORKDIR /usr/src/app

# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

# Install app dependencies
RUN npm install

# Bundle app source
COPY . .

# Port to use
EXPOSE 8008

# Command to run app
CMD [ "node", "index.js" ]
51 changes: 51 additions & 0 deletions chatting-service/server/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import express from "express";
import cors from "cors";
import { createServer } from "http";
import { Server } from "socket.io";

const app = express();
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
app.use(cors()); // config cors so that front-end can use
app.options("*", cors());
const httpServer = createServer(app);
const io = new Server(httpServer, {
cors: {
origin: "http://localhost:3000",
credentials: true,
},
});

app.get("/", (req, res) => {
res.send("Hello World from chatting-service");
});

const PORT = 8008;
httpServer.listen(PORT, () => {
console.log(`listening on *: ${PORT}`);
});

const NEW_CHAT_MESSAGE_EVENT = "newChatMessage";

io.on("connection", (socket) => {
console.log(`Client ${socket.id} connected`);

// Join a conversation
const { roomId } = socket.handshake.query;
socket.join(roomId);
socket.on("username", (data) => {
console.log(data);
io.in(roomId).emit("connected", data);
});

// Listen for new messages
socket.on(NEW_CHAT_MESSAGE_EVENT, (data) => {
io.in(roomId).emit(NEW_CHAT_MESSAGE_EVENT, data);
});

// Leave the room if the user closes the socket
socket.on("disconnect", () => {
console.log(`Client ${socket.id} diconnected`);
socket.leave(roomId);
});
});
Loading