# saidabdalsalam/mechanic-shop architecture

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

- Interactive diagram: https://gitdiagram.com/saidabdalsalam/mechanic-shop
- Repository: https://github.com/saidabdalsalam/mechanic-shop

## Overview

MechanicShop is a repair-shop management API. Staff-facing requests enter through API controllers and use application handlers to manage customers and vehicles, define repair work, schedule and track work orders, and issue or settle invoices; identity and dashboard capabilities support those operations. Domain entities enforce core rules, while the infrastructure project provides persistence and integrations. The README only names the product, so several feature links below are marked unverified; the sampled handlers establish specific database and PDF-service dependencies.

Main entry points: [`src/MechanicShop.Api/Controllers`](https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Api/Controllers) (Other endpoints), [`src/MechanicShop.Application/Common/Interfaces/IAppDbContext.cs`](https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Application/Common/Interfaces/IAppDbContext.cs) (Persistence contract), [`src/MechanicShop.Domain/Entities`](https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Domain/Entities) (Shop domain), [`src/MechanicShop.Api/Program.cs`](https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Api/Program.cs) (HTTP API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API entry"]
  node_api["HTTP API<br/>[Program.cs]"]
  node_workapi["Work-order endpoints"]
  node_customerapi["Customer endpoints"]
  node_otherapi["Other endpoints<br/>[Controllers]"]
end

subgraph group_operations["Shop operations"]
  node_workorders["Work orders<br/>[WorkOrders]"]
  node_scheduling["Daily schedule"]
  node_repairtasks["Repair tasks<br/>[RepairTasks]"]
end

subgraph group_business["Business capabilities"]
  node_customers["Customers and vehicles<br/>[Customers]"]
  node_employees["Employee management<br/>[Employees]"]
  node_dashboard["Shop dashboard"]
  node_invoices["Invoices and PDFs<br/>[Invoices]"]
end

subgraph group_domain["Domain and persistence"]
  node_domainmodel["Shop domain<br/>[Entities]"]
  node_dbcontract["Persistence contract<br/>[IAppDbContext.cs]"]
  node_database[("Shop database<br/>[AppDbContext.cs]")]
end

subgraph group_integrations["Identity and integrations"]
  node_identity["Authentication<br/>[Identity]"]
  node_identityservice["Identity service<br/>[IdentityService.cs]"]
  node_pdfgenerator["Invoice PDF generator"]
  node_notifier["Work-order notifications"]
  node_hub["Live updates hub<br/>[WorkOrderHub.cs]"]
end

node_staff(("Shop staff"))

node_staff -.->|"sends requests"| node_api
node_api -.->|"routes requests"| node_workapi
node_api -.->|"routes requests"| node_customerapi
node_api -.->|"routes requests"| node_otherapi
node_workapi -->|"dispatches queries"| node_workorders
node_customerapi -->|"dispatches commands"| node_customers
node_workapi -->|"dispatches schedule query"| node_scheduling
node_otherapi -.->|"dispatches requests"| node_repairtasks
node_otherapi -.->|"dispatches requests"| node_employees
node_otherapi -.->|"dispatches requests"| node_dashboard
node_otherapi -.->|"dispatches requests"| node_invoices
node_otherapi -.->|"dispatches requests"| node_identity
node_workorders -.->|"queries and saves"| node_dbcontract
node_scheduling -->|"queries work orders"| node_dbcontract
node_dashboard -->|"queries statistics"| node_dbcontract
node_invoices -->|"reads invoice data"| node_dbcontract
node_invoices -->|"requests PDF"| node_pdfgenerator
node_identity -->|"uses identity service"| node_identityservice
node_identity -->|"reads and saves tokens"| node_dbcontract
node_dbcontract -.->|"implemented by"| node_database
node_workorders -.->|"uses work-order rules"| node_domainmodel
node_customers -.->|"uses customer rules"| node_domainmodel
node_repairtasks -.->|"uses repair-task rules"| node_domainmodel
node_employees -.->|"uses employee rules"| node_domainmodel
node_invoices -.->|"uses invoice rules"| node_domainmodel
node_identity -.->|"uses identity entities"| node_domainmodel
node_api -->|"registers hub"| node_hub
node_notifier -.->|"publishes updates"| node_hub

click node_api "https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Api/Program.cs"
click node_workapi "https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Api/Controllers/WorkOrdersController.cs"
click node_customerapi "https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Api/Controllers/CustomersController.cs"
click node_otherapi "https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Api/Controllers"
click node_workorders "https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Application/Features/WorkOrders"
click node_scheduling "https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Application/Features/Scheduling/Queries/GetDailyScheduleQuery/GetDailyScheduleQueryHandler.cs"
click node_repairtasks "https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Application/Features/RepairTasks"
click node_customers "https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Application/Features/Customers"
click node_employees "https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Application/Features/Employees"
click node_dashboard "https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Application/Features/Dashboard/Queries/GetWorkOrderStats/GetWorkOrderStatsQueryHandler.cs"
click node_invoices "https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Application/Features/Invoices"
click node_identity "https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Application/Features/Identity"
click node_domainmodel "https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Domain/Entities"
click node_dbcontract "https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Application/Common/Interfaces/IAppDbContext.cs"
click node_database "https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Infrastructure/Data/AppDbContext.cs"
click node_identityservice "https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Infrastructure/Identity/IdentityService.cs"
click node_pdfgenerator "https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Infrastructure/Services/InvoicePdfGenerator.cs"
click node_notifier "https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Infrastructure/RealTime/SignalRWorkOrderNotifier.cs"
click node_hub "https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Infrastructure/RealTime/WorkOrderHub.cs"

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_api,node_workapi,node_customerapi,node_otherapi toneBlue
class node_workorders,node_scheduling,node_repairtasks toneAmber
class node_customers,node_employees,node_dashboard,node_invoices toneMint
class node_domainmodel,node_dbcontract,node_database toneRose
class node_identity,node_identityservice,node_pdfgenerator,node_notifier,node_hub,node_staff toneIndigo
```

## Components

### API entry

- [HTTP API](https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Api/Program.cs): `src/MechanicShop.Api/Program.cs`
- [Work-order endpoints](https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Api/Controllers/WorkOrdersController.cs): `src/MechanicShop.Api/Controllers/WorkOrdersController.cs`
- [Customer endpoints](https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Api/Controllers/CustomersController.cs): `src/MechanicShop.Api/Controllers/CustomersController.cs`
- [Other endpoints](https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Api/Controllers): `src/MechanicShop.Api/Controllers`

### Shop operations

- [Work orders](https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Application/Features/WorkOrders): `src/MechanicShop.Application/Features/WorkOrders`
- [Daily schedule](https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Application/Features/Scheduling/Queries/GetDailyScheduleQuery/GetDailyScheduleQueryHandler.cs): `src/MechanicShop.Application/Features/Scheduling/Queries/GetDailyScheduleQuery/GetDailyScheduleQueryHandler.cs`
- [Repair tasks](https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Application/Features/RepairTasks): `src/MechanicShop.Application/Features/RepairTasks`

### Business capabilities

- [Customers and vehicles](https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Application/Features/Customers): `src/MechanicShop.Application/Features/Customers`
- [Employee management](https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Application/Features/Employees): `src/MechanicShop.Application/Features/Employees`
- [Shop dashboard](https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Application/Features/Dashboard/Queries/GetWorkOrderStats/GetWorkOrderStatsQueryHandler.cs): `src/MechanicShop.Application/Features/Dashboard/Queries/GetWorkOrderStats/GetWorkOrderStatsQueryHandler.cs`
- [Invoices and PDFs](https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Application/Features/Invoices): `src/MechanicShop.Application/Features/Invoices`

### Domain and persistence

- [Shop domain](https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Domain/Entities): `src/MechanicShop.Domain/Entities`
- [Persistence contract](https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Application/Common/Interfaces/IAppDbContext.cs): `src/MechanicShop.Application/Common/Interfaces/IAppDbContext.cs`
- [Shop database](https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Infrastructure/Data/AppDbContext.cs): `src/MechanicShop.Infrastructure/Data/AppDbContext.cs`

### Identity and integrations

- [Authentication](https://github.com/saidabdalsalam/mechanic-shop/tree/main/src/MechanicShop.Application/Features/Identity): `src/MechanicShop.Application/Features/Identity`
- [Identity service](https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Infrastructure/Identity/IdentityService.cs): `src/MechanicShop.Infrastructure/Identity/IdentityService.cs`
- [Invoice PDF generator](https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Infrastructure/Services/InvoicePdfGenerator.cs): `src/MechanicShop.Infrastructure/Services/InvoicePdfGenerator.cs`
- [Work-order notifications](https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Infrastructure/RealTime/SignalRWorkOrderNotifier.cs): `src/MechanicShop.Infrastructure/RealTime/SignalRWorkOrderNotifier.cs`
- [Live updates hub](https://github.com/saidabdalsalam/mechanic-shop/blob/main/src/MechanicShop.Infrastructure/RealTime/WorkOrderHub.cs): `src/MechanicShop.Infrastructure/RealTime/WorkOrderHub.cs`

### Other components

- **Shop staff**

## Connections

- Shop staff → HTTP API: sends requests
- HTTP API → Work-order endpoints: routes requests
- HTTP API → Customer endpoints: routes requests
- HTTP API → Other endpoints: routes requests
- Work-order endpoints → Work orders: dispatches queries (evidence: `src/MechanicShop.Api/Controllers/WorkOrdersController.cs`)
- Customer endpoints → Customers and vehicles: dispatches commands (evidence: `src/MechanicShop.Api/Controllers/CustomersController.cs`)
- Work-order endpoints → Daily schedule: dispatches schedule query (evidence: `src/MechanicShop.Api/Controllers/WorkOrdersController.cs`)
- Other endpoints → Repair tasks: dispatches requests (evidence: `src/MechanicShop.Api/Controllers/RepairTasksController.cs`)
- Other endpoints → Employee management: dispatches requests
- Other endpoints → Shop dashboard: dispatches requests
- Other endpoints → Invoices and PDFs: dispatches requests
- Other endpoints → Authentication: dispatches requests
- Work orders → Persistence contract: queries and saves (evidence: `src/MechanicShop.Application/Features/WorkOrders/Queries/GetWorkOrders/GetWorkOrdersQueryHandler.cs`)
- Daily schedule → Persistence contract: queries work orders (evidence: `src/MechanicShop.Application/Features/Scheduling/Queries/GetDailyScheduleQuery/GetDailyScheduleQueryHandler.cs`)
- Shop dashboard → Persistence contract: queries statistics (evidence: `src/MechanicShop.Application/Features/Dashboard/Queries/GetWorkOrderStats/GetWorkOrderStatsQueryHandler.cs`)
- Invoices and PDFs → Persistence contract: reads invoice data (evidence: `src/MechanicShop.Application/Features/Invoices/Queries/GetInvoiceById/GetInvoiceByIdQueryHandler.cs`)
- Invoices and PDFs → Invoice PDF generator: requests PDF (evidence: `src/MechanicShop.Application/Features/Invoices/Queries/GetInvoicePdf/GetInvoicePdfQueryHandler.cs`)
- Authentication → Identity service: uses identity service (evidence: `src/MechanicShop.Application/Features/Identity/Queries/GenerateToken/GenerateTokenQueryHandler.cs`)
- Authentication → Persistence contract: reads and saves tokens (evidence: `src/MechanicShop.Application/Features/Identity/Queries/GenerateToken/GenerateTokenQueryHandler.cs`)
- Persistence contract → Shop database: implemented by
- Work orders → Shop domain: uses work-order rules (evidence: `src/MechanicShop.Application/Features/WorkOrders/Queries/GetWorkOrders/GetWorkOrdersQueryHandler.cs`)
- Customers and vehicles → Shop domain: uses customer rules
- Repair tasks → Shop domain: uses repair-task rules
- Employee management → Shop domain: uses employee rules (evidence: `src/MechanicShop.Application/Features/Employees/Queries/GetEmployeeById/GetEmployeesQueryByIdHandler.cs`)
- Invoices and PDFs → Shop domain: uses invoice rules (evidence: `src/MechanicShop.Application/Features/Invoices/Queries/GetInvoicePdf/GetInvoicePdfQueryHandler.cs`)
- Authentication → Shop domain: uses identity entities (evidence: `src/MechanicShop.Application/Features/Identity/Queries/RefreshTokens/RefreshTokenQueryHandler.cs`)
- HTTP API → Live updates hub: registers hub (evidence: `src/MechanicShop.Api/Program.cs`)
- Work-order notifications → Live updates hub: publishes updates
