# esa513/onlinejudgedeploy architecture

> Architecture diagram of the GitHub repository esa513/onlinejudgedeploy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/esa513/onlinejudgedeploy
- Repository: https://github.com/esa513/onlinejudgedeploy

## Overview

##### Main Components

a) Container Orchestration Layer
- Docker Compose as the primary orchestrator
- Service containers that are defined in docker-compose.yml
- Backup system components

b) Network Layer
- HTTP (Port 80)
- HTTPS (Port 443)
- Internal Docker network

c) Service Components
- Frontend Web Interface
- Admin Panel (/admin endpoint)
- Backend Services
- Database Services
- Judge Engine

**[External Access Layer]**

- ▼
**[Container Orchestration Layer]**

- ▼
**[Service Layer]**

##### Key Relationships

- External user access flow through ports 80/443
- Inter-container communication paths
- Backup system workflow
- Admin access paths
- Judge engine interaction flow

##### Important Details

- Port mappings (80:80, 443:443)
- Volume mounts for persistent data
- Backup paths (shown by the backup scripts)
- Administrative access flows
- Health check indicators

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Access Layer
    subgraph Access
        HTTP[HTTP Port 80]:::access
        HTTPS[HTTPS Port 443]:::access
    end

    %% Container Orchestration Layer
    subgraph Orchestration["Container Orchestration Layer"]
        Docker["Docker Compose"]:::orchestrator
        HealthCheck["Health Check System"]:::monitor
    end

    %% Service Layer
    subgraph Services["Service Components"]
        Frontend["Frontend Web Interface"]:::service
        AdminPanel["Admin Panel"]:::service
        Backend["Backend Services"]:::service
        JudgeEngine["Judge Engine"]:::service
        Database[(Database)]:::storage
    end

    %% Backup System
    subgraph Backup["Backup System"]
        BackupManager["Backup Manager"]:::backup
        BackupStorage[(Backup Storage)]:::storage
        RestoreSystem["Restore System"]:::backup
    end

    %% Relationships
    HTTP --> Docker
    HTTPS --> Docker
    Docker --> Frontend
    Docker --> Backend
    Docker --> JudgeEngine
    Docker --> Database
    Frontend --> AdminPanel
    Frontend --> Backend
    Backend --> Database
    Backend --> JudgeEngine
    HealthCheck -.-> Frontend
    HealthCheck -.-> Backend
    HealthCheck -.-> JudgeEngine
    BackupManager --> BackupStorage
    BackupStorage --> RestoreSystem
    Database -.-> BackupManager
    RestoreSystem -.-> Database

    %% Click Events
    click Docker "https://github.com/esa513/OnlineJudgeDeploy/blob/2.0/docker-compose.yml"
    click BackupManager "https://github.com/esa513/OnlineJudgeDeploy/tree/2.0/backup/"
    click RestoreSystem "https://github.com/esa513/OnlineJudgeDeploy/tree/2.0/backup/"
    click BackupStorage "https://github.com/esa513/OnlineJudgeDeploy/tree/2.0/backup/"

    %% Styling
    classDef access fill:#6890F0,stroke:#000,stroke-width:2px
    classDef orchestrator fill:#98FB98,stroke:#000,stroke-width:2px
    classDef service fill:#90EE90,stroke:#000,stroke-width:2px
    classDef storage fill:#FFD700,stroke:#000,stroke-width:2px
    classDef backup fill:#FFA07A,stroke:#000,stroke-width:2px
    classDef monitor fill:#B0C4DE,stroke:#000,stroke-width:2px

    %% Legend
    subgraph Legend
        L1[External Access]:::access
        L2[Orchestration]:::orchestrator
        L3[Services]:::service
        L4[(Storage)]:::storage
        L5[Backup Components]:::backup
        L6[Monitoring]:::monitor
    end
```
