# byakif/akif-airlines architecture

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

- Interactive diagram: https://gitdiagram.com/byakif/akif-airlines
- Repository: https://github.com/byakif/akif-airlines

## Overview

##### Project Type and Purpose
- This is a full‐stack ASP.NET Core MVC web application (“Akif Airlines”) for online airline ticket management.
- Key indicators:
- A single .NET solution with MVC folders (Controllers, Views, Models).
- EF Core migrations in “Migrations” folder.
- Static assets under “wwwroot” (CSS, JS, Bootstrap, images).

##### High-Level Architectural Overview
- Layered MVC structure:
- Presentation Layer: Razor Views (.cshtml) + Static Assets (wwwroot)
- Controller Layer: HTTP routing → Controllers
- Business Logic / Services Layer: custom services (LanguageServices)
- Data Access Layer: Entity Framework Core (BiletContext in Models)
- Database: relational DB (e.g., SQL Server) managed via EF Core migrations

##### Main Components
- Web Browser / Client – issues HTTP(S) requests, renders HTML/CSS/JS.
- ASP.NET Core Web Server – hosts the application (Program.cs, Startup config).
- MVC Controllers – e.g., HomeController, BiletController, AdminController, KullaniciController, etc.
- Razor Views – UI templates under Views/<ControllerName> and Shared layouts.
- Services – LanguageServices for localization.
- EF Core DbContext – BiletContext interacts with database, tracked via Migrations.
- Relational Database – stores entities: Users (Kullanici), Tickets (Bilet), Flights (Ucus), Planes (Ucak), Cities (Sehir), Seats (Koltuk), Roles (Roller).
- Static File Server – serves CSS, JS, images, Bootstrap, jQuery libraries.
- Resource Files – .resx for localization (SharedResource.en-US, tr-TR).

##### Relationships and Data Flows
- Browser → HTTP GET/POST → ASP.NET Core routing → Controller action
- Controller → injects Services and DbContext → executes business logic / data queries
- DbContext → SQL queries → Database → entity objects
- Controller → passes Model to Razor View → renders HTML → sends back to Browser
- Browser → fetches static assets (CSS/JS) from wwwroot

##### Architectural Patterns & Principles
- MVC (Model-View-Controller) separation of concerns.
- Dependency Injection for Services and DbContext.
- Repository‐like pattern via EF Core DbContext.
- Localization via resource files and a LanguageServices abstraction.
- Code‐first migrations to evolve database schema.

##### Technologies & Frameworks
- ASP.NET Core MVC, .NET runtime (Program.cs, launchSettings.json).
- Entity Framework Core for ORM and Migrations.
- Razor for server‐side HTML templating.
- Bootstrap + jQuery for front-end styling and validation.
- JSON configuration (appsettings.json) for environment settings.

