-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: question matching #50
Conversation
@tituschewxj looks great! I noticed the following 2 behaviours of the matching service
The rest LGTM. Thanks for your diligent backend design! |
I think these are intended behaviour as there are two stages to the matching. Both stages are independent of each other. Stage 1: Two users have to match first before proceeding to the question matching stage in our current algorithm. Stage 2: The question finding algorithm tries to find a question that meets the criteria from the question bank. Maybe we can revisit how the matching should be done later if we have time, if anyone has any suggestions how we can improve on this design. |
Noted that the behaviour in question finding algorithm is contingent on the users being matched, perhaps we could make this clearer as a note in our report. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
This PR aims to implement a question service API that returns a question given matching parameters, and linking this API to the matching service.
Changes:
QUESTION_SERVICE_GRPC_URL
Note: JWT verification is not implemented yet.
Implementation
Given that the match result should be returned as soon as possible, a synchronous call makes more sense in this case, although this results in higher coupling between the question service and matching service. gRPC was chosen as it has better performance compared to REST.
Matching process (done in matching service)
Easy
andAlgorithms
. Both users are removed from the matching queue.Question matching algorithm (done in question service)
Warning
If there are no questions in the database, then the question matching service would fail.
API Structure
Request to question-service from matching-service:
Response from question-service on question found:
Response from matching-service to user on match found:
matched_topics
is still returned to the frontend whenquestion_topics
is present. If we are able to distinguish which topics users match on and display it to the users, it would be informative. Possible improvement for frontend.Testing
We can use
docker-compose up --build
. Ensure that the environment variables are correct.websocket-test.html
provides an interface for easier testing for testing the matching queue. It can be used once the docker compose is ready or manually withgo run main.go
in both the question and matching service. (Try not to use too many users or it may exceed the firebase free limit.)Known Issues
matching-service_1 | 2024/10/26 06:07:10 context deadline exceeded apps_matching-service_1 exited with code 1