Skip to content

MeiFeiChen/pharm-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PharmCode

logo-icon logo

A beginner-friendly online judge system providing easy coding challenges and real-time discussion forums, augmented with AI code review to enhance coding and algorithmic skills.

Languages Supported: JavaScript javascript |   Python python |  SQL

Outlines

Getting Started | Features | Tech Stack | Architecture | Database Schema | Contacts | License

Getting Started

Step 1: Log in and then navigate to the Problem Set Page and select the desired problem to solve.

Email Password
Testing Account test@test.test testtest

Step 2 Dive Into Coding: Select the programming language you're most comfortable with. And then, start coding and begin solving the problem 🚀.

Step 3 Run and Submit: Once you're confident in your solution, it's time to submit it to the online judge.

problemSets image problemSets image

Back to Top

Features

  • Analyze the user-submitted code

    The Docker setup employs /usr/bin/time and timeout for monitoring and controlling code execution, focusing on CPU usage and memory. This approach not only tracks performance but also restricts the execution time of the submitted code. This precise analysis categorizes user submissions as follows:

    Result Type Description Other information
    AC (Accepted) the program has passed all test cases. Shows runtime and memory usage of the program.
    RE (Runtime Error) the program encountered an error during execution, such as division by zero or array index out of bounds. Shows the reason for the error and the location of the erroneous code.
    WA (Wrong Answer) the program's output does not match the expected answer. Shows a comparison of the expected output versus the actual output of the program.
    TLE (Time Limit Exceeded) the program did not complete execution within the specified time limit. Often implies that the code needs optimization or there might be an infinite loop.

    This setup ensures efficient and secure evaluation of code, effectively identifying performance issues, errors, and compliance with time constraints.

run-submit-code.mov

  • AI Code Review Node.js Badge

    Utilize OpenAI API to offer code review functionality.

Ai-code-review.mov

  • Real-time discussion

    Employs Socket.IO for instant updates of forum comments in the discussion area.

My.Movie.2.MOV

Back to Top

Tech Stack

Server
Node.js Badge express Badge socket Badge javascript Badge
Client
react Badge tailwind Badge javascript Badge
Databases
PostgreSQL Badge redis Badge
Deployment
GitHub Actions Badge Docker Badge
Cloud
GitHub Actions Badge

Back to Top

Architecture

image

  • Docker Integration for Code Execution:

    Leveraged Docker containers on the worker servers to securely run user-submitted code, ensuring both robust security and scalability. This setup facilitates comprehensive analysis of memory usage and runtime, offers detailed error diagnostics, and supports practical exercises in JavaScript, Python, and SQL.

  • Job Queue System with Redis:

    Engineered a job queue system utilizing Redis, designed to efficiently manage code submissions. This system assigns tasks to worker servers for the execution of code, optimizing the handling and processing of user submissions.

  • Real-Time Interaction via Socket.IO:

    Adopted Socket.IO to enable live discussions and dynamic content updates, significantly boosting user engagement.

  • CI/CD Pipelines for Seamless Deployment:

    Implemented Continuous Integration and Continuous Deployment (CI/CD) pipelines with GitHub Actions, coupled with Docker Hub for streamlined deployment of both frontend and backend components. This approach ensures rapid, reliable, and automated deployment processes, enhancing development efficiency and product reliability.

Back to Top

Database Schema

image

Back to Top

License

This project is licensed under the MIT License - see the LICENSE file for details.

Back to Top

Contacts

Back to Top

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages