# r-zin/airport-runway-scheduler architecture

> Architecture diagram of the GitHub repository r-zin/airport-runway-scheduler, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/r-zin/airport-runway-scheduler
- Repository: https://github.com/r-zin/airport-runway-scheduler

## Overview

##### File structure
- Top-level:
- BackEnd/ – contains all code.
- BackEnd/Data Struct Logic/ – holds two modules:
◦ DataModel.py – defines your domain entities (Flights, Runways, Constraints).
◦ Scheduling.py – contains the runway‐assignment algorithm.
- There are no config files, API layers, or persistence modules visible; assume in-memory or to-be-added database integration.

##### Extract README insights
“A Python library that models airport operations and runs a scheduling algorithm to assign flights to runways under given constraints.”

##### Main components
a. Data Ingestion/Input
- Represents flight requests or schedules (could be a CSV parser, API consumer, or CLI input).
b. Data Model Layer (DataModel.py)
- Domain entities: Flight, Runway, Constraints.
c. Scheduling Engine (Scheduling.py)
- The algorithm that takes models and produces an assignment.
d. Data Store (optional)
e. Output/Reporting
- CLI output, API response, or generated reports.
f. External Systems (optional)
- Air traffic control API, airport operations dashboard, etc.

##### Interactions and data flow
- Input → Data Model Layer → Scheduling Engine → Data Store (read/write) → Output

##### Architectural patterns and design principles
- Layered architecture: separate input, domain, algorithm, and persistence.
- Single Responsibility: DataModel.py manages only data structures; Scheduling.py handles only scheduling logic.
- Dependency Injection (future enhancement): inject different scheduler implementations or data stores.
- Extensibility points: ability to plug in new constraint types or scheduling strategies.

##### Technologies and frameworks
- Python 3.x
- Testing: pytest (not shown, but recommended)

##### Diagramming recommendations
- Blue for modules (DataModel, Scheduling)
- Green for data stores
- Orange for external interfaces (CLI/API)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "External Interfaces"
        Input["Data Ingestion Input (CLI / API)"]:::external
    end

    subgraph "Core Modules"
        DataModel["Data Model Layer\nDataModel.py"]:::module
        Scheduling["Scheduling Engine\nScheduling.py"]:::module
    end

    subgraph "Persistence (Planned)"
        DataStore["Data Store\n(SQL/NoSQL)"]:::datastore
    end

    Output["Output / Reporting"]:::external

    subgraph "External Systems (Optional)"
        ATCAPI["Air Traffic Control API"]:::external
        Dashboard["Airport Operations Dashboard"]:::external
    end

    %% Connections
    Input -->|"parse_requests()"| DataModel
    DataModel -->|"get_flights(), get_runways()"| Scheduling
    Scheduling -->|"save_assignments()"| DataStore
    DataStore -->|"load_models()"| Scheduling
    Scheduling -->|"generate_report()"| Output
    ATCAPI -.-> Input
    Dashboard -.-> Output

    %% Click Events
    click DataModel "https://github.com/r-zin/airport-runway-scheduler/blob/main/BackEnd/Data Struct Logic/DataModel.py"
    click Scheduling "https://github.com/r-zin/airport-runway-scheduler/blob/main/BackEnd/Data Struct Logic/Scheduling.py"

    %% Styles
    classDef module fill:#cce5ff,stroke:#004085,color:#004085
    classDef datastore fill:#d4edda,stroke:#155724,color:#155724
    classDef external fill:#fff3cd,stroke:#856404,color:#856404
    classDef planned stroke-dasharray:5 5,fill:#f8f9fa,stroke:#6c757d

    class DataModel module
    class Scheduling module
    class DataStore datastore,planned
```
