Git Product home page Git Product logo

online-judge's People

Contributors

alvinpiter avatar

Watchers

 avatar

Forkers

winner106

online-judge's Issues

Initialize the project

Done criteria:

  • Initialize a backend server capable of handling health check request
  • Initialize a frontend app that performs a health check request to the backend server
  • Initialize frontend app's routing
  • Initialize frontend app's context-related helper function
  • Utilize NGINX's docker for local development

Implement solution judgment POC

Done criteria:

  • The backend is able to determine whether a solution submitted by the user is correct or not
  • The backend is able to keep track of the result of running the solution against each test case
  • The backend is able to keep track of the solution's compilation message
  • The users can see the details of their submissions (run time, memory usage, compilation message, etc)

Implement problem read for users

Done criteria:

  • As a user, I can see the list of problems. It should be paginated and filterable.
  • As a user, I can see the description of a problem

Register newly registered user to the Scoreboard

Done criteria:

  • Newly registered user should immediately appear on the Scoreboard
  • Adjust the Last solve at value on the Scoreboard:
    • For users who have solved at least 1 problem: Display the time relative to the contest start time
    • For users who haven't solved any problem: Display nothing
    • Also show a tooltip explaining how the value is calculated

Implement solution submission

Done criteria:

  • As a user, I can submit a solution to a problem
  • As a user, I can see my submissions (but the verdict will be "Pending", since the judge has not been implemented)
  • As a user, I can filter the submissions by username, problem, programmingLanguage, verdict,

MySQL disk outage in production

Diagnosis
Run the following query in the MySQL pod

SELECT table_schema, table_name,
  ROUND((data_length+index_length)/POWER(1024,2),2) AS tablesize_mb
FROM information_schema.tables
ORDER BY tablesize_mb DESC LIMIT 20;

submission_run_details table takes so much space. This is because we save the code execution output to it.

Solution

  • Add a new column to submission_run_details called outputFileKey. We will upload the code execution output to S3 instead.
  • Increase MySQL's storage request to 3Gi.

Implement admin authentication

Done criteria:

  • Implement an API endpoint for authentication, it should return a JWT
  • Implement a POC protected API endpoint
  • Implement a login form in frontend
  • Implement a POC protected page in frontend
  • Implement a logout mechanism in frontend
  • Should utilize MySQL's docker for local development

Refactor `EntitySorterService`

Done criteria:

  • SortedSetService should not receive sortedSetKey in its constructor. It should be put in function's parameter, for example, SortedSetService.upsertMemberScore(sortedSetKey, member, score).
  • EntitySorterService should not receive order in its constructor. The order should be part of SortedEntitiesPaginationParameter.

Implement User search suggestion

Done criteria:

  • Implement an API endpoint that can give suggestions to user search. For example, if the user search for "alv", the backend might return "alvin", "alveoli", "alvarado", etc.
  • Newly registered user should be searchable
  • Implement autocomplete field in FE and put it in Scoreboard page.

Implement problem CRUD for admin

Done criteria:

  • As an admin, I can create a problem. A problem has the following properties: name, description, rating.
  • As an admin, I can see the list of created problems. The list should be paginated and filterable.
  • As an admin, I can update a problem.
  • As an admin, I can delete a problem.

Use the following payload from LeetCode as a guide:

{
  "content": "<p>You are given two <strong>non-empty</strong> linked lists representing two non-negative integers. The digits are stored in <strong>reverse order</strong>, and each of their nodes contains a single digit. Add the two numbers and return the sum&nbsp;as a linked list.</p>\n\n<p>You may assume the two numbers do not contain any leading zero, except the number 0 itself.</p>\n\n<p>&nbsp;</p>\n<p><strong class=\"example\">Example 1:</strong></p>\n<img alt=\"\" src=\"https://assets.leetcode.com/uploads/2020/10/02/addtwonumber1.jpg\" style=\"width: 483px; height: 342px;\" />\n<pre>\n<strong>Input:</strong> l1 = [2,4,3], l2 = [5,6,4]\n<strong>Output:</strong> [7,0,8]\n<strong>Explanation:</strong> 342 + 465 = 807.\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> l1 = [0], l2 = [0]\n<strong>Output:</strong> [0]\n</pre>\n\n<p><strong class=\"example\">Example 3:</strong></p>\n\n<pre>\n<strong>Input:</strong> l1 = [9,9,9,9,9,9,9], l2 = [9,9,9,9]\n<strong>Output:</strong> [8,9,9,9,0,0,0,1]\n</pre>\n\n<p>&nbsp;</p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li>The number of nodes in each linked list is in the range <code>[1, 100]</code>.</li>\n\t<li><code>0 &lt;= Node.val &lt;= 9</code></li>\n\t<li>It is guaranteed that the list represents a number that does not have leading zeros.</li>\n</ul>\n",
  "mysqlSchemas": []
}

Scoreboard filter "refresh" after submitting

How to reproduce:

  • Go to Scoreboard page
  • Add a new user to the filter then submit
  • The page "refresh" (more on this later)

This also happens in Submissions page, when we filter by user.

The cause is this. Every time we change the filter, we display the LoadingState component, hence replacing the context provider.
Since the context provider rerenders, the whole component tree rerenders

Deploy to production

Done criteria:

  • The app is deployed on AWS
  • Uses infrastructure-as-code paradigm
  • The app is accessible via the internet

Implement object storate service

Done criteria:

  • Implement a service for uploading object to cloud storage.
  • Implement a POC API endpoint for file uploading. It should return the file's URL on success.
  • Implement a POC upload form in frontend

Summarize user's attempts on a problem

Done criteria:

  • Mark the problem as "solved" in Problems page if the current user has solved it
  • Mark the problem as "attempted" in Problems page if the current user has only submitted incorrect solutions
  • Keep track of how many attempts a user did before finally solving a problem

Implement user's score calculation mechanism

Done criteria:
Listen to submissionJudged event. Upon judgment completion, calculate the user's score and upsert the score to Redis' sorted set. The calculation of user's score should use strategy pattern, so we can easily extend it with other calculation strategy.

Display recent submissions globally, per problem, and per user

Done criteria:

  • As a user, I can see the list of all recent submissions
  • As a user, I can see the list of recent submissions for a particular problem
  • As a user, I can see the list of recent submissions of a user
  • The submissions list should be filterable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.