Architecture Overview
omegaUp is built using the Model-View-Controller (MVC) architectural pattern, providing a clean separation of concerns between data, business logic, and presentation.
Quick Navigation
-
Learn how omegaUp implements the MVC pattern and separates concerns.
-
Vue.js, TypeScript, and Bootstrap 4 frontend structure and organization.
-
PHP controllers, DAO/VO patterns, and API structure.
-
Database structure, relationships, and data access patterns.
System Components
omegaUp consists of several key components:
Frontend (PHP + MySQL)
The web application layer that handles user interactions, problem and contest administration, user management, rankings, and scoreboards. Written in PHP with MySQL database.
Backend (Go)
The evaluation subsystem responsible for compiling and executing user submissions.
- Grader: Maintains the submission queue, dispatches to Runners, and determines verdicts
- Runner: Compiles and executes programs in a secure sandbox environment
- Minijail: Linux sandbox (forked from Chrome OS) for secure code execution
High-Level Architecture
flowchart TD
WebApp[Web Application<br/>Vue.js + TypeScript]
CLI[CLI Clients]
subgraph Cloud[Cloud Infrastructure]
MySQL[(MySQL Database)]
DAOs[DAO Layer<br/>Data Access Objects]
Controllers[Controllers/APIs<br/>PHP]
GitServer[Git Server<br/>Problem Storage]
Grader[Grader<br/>Go]
subgraph Runners[Runner Pool]
Runner1[Runner 1<br/>Go]
Runner2[Runner 2<br/>Go]
Runner3[Runner N<br/>Go]
end
Controllers --> GitServer
Controllers --> DAOs
DAOs --> MySQL
Controllers --> Grader
Grader --> MySQL
Grader --> Runner1
Grader --> Runner2
Grader --> Runner3
end
WebApp --> Controllers
CLI --> Controllers
style WebApp fill:#42b883,stroke:#35495e,color:#fff
style Controllers fill:#777bb4,stroke:#4f5b93,color:#fff
style Grader fill:#00add8,stroke:#007d9c,color:#fff
style MySQL fill:#4479a1,stroke:#2c5a7a,color:#fff
Technology Stack
| Technology | Purpose | Version |
|---|---|---|
| MySQL | Database | 8.0.39 |
| PHP | Controllers/API | 8.1.2 |
| Python | Cronjobs | 3.10.12 |
| TypeScript | Frontend | 4.4.4 |
| Vue.js | Frontend Framework | 2.5.22 |
| Bootstrap | UI Framework | 4.6.0 |
| Go | Grader & Runner | 20.0.1 |
Version Updates
Technology versions are periodically updated to keep the platform supported and secure.
Request Flow
When a user submits code, here's what happens:
- Frontend sends HTTP POST to
/api/run/create/ - Nginx forwards request to PHP (HHVM)
- Bootstrap loads configuration and initializes database
- Controller (
RunController::apiCreate) processes request - Authentication validates user token
- Validation checks permissions, contest status, rate limits
- Database stores submission with GUID
- Grader receives submission for evaluation
- Runner compiles and executes code
- Result returned to frontend via WebSocket
For detailed information, see System Internals.
Design Principles
Security First
- All communication encrypted (HTTPS)
- Secure code execution via Minijail sandbox
- Authentication tokens for API access
- Rate limiting to prevent abuse
Scalability
- Distributed Runner architecture
- Queue-based submission processing
- Caching for performance
- Database optimization
Maintainability
- MVC pattern for separation of concerns
- DAO/VO pattern for data access
- Comprehensive test coverage
- Clear code organization
Related Documentation
- MVC Pattern - Detailed MVC implementation
- Frontend Architecture - Frontend structure and components
- Backend Architecture - Controllers and API design
- Database Schema - Database structure and relationships
- System Internals - Deep dive into system operation
Academic References
omegaUp has been documented in academic papers:
- Luis Héctor CHÁVEZ, Alan GONZÁLEZ, Joemmanuel PONCE.
omegaUp: Cloud-Based Contest Management System and Training Platform in the Mexican Olympiad in Informatics - Luis Héctor CHÁVEZ.
libinteractive: A Better Way to Write Interactive Tasks
Next Steps: Explore the MVC Pattern to understand how omegaUp organizes its code.