##### Deliverables
- An external static file server (if using CDN or local wwwroot).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Layers and Components
    Browser["Web Browser / Client"]:::client
    Database[(Relational Database)]:::database

    subgraph "ASP.NET Core Host" 
        direction TB
        Host["Program.cs / Startup"]:::server

        subgraph "Controllers" 
            direction TB
            HomeController["HomeController"]:::controller
            BiletController["BiletController"]:::controller
            AdminController["AdminController"]:::controller
            KullaniciController["KullaniciController"]:::controller
            KullaniciApiController["KullaniciApiController"]:::controller
            SehirController["SehirController"]:::controller
            UcakController["UcakController"]:::controller
            UcusController["UcusController"]:::controller
        end

        subgraph "Razor Views" 
            direction TB
            ViewsHome["Views/Home"]:::view
            ViewsBilet["Views/Bilet"]:::view
            ViewsAdmin["Views/Admin"]:::view
            ViewsKullanici["Views/Kullanici"]:::view
            ViewsSehir["Views/Sehir"]:::view
            ViewsUcak["Views/Ucak"]:::view
            ViewsUcus["Views/Ucus"]:::view
            ViewsShared["Views/Shared"]:::view
        end

        subgraph "Services" 
            direction TB
            LanguageServices["LanguageServices"]:::service
        end

        subgraph "Data Access" 
            direction TB
            BiletContext["BiletContext (DbContext)"]:::service
            subgraph "Entities" 
                direction TB
                Bilet["Bilet"]:::model
                Ucus["Ucus"]:::model
                Ucak["Ucak"]:::model
                Sehir["Sehir"]:::model
                Koltuk["Koltuk"]:::model
                Kullanici["Kullanici"]:::model
                Roller["Roller"]:::model
                AdminModel["Admin"]:::model
            end
        end

        subgraph "EF Core Migrations"
            direction TB
            MigrationsFiles["Migrations/*.cs"]:::migration
            Snapshot["BiletContextModelSnapshot.cs"]:::migration
        end

        subgraph "Localization Resources"
            direction TB
            ResEN["SharedResource.en-US.resx"]:::resource
            ResTR["SharedResource.tr-TR.resx"]:::resource
        end

        subgraph "Static Assets (wwwroot)"
            direction TB
            CSS["css/*.css"]:::static
            JS["js/site.js"]:::static
            Images["images/*"]:::static
            Libs["lib/*"]:::static
        end

        subgraph "Configuration Files"
            direction TB
            AppSettings["appsettings.json"]:::config
            DevSettings["appsettings.Development.json"]:::config
            LaunchProfiles["launchSettings.json"]:::config
        end
    end

    %% Data Flows
    Browser -->|HTTP GET/POST| Host
    Host --> Controllers
    Controllers -->|injects| LanguageServices
    Controllers -->|injects| BiletContext
    BiletContext -->|SQL queries| Database
    Controllers -->|passes model| ViewsHome
    Controllers --> ViewsBilet
    Controllers --> ViewsAdmin
    Controllers --> ViewsKullanici
    Controllers --> ViewsSehir
    Controllers --> ViewsUcak
    Controllers --> ViewsUcus
    ViewsHome -->|renders HTML| Browser
    ViewsBilet --> Browser
    ViewsAdmin --> Browser
    ViewsKullanici --> Browser
    ViewsSehir --> Browser
    ViewsUcak --> Browser
    ViewsUcus --> Browser
    Browser -->|fetch static assets| CSS
    Browser --> JS
    Browser --> Images
    Browser --> Libs

    %% Click Events
    click Host "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Program.cs"
    click HomeController "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Controllers/HomeController.cs"
    click BiletController "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Controllers/BiletController.cs"
    click AdminController "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Controllers/AdminController.cs"
    click KullaniciController "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Controllers/KullaniciController.cs"
    click KullaniciApiController "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Controllers/KullaniciApiController.cs"
    click SehirController "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Controllers/SehirController.cs"
    click UcakController "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Controllers/UcakController.cs"
    click UcusController "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Controllers/UcusController.cs"
    click ViewsHome "https://github.com/byakif/akif-airlines/tree/master/WebOdev/Views/Home"
    click ViewsBilet "https://github.com/byakif/akif-airlines/tree/master/WebOdev/Views/Bilet"
    click ViewsAdmin "https://github.com/byakif/akif-airlines/tree/master/WebOdev/Views/Admin"
    click ViewsKullanici "https://github.com/byakif/akif-airlines/tree/master/WebOdev/Views/Kullanici"
    click ViewsSehir "https://github.com/byakif/akif-airlines/tree/master/WebOdev/Views/Sehir"
    click ViewsUcak "https://github.com/byakif/akif-airlines/tree/master/WebOdev/Views/Ucak"
    click ViewsUcus "https://github.com/byakif/akif-airlines/tree/master/WebOdev/Views/Ucus"
    click ViewsShared "https://github.com/byakif/akif-airlines/tree/master/WebOdev/Views/Shared"
    click LanguageServices "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Services/LanguageServices.cs"
    click BiletContext "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Models/BiletContext.cs"
    click Bilet "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Models/Bilet.cs"
    click Ucus "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Models/Ucus.cs"
    click Ucak "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Models/Ucak.cs"
    click Sehir "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Models/Sehir.cs"
    click Koltuk "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Models/Koltuk.cs"
    click Kullanici "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Models/Kullanici.cs"
    click Roller "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Models/Roller.cs"
    click AdminModel "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Models/Admin.cs"
    click MigrationsFiles "https://github.com/byakif/akif-airlines/tree/master/WebOdev/Migrations"
    click Snapshot "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Migrations/BiletContextModelSnapshot.cs"
    click ResEN "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Resources/SharedResource.en-US.resx"
    click ResTR "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Resources/SharedResource.tr-TR.resx"
    click CSS "https://github.com/byakif/akif-airlines/tree/master/WebOdev/wwwroot/css"
    click JS "https://github.com/byakif/akif-airlines/blob/master/WebOdev/wwwroot/js/site.js"
    click Images "https://github.com/byakif/akif-airlines/tree/master/WebOdev/wwwroot/images"
    click Libs "https://github.com/byakif/akif-airlines/tree/master/WebOdev/wwwroot/lib"
    click AppSettings "https://github.com/byakif/akif-airlines/blob/master/WebOdev/appsettings.json"
    click DevSettings "https://github.com/byakif/akif-airlines/blob/master/WebOdev/appsettings.Development.json"
    click LaunchProfiles "https://github.com/byakif/akif-airlines/blob/master/WebOdev/Properties/launchSettings.json"

    %% Styles
    classDef client fill:#BBDEFB,stroke:#1E88E5,color:#0D47A1
    classDef server fill:#C8E6C9,stroke:#388E3C,color:#1B5E20
    classDef controller fill:#FFE0B2,stroke:#FB8C00,color:#E65100
    classDef view fill:#F3E5F5,stroke:#8E24AA,color:#4A148C
    classDef service fill:#E1F5FE,stroke:#039BE5,color:#01579B
    classDef model fill:#FFEBEE,stroke:#E53935,color:#B71C1C
    classDef database fill:#FFF9C4,stroke:#FBC02D,color:#F57F17
    classDef migration fill:#E8EAF6,stroke:#3949AB,color:#1A237E
    classDef resource fill:#F1F8E9,stroke:#689F38,color:#33691E
    classDef static fill:#ECEFF1,stroke:#607D8B,color:#263238
    classDef config fill:#FFF3E0,stroke:#FB8C00,color:#E65100
```
