# erencanakyuz/airportsystem architecture

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

- Interactive diagram: https://gitdiagram.com/erencanakyuz/airportsystem
- Repository: https://github.com/erencanakyuz/airportsystem

## Overview

##### Project type and purpose
- AirportDemo is a full-stack ASP.NET Core 9.0 MVC web application (“Airport Detective Nexus”) for real-time flight tracking, fuel management, logistics, maintenance dashboards, and flight control, backed by EF Core and SQLite.

##### File structure
- Top-level layers:
- Controllers (MVC controllers and a SignalR Hub for real-time updates)
- Views (Razor Views organized by feature: Flights, Radar, Maintenance, Auth, Shared)
- Data (ApplicationDbContext + EF Core Migrations)
- Models (Domain & view models: Flight, User, Login/Register)
- Program.cs (app startup, DI, middleware, SignalR endpoints)
- Configuration: appsettings.json
- Static assets under wwwroot (CSS, JS, libraries)
- airport.db (SQLite database file)
- Build/deployment artifacts (bin/, obj/) and CI workflow (.github/workflows/dotnet.yml)

##### Extract architectural insights from the README
- Uses ASP.NET Core MVC, EF Core → relational DB layer
- Razor to render dynamic views
- SignalR Hub (FlightHub) for pushing real-time flight data to clients
- External/3rd-party integration: RadarApiController may call external radar API to fetch flight positions
- LoggingHandler indicates custom middleware or HTTP message handler for request logging

##### Main components and their interactions
a. UI Layer (Browser)
- Razor Views + static assets (CSS/JS)
- JavaScript client connects to SignalR FlightHub for live updates
b. Web Server / Application Layer
- ASP.NET Core MVC pipeline:
- Routing → Controllers
- Middleware: LoggingHandler, Authentication (AuthController)
- Controllers: FlightsController, RadarController, MaintenanceController, FuelManagement, Logistics
- SignalR Hub: FlightHub for real-time push
c. Business/Data Layer
- ApplicationDbContext (EF Core)
- Models → mapped to SQLite tables
d. Data Storage
- SQLite DB file (airport.db) with EF Migrations
e. External Services
- RadarApiController calls external flight radar API
- (Future) predictive analytics module for runway positions
f. Authentication & Authorization
- ASP.NET Identity or custom auth (AuthController with Register/Login view models)

##### Architectural patterns and design principles
- MVC (Models ↔ Views ↔ Controllers)
- Repository pattern implicit via DbContext
- Real-time event broadcast via SignalR Hub
- Separation of concerns: Controllers orchestrate, Data layer persists, Views render
- Middleware pipeline for cross-cutting concerns (logging, error handling)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client (Browser)"
        direction TB
        Browser["Browser"]:::frontend
        RazorViews["Razor Views"]:::frontend
        StaticAssets["Static Assets (CSS/JS)"]:::frontend
        JSClient["JS Client"]:::frontend
    end

    %% Server Layer
    subgraph "Web Server (ASP.NET Core)"
        direction TB
        Program["Program.cs"]:::server
        LoggingHandler["LoggingHandler"]:::server
        subgraph "Controllers"
            direction TB
            FlightsController["FlightsController"]:::server
            RadarController["RadarController"]:::server
            MaintenanceController["MaintenanceController"]:::server
            FuelManagementController["FuelManagementController"]:::server
            LogisticsController["LogisticsController"]:::server
            AuthController["AuthController"]:::server
            HomeController["HomeController"]:::server
            RadarApiController["RadarApiController"]:::server
        end
        FlightHub["FlightHub (SignalR)"]:::server
        ApplicationDbContext["ApplicationDbContext"]:::server
        Migrations["EF Migrations"]:::server
    end

    %% Database Layer
    subgraph "Database"
        direction TB
        SQLiteDB["SQLite (airport.db)"]:::database
    end

    %% External Services
    subgraph "External Services"
        direction TB
        ExternalAPI["External Flight API"]:::external
        PredictionService["Prediction Service (Future)"]:::external
    end

    %% Flows
    Browser -->|"HTTP GET/POST"| RazorViews
    Browser -->|"Loads"| StaticAssets
    RazorViews -->|"Renders UI"| Browser
    RazorViews -->|"Invokes AJAX"| JSClient
    JSClient -->|"- - -> WebSocket"| FlightHub
    Browser -->|"HTTP GET/POST"| FlightsController
    Browser -->|"HTTP GET/POST"| RadarController
    Browser -->|"HTTP GET/POST"| MaintenanceController
    Browser -->|"HTTP GET/POST"| FuelManagementController
    Browser -->|"HTTP GET/POST"| LogisticsController
    Browser -->|"HTTP GET/POST"| AuthController
    Browser -->|"HTTP GET/POST"| HomeController
    RadarController -->|"HTTP GET"| RadarApiController
    FlightsController -->|"uses"| ApplicationDbContext
    MaintenanceController -->|"uses"| ApplicationDbContext
    FuelManagementController -->|"uses"| ApplicationDbContext
    LogisticsController -->|"uses"| ApplicationDbContext
    AuthController -->|"uses"| ApplicationDbContext
    ApplicationDbContext -->|"SQL Queries"| SQLiteDB
    RadarApiController -->|"HTTP Call"| ExternalAPI
    PredictionService -->|"reads/writes"| ApplicationDbContext
    PredictionService -->|"- - -> WebSocket"| FlightHub

    %% Click Events
    click FlightsController "https://github.com/erencanakyuz/airportsystem/blob/main/Controllers/FlightsController.cs"
    click RadarController "https://github.com/erencanakyuz/airportsystem/blob/main/Controllers/RadarController.cs"
    click MaintenanceController "https://github.com/erencanakyuz/airportsystem/blob/main/Controllers/MaintenanceController.cs"
    click FuelManagementController "https://github.com/erencanakyuz/airportsystem/blob/main/Controllers/FuelManagement.cs"
    click LogisticsController "https://github.com/erencanakyuz/airportsystem/blob/main/Controllers/Logistics.cs"
    click AuthController "https://github.com/erencanakyuz/airportsystem/blob/main/Controllers/AuthController.cs"
    click HomeController "https://github.com/erencanakyuz/airportsystem/blob/main/Controllers/HomeController.cs"
    click RadarApiController "https://github.com/erencanakyuz/airportsystem/blob/main/Controllers/RadarApiController.cs"
    click FlightHub "https://github.com/erencanakyuz/airportsystem/blob/main/Controllers/FlightHub.cs"
    click LoggingHandler "https://github.com/erencanakyuz/airportsystem/blob/main/Controllers/LoggingHandler.cs"
    click ApplicationDbContext "https://github.com/erencanakyuz/airportsystem/blob/main/Data/ApplicationDbContext.cs"
    click Migrations "https://github.com/erencanakyuz/airportsystem/tree/main/Migrations/"
    click RazorViews "https://github.com/erencanakyuz/airportsystem/tree/main/Views/"
    click StaticAssets "https://github.com/erencanakyuz/airportsystem/tree/main/wwwroot/"
    click Program "https://github.com/erencanakyuz/airportsystem/blob/main/Program.cs"
    click SQLiteDB "https://github.com/erencanakyuz/airportsystem/blob/main/airport.db"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#036,stroke-width:1px
    classDef server fill:#90EE90,stroke:#036,stroke-width:1px
    classDef database fill:#FFA500,stroke:#036,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#036,stroke-width:1px
```
