Open yusufaine opened 2 years ago
History Service
The service is linked to backend
and utilises the following:
User Service
)createMany
and establish relations, this has to be done one-by-one.QuestionContent
of all questions and it has to be done manually.QuestionSummary
, retries and writing to the database and would overrun the limitation of Cloud Function.To resolve this:
- Separate updating the
QuestionSummary
andQuestionContent
, and execute them sequentially in that order (content relies on summary).
To resolve this:
- Process LC queries by chunks rather than sending all the requests at once (
Promise.all()
)
- Seeding the database: This does not fully resolve the issue but yields better results (more HTTP status 200)
- Updating the database: This should not prove to be an issue as it is unlikely that LC adds >10 questions in a day.
The following were implemented but only (2) is deployed:
- Creating a HTTP-triggered function and repeat it until there are no leftovers, or
- Increase the frequency of the event-triggered function.
The service implements both to seed and update by the hour every hour to update the summary values, daily quetion and resolve and leftover missing content, if any.
Updated as of: 25th Septemeber 2022
This is based of what LeetCode returns, for the actual schema that was applied, refer to prisma/schema.prisma
which also covers the relations such as the one-to-many relation that was mentioned in the first point of the previous section.
Column Name | Data Type | Description |
---|---|---|
acRate |
number |
Solution acceptance rate (%) |
difficulty |
string |
Difficulty level of the question |
paidOnly |
boolean |
Is the question only available to paid users? |
title |
string |
Question title |
titleSlug |
string |
Slug associated to question |
topicTags |
string[] |
Topics that are associated to the question |
createdAt |
timestamp |
When the question was seeded |
updatedAt |
timestamp |
When the question was last updated |
Column Name | Data Type | Description |
---|---|---|
content |
string |
Question context and details. |
hints |
string[] |
Hints to solving the question, if any. |
topicTags |
string[] |
Topics that are associated to the question |
discussionLink |
string |
Link to the question's discussion page on Leetcode |
createdAt |
timestamp |
When the question was seeded |
updatedAt |
timestamp |
When the question was last updated |
Updated as of: 25th Septemeber 2022
query psetQuestionList {
psetQuestionList: questionList(
categorySlug: ""
limit: -1
skip: 0
filters: {}
) {
total: totalNum
questions: data {
acRate
difficulty
paidOnly: isPaidOnly
title
titleSlug
topicTags {
slug
}
}
}
}
query questionOfToday {
activeDailyCodingChallengeQuestion {
question {
acRate
difficulty
paidOnly: isPaidOnly
title
titleSlug
topicTags {
slug
}
hasSolution
hasVideoSolution
}
}
}
query getQuestionDetail($titleSlug: String!) {
question(titleSlug: $titleSlug) {
content
hints
topicTags {
name
}
}
}
# var
# {
# "titleSlug": "two-sum"
# }
We prioritise XYZ and as such did the following:
Rooms serve the purpose of containing the question content from the question service, and host the collaboration and communication service.
This service mainly covers the ability to work collaboratively on the same document as the partner's.
While working on the same document, users would need a way to communicate their ideas/suggestions across to each other. Collaboration service can function in place of a chat service through comment blocks but does not simulate a proper interview/discussion and is no where near as interactive.
THIS ISSUE SERVES AS A DRAFT FOR PROJECT REPORT.
Decisions
Tech stack
Deployment
For the development and demonstration of the application, we would focus on running the service locally. Once all the features are up and running nearer and as we approach the deadline, we would ideally dockerise some of the microservices and deploy it as follows:
Frontend
Backend
User service
Planetscale -- Hosted SQL database.
Matching service
Utilise Redis' namespace as the different types of "queues" (PubSub topics).
Question service
Planetscale to allow for relational queries/mappings, Redis for quick queries.
Design
We will prioritise functionality first before user experience. Simply put, the team would work on getting a functional version up first before improving on the UI elements that would improve the user experience.
Diagrams
All of our diagrams are stored in this Gist.
Architecture
Simplified
Specifics
User flow
Specifics
Dashboard
users can navigate access the pages that are immediately a child toDashboard
as there would be a navigation bar.Locked room page with past session
can accessMatching page
directly without needing to go back toDashboard
.log out
and would be directed back to the start of the user flow.