How kevin0929/nchuoj works
Main Components
A. Frontend Layer:
• Static Assets (CSS, JS, Images)
• Templates (Admin and User views)
• Clear separation between admin and user interfaces
B. Backend Layer:
• API Services
• Core Services
• Database Models
• Authentication System
C. Judge System:
• Judge0 Integration (separate component)
• Submission Processing
• Test Case Handling
D. Database Layer:
• Major entities (User, Course, Problem, Submission, etc.)
Component Relationships
User Interface ↔ API Layer ↔ Services ↔ Database
• ↕
• Judge System
Detailed Component Breakdown
A. API Components (from /apis):
• Authentication (auth.py)
• Course Management (course.py)
• Problem Management (problem.py)
• Submission Handling (submission.py)
• User Management (user.py)
• Announcement System (announcement.py)
• Homework Management (homework.py)
B. Data Models (from /model):
• User
• Course
• CourseUser (Many-to-Many relationship)
• Problem
• Submission
• TestCase
• Homework
• Announcement
C. Services Layer (from /service):
• Course Service
• Submit Service
• User Service
Important Architectural Elements to Highlight
A. Authentication Flow:
• Login process
• Role-based access control (Admin/User)
B. Submission Flow:
• Problem submission path
• Judge0 integration
• Result processing
• Feedback loop to user
C. Course Management:
• Course-User relationships
• Homework assignment flow
• Problem sets organization
Technical Stack Indicators
• Python/Flask (Backend framework)
• SQLAlchemy (ORM)
• Alembic (Database migrations)
• Judge0 (Code execution engine)
• Docker (Containerization)