How ruyili/blockoj works
Main Components
a. Frontend Layer:
• Blockly Editor (core component)
• User Interface (Pug templates)
• Style Components (SASS/CSS)
• Client-side JavaScript modules
b. Backend Layer:
• Express.js Server
• Authentication System
• Problem Management
• Judging System (C-based)
• Database Interface
c. Database Layer:
• PostgreSQL Database
d. External Services:
• AWS EC2 (hosting)
Component Relationships
• Client ↔ Server (HTTP/WebSocket)
• Server ↔ Judge System
• Server ↔ Database
• Judge System ↔ Test Cases
Detailed Component Breakdown
• Blockly Editor Interface
• Problem View
• User Authentication Views
• Code Submission Interface
• Notification System
• Auth Controller (/src/server/auth.js)
• Problem Reader (/src/server/problem-reader.js)
• Compilation Service (/src/server/compile.js)
• Judge System (/src/server/judging)
• Database Manager (/src/server/database.js)
• PostgreSQL Database
• Problem Test Cases
• User Solutions
• Temporary Compilation Files
Additional Details
Notes for:
• Scalability considerations
• Security measures
• Error handling flow
• Test case isolation
The submission and evaluation pipeline
• Rectangles: Core services
• Hexagons: External services
• Rounded rectangles: User interfaces
• Diamonds: Decision points
• Blue: User-facing components
• Green: Processing components
• Yellow: Storage components
• Red: Security components
• Gray: External services