Skip to content

Commit

Permalink
feat: Implement Matching flow and update Question CRUD (#82)
Browse files Browse the repository at this point in the history
* chore: Commit frontend mockup for matching service

* feat(matching-service)!: Create matching service backend

* fix: losing navigation state when refreshing

* fix: navbar doesn't align

* feat: match service up till failure

* fix: add template code input + remove required for link

Out of the three new added fields for question, only solution code is compulsory, template code and link are not compulsory.

* nit: improve UI and componentization

* feat: matching up till success state

* nit: cleanup ui

* feat: light/dark mode toggle

* fix: code editor for templateCode and solutionCode

* wip: questionlist

* feat: view specific question page

* chore: add rich text editor for question description

* fix: add templateCode field for Question

* fix: rich text editor for description + minor fix for code editor

* fix: only open link if it exists

* fix: submit html description on creating question

* fix: rename description object variable names

* nit: clean up navbar and add dark mode

* feat: update homepage

* nit: remove console.log

* fix: fix categories displayed

to be changed once backend updates the fetch categories endpoint to return a fixed set of categories

* feat(matching-service)!: Implement matching service backend
- Created websocket server for matching service
- Added client-sent events:
   - "connection": User connects to websocket server
   - "disconnect": User disconnects from websocket server
   - "create-match": User request for a match with another user with match criteria
   - "cancel-match": User cancels a current matching request
- Added server-sent events:
   - "connect": Server successfully connected with user
   - "disconnect": Server disconnected with user
   - "finding-match": Server trying to find a match with other users
   - "found-match": Server found a match for this user, returns match object
   - "no-match": Server could not find a match within the timeout
   - "disconnect-while-match": User was disconnected with server while finding a match

* chore: create startup script

* chore: update package

* fix: Handle errors and emit error event to frontend

* fix: Reduce timeout duration, add TTL to user entries in DB

* feat: Priority based queue from the number of categories selected

* fix: Update docker-compose

* fix: forgot to merge

* fix: rich text editor bug

* fix: question CRUD minor changes ang bug fixes

fixed the following issues:
- cursor moving to last line when editing in the wysiwyg editor
- undo button causing content in wysiwyg editor to be cleared
- ensure dummy categories used instead of fetched categories (for now, to be replaced once backend sends over fixed categories with id)
- change test code to code editor instead of text area
- create question page by default show one test case (to be filled by user)

* fix: make question link required

* fix: build errors

* chore: remove temp frontend for matching service

---------

Co-authored-by: pzl111 <[email protected]>
Co-authored-by: Lim Pei En <[email protected]>
  • Loading branch information
3 people authored Oct 20, 2024
1 parent 0ca6b7f commit 53efce3
Show file tree
Hide file tree
Showing 43 changed files with 3,042 additions and 519 deletions.
20 changes: 20 additions & 0 deletions cleanup-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# List of ports to clean up
ports=(5173 8000 8001 8002 8003 8004)

# Loop through each port and clean it up
for port in "${ports[@]}"; do
echo "Cleaning up port $port..."

# Check if the port is in use and kill the processes using it
fuser -n tcp -k "$port" 2>/dev/null

if [ $? -eq 0 ]; then
echo "Port $port cleaned successfully."
else
echo "No processes found on port $port, or failed to clean up."
fi
done

echo "Service cleanup complete."
Loading

0 comments on commit 53efce3

Please sign in to comment.