# fylgja0/car-management-system architecture

> Architecture diagram of the GitHub repository fylgja0/car-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fylgja0/car-management-system
- Repository: https://github.com/fylgja0/car-management-system

## Overview

This is a console-based car management application. A user selects a menu action; Program starts UXManager, which coordinates UIManager prompts and CarCollection operations for viewing, adding, removing, and repricing cars. Car subtypes provide fuel or battery properties and range calculations. CarCollection persists records through an EF Core context configured for SQL Server, and seeds initial cars when the store is empty. The README also documents Code First migrations. Runtime relationships are based on excerpts and the source index; migration details are documented but not sampled.

Main entry points: [`Procedure/UXManager.cs`](https://github.com/fylgja0/car-management-system/blob/main/Procedure/UXManager.cs) (Action coordinator), [`Data/CarManagementDbContext.cs`](https://github.com/fylgja0/car-management-system/blob/main/Data/CarManagementDbContext.cs) (EF Core context), [`Concrete/HybridCar.cs`](https://github.com/fylgja0/car-management-system/blob/main/Concrete/HybridCar.cs) (Hybrid car), [`Base/Car.cs`](https://github.com/fylgja0/car-management-system/blob/main/Base/Car.cs) (Car base model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Console workflow"]
  node_program["Application entry<br/>[Program.cs]"]
  node_ux["Action coordinator<br/>[UXManager.cs]"]
  node_ui["Console interface<br/>[UIManager.cs]"]
end

subgraph group_domain["Car domain"]
  node_car["Car base model<br/>[Car.cs]"]
  node_gasoline["Gasoline car<br/>[GasolineCar.cs]"]
  node_electric["Electric car<br/>[ElectricCar.cs]"]
  node_hybrid["Hybrid car<br/>[HybridCar.cs]"]
  node_color["Car colors<br/>[CarColor.cs]"]
  node_fuel["Fuel capability<br/>[IFuel.cs]"]
  node_electricity["Electric capability<br/>[IElectric.cs]"]
end

subgraph group_persistence["Persistence"]
  node_collection["Car operations<br/>[CarCollection.cs]"]
  node_context["EF Core context"]
  node_sql[("SQL Server")]
end

subgraph group_schema["Database schema"]
  node_migrations["Code First migrations"]
end

node_user(("Console user"))

node_user -->|"starts"| node_program
node_program -->|"starts"| node_ux
node_ux -->|"renders prompts"| node_ui
node_user -->|"provides input"| node_ui
node_ux -->|"manages cars"| node_collection
node_ux -->|"creates"| node_gasoline
node_ux -->|"creates"| node_electric
node_ux -->|"creates"| node_hybrid
node_ui -->|"displays details"| node_car
node_car -->|"uses color"| node_color
node_gasoline -->|"extends"| node_car
node_electric -->|"extends"| node_car
node_hybrid -->|"extends"| node_car
node_gasoline -->|"implements"| node_fuel
node_electric -->|"implements"| node_electricity
node_hybrid -->|"implements"| node_fuel
node_hybrid -->|"implements"| node_electricity
node_collection -->|"queries and saves"| node_context
node_collection -->|"seeds cars"| node_gasoline
node_collection -->|"seeds cars"| node_electric
node_collection -->|"seeds cars"| node_hybrid
node_context -->|"configures provider"| node_sql
node_context -->|"maps entities"| node_car
node_context -->|"maps entities"| node_gasoline
node_context -->|"maps entities"| node_electric
node_context -->|"maps entities"| node_hybrid
node_migrations -->|"defines schema"| node_sql

click node_program "https://github.com/fylgja0/car-management-system/blob/main/Program.cs"
click node_ux "https://github.com/fylgja0/car-management-system/blob/main/Procedure/UXManager.cs"
click node_ui "https://github.com/fylgja0/car-management-system/blob/main/Procedure/UIManager.cs"
click node_car "https://github.com/fylgja0/car-management-system/blob/main/Base/Car.cs"
click node_gasoline "https://github.com/fylgja0/car-management-system/blob/main/Concrete/GasolineCar.cs"
click node_electric "https://github.com/fylgja0/car-management-system/blob/main/Concrete/ElectricCar.cs"
click node_hybrid "https://github.com/fylgja0/car-management-system/blob/main/Concrete/HybridCar.cs"
click node_color "https://github.com/fylgja0/car-management-system/blob/main/Enums/CarColor.cs"
click node_fuel "https://github.com/fylgja0/car-management-system/blob/main/Interface/IFuel.cs"
click node_electricity "https://github.com/fylgja0/car-management-system/blob/main/Interface/IElectric.cs"
click node_collection "https://github.com/fylgja0/car-management-system/blob/main/Data/CarCollection.cs"
click node_context "https://github.com/fylgja0/car-management-system/blob/main/Data/CarManagementDbContext.cs"
click node_migrations "https://github.com/fylgja0/car-management-system/tree/main/Migrations"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_program,node_ux,node_ui,node_user toneBlue
class node_car,node_gasoline,node_electric,node_hybrid,node_color,node_fuel,node_electricity toneAmber
class node_collection,node_context,node_sql toneMint
class node_migrations toneRose
```

## Components

### Console workflow

- [Application entry](https://github.com/fylgja0/car-management-system/blob/main/Program.cs): `Program.cs`
- [Action coordinator](https://github.com/fylgja0/car-management-system/blob/main/Procedure/UXManager.cs): `Procedure/UXManager.cs`
- [Console interface](https://github.com/fylgja0/car-management-system/blob/main/Procedure/UIManager.cs): `Procedure/UIManager.cs`

### Car domain

- [Car base model](https://github.com/fylgja0/car-management-system/blob/main/Base/Car.cs): `Base/Car.cs`
- [Gasoline car](https://github.com/fylgja0/car-management-system/blob/main/Concrete/GasolineCar.cs): `Concrete/GasolineCar.cs`
- [Electric car](https://github.com/fylgja0/car-management-system/blob/main/Concrete/ElectricCar.cs): `Concrete/ElectricCar.cs`
- [Hybrid car](https://github.com/fylgja0/car-management-system/blob/main/Concrete/HybridCar.cs): `Concrete/HybridCar.cs`
- [Car colors](https://github.com/fylgja0/car-management-system/blob/main/Enums/CarColor.cs): `Enums/CarColor.cs`
- [Fuel capability](https://github.com/fylgja0/car-management-system/blob/main/Interface/IFuel.cs): `Interface/IFuel.cs`
- [Electric capability](https://github.com/fylgja0/car-management-system/blob/main/Interface/IElectric.cs): `Interface/IElectric.cs`

### Persistence

- [Car operations](https://github.com/fylgja0/car-management-system/blob/main/Data/CarCollection.cs): `Data/CarCollection.cs`
- [EF Core context](https://github.com/fylgja0/car-management-system/blob/main/Data/CarManagementDbContext.cs): `Data/CarManagementDbContext.cs`
- **SQL Server**

### Database schema

- [Code First migrations](https://github.com/fylgja0/car-management-system/tree/main/Migrations): `Migrations`

### Other components

- **Console user**

## Connections

- Console user → Application entry: starts (evidence: `README.md`)
- Application entry → Action coordinator: starts (evidence: `Program.cs`)
- Action coordinator → Console interface: renders prompts (evidence: `Procedure/UXManager.cs`)
- Console user → Console interface: provides input (evidence: `README.md`)
- Action coordinator → Car operations: manages cars (evidence: `Procedure/UXManager.cs`)
- Action coordinator → Gasoline car: creates (evidence: `Procedure/UXManager.cs`)
- Action coordinator → Electric car: creates (evidence: `Procedure/UXManager.cs`)
- Action coordinator → Hybrid car: creates (evidence: `Procedure/UXManager.cs`)
- Console interface → Car base model: displays details (evidence: `Procedure/UIManager.cs`)
- Car base model → Car colors: uses color (evidence: `Base/Car.cs`)
- Gasoline car → Car base model: extends (evidence: `Concrete/GasolineCar.cs`)
- Electric car → Car base model: extends (evidence: `Concrete/ElectricCar.cs`)
- Hybrid car → Car base model: extends (evidence: `Concrete/HybridCar.cs`)
- Gasoline car → Fuel capability: implements (evidence: `Concrete/GasolineCar.cs`)
- Electric car → Electric capability: implements (evidence: `Concrete/ElectricCar.cs`)
- Hybrid car → Fuel capability: implements (evidence: `Concrete/HybridCar.cs`)
- Hybrid car → Electric capability: implements (evidence: `Concrete/HybridCar.cs`)
- Car operations → EF Core context: queries and saves (evidence: `Data/CarCollection.cs`)
- Car operations → Gasoline car: seeds cars (evidence: `Data/CarCollection.cs`)
- Car operations → Electric car: seeds cars (evidence: `Data/CarCollection.cs`)
- Car operations → Hybrid car: seeds cars (evidence: `Data/CarCollection.cs`)
- EF Core context → SQL Server: configures provider (evidence: `Data/CarManagementDbContext.cs`)
- EF Core context → Car base model: maps entities (evidence: `Data/CarManagementDbContext.cs`)
- EF Core context → Gasoline car: maps entities (evidence: `Data/CarManagementDbContext.cs`)
- EF Core context → Electric car: maps entities (evidence: `Data/CarManagementDbContext.cs`)
- EF Core context → Hybrid car: maps entities (evidence: `Data/CarManagementDbContext.cs`)
- Code First migrations → SQL Server: defines schema (evidence: `README.md`)
