Skip to content

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

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:

  1. Frontend sends HTTP POST to /api/run/create/
  2. Nginx forwards request to PHP (HHVM)
  3. Bootstrap loads configuration and initializes database
  4. Controller (RunController::apiCreate) processes request
  5. Authentication validates user token
  6. Validation checks permissions, contest status, rate limits
  7. Database stores submission with GUID
  8. Grader receives submission for evaluation
  9. Runner compiles and executes code
  10. 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

Academic References

omegaUp has been documented in academic papers:


Next Steps: Explore the MVC Pattern to understand how omegaUp organizes its code.