# mehedi-200/garageflow-api architecture

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

- Interactive diagram: https://gitdiagram.com/mehedi-200/garageflow-api
- Repository: https://github.com/mehedi-200/garageflow-api

## Overview

GarageFlow is a Laravel API for garage service management. Its main workflow moves authenticated garage users through customer and vehicle records into service-job intake, mechanic assignment, status progression, parts, invoicing, and payment. Controllers delegate business operations to services, which use Eloquent models; resources and a shared response envelope shape API output. The README documents dashboard, grouped search, and notifications as additional capabilities. Some controllers and services were not excerpted, so their internal calls are shown only where the index or README supports them.

Main entry points: [`app/Http/Controllers`](https://github.com/mehedi-200/garageflow-api/tree/main/app/Http/Controllers) (API controllers), [`app/Services/ServiceJobService.php`](https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/ServiceJobService.php) (Job workflow), [`app/Models/ServiceJob.php`](https://github.com/mehedi-200/garageflow-api/blob/main/app/Models/ServiceJob.php) (Jobs and service items), [`app/Services/InvoiceService.php`](https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/InvoiceService.php) (Invoice processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API access"]
  node_api_routes["API routes<br/>[api.php]"]
  node_role_gate["Role middleware<br/>[EnsureRole.php]"]
  node_controllers["API controllers"]
  node_response["Response envelope<br/>[ApiResponse.php]"]
end

subgraph group_records["Garage records"]
  node_customer["Customer management"]
  node_vehicle["Vehicle registry<br/>[VehicleService.php]"]
  node_records_store[("Customer and vehicle data<br/>[Customer.php]")]
end

subgraph group_operations["Job operations"]
  node_job_service["Job workflow"]
  node_job_controller["Job endpoints"]
  node_job_data[("Jobs and service items<br/>[ServiceJob.php]")]
  node_job_output["Job response resource"]
end

subgraph group_finance["Billing and insights"]
  node_invoice_service["Invoice processing<br/>[InvoiceService.php]"]
  node_invoice_controller["Invoice endpoints"]
  node_invoice_data[("Invoice records<br/>[Invoice.php]")]
  node_dashboard["Dashboard metrics"]
  node_search["Grouped search<br/>[SearchService.php]"]
end

subgraph group_identity["Identity and alerts"]
  node_auth["Authentication<br/>[AuthService.php]"]
  node_user_data[("Users and roles<br/>[User.php]")]
  node_notifications["Notifications"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_api_routes
node_api_routes -->|"applies roles"| node_role_gate
node_api_routes -->|"routes to"| node_controllers
node_controllers -->|"formats responses"| node_response
node_controllers -->|"delegates customer work"| node_customer
node_controllers -->|"delegates vehicle work"| node_vehicle
node_controllers -->|"delegates job work"| node_job_service
node_job_controller -->|"changes job status"| node_job_service
node_job_controller -->|"serializes jobs"| node_job_output
node_job_output -->|"renders job fields"| node_job_data
node_job_output -->|"renders loaded invoice"| node_invoice_data
node_job_service -->|"creates completion invoice"| node_invoice_service
node_job_service -->|"sends job alerts"| node_notifications
node_invoice_controller -->|"delegates invoice work"| node_invoice_service
node_invoice_service -->|"creates and updates"| node_invoice_data
node_invoice_service -->|"alerts admins on payment"| node_notifications
node_customer -.->|"manages customer records"| node_records_store
node_vehicle -.->|"manages vehicle records"| node_records_store
node_job_data -->|"relates vehicle"| node_records_store
node_job_data -->|"relates mechanic"| node_user_data
node_dashboard -.->|"provides dashboard metrics"| node_controllers
node_search -->|"searches customers and vehicles"| node_records_store
node_search -->|"searches jobs"| node_job_data
node_search -->|"searches invoices"| node_invoice_data
node_auth -->|"authenticates users"| node_user_data
node_client -.->|"authenticates"| node_auth

click node_api_routes "https://github.com/mehedi-200/garageflow-api/blob/main/routes/api.php"
click node_role_gate "https://github.com/mehedi-200/garageflow-api/blob/main/app/Http/Middleware/EnsureRole.php"
click node_controllers "https://github.com/mehedi-200/garageflow-api/tree/main/app/Http/Controllers"
click node_response "https://github.com/mehedi-200/garageflow-api/blob/main/app/Traits/ApiResponse.php"
click node_customer "https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/CustomerService.php"
click node_vehicle "https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/VehicleService.php"
click node_records_store "https://github.com/mehedi-200/garageflow-api/blob/main/app/Models/Customer.php"
click node_job_service "https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/ServiceJobService.php"
click node_job_controller "https://github.com/mehedi-200/garageflow-api/blob/main/app/Http/Controllers/ServiceJobController.php"
click node_job_data "https://github.com/mehedi-200/garageflow-api/blob/main/app/Models/ServiceJob.php"
click node_job_output "https://github.com/mehedi-200/garageflow-api/blob/main/app/Http/Resources/ServiceJobResource.php"
click node_invoice_service "https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/InvoiceService.php"
click node_invoice_controller "https://github.com/mehedi-200/garageflow-api/blob/main/app/Http/Controllers/InvoiceController.php"
click node_invoice_data "https://github.com/mehedi-200/garageflow-api/blob/main/app/Models/Invoice.php"
click node_dashboard "https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/DashboardService.php"
click node_search "https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/SearchService.php"
click node_auth "https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/AuthService.php"
click node_user_data "https://github.com/mehedi-200/garageflow-api/blob/main/app/Models/User.php"
click node_notifications "https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/NotificationService.php"

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_routes,node_role_gate,node_controllers,node_response,node_client toneBlue
class node_customer,node_vehicle,node_records_store toneAmber
class node_job_service,node_job_controller,node_job_data,node_job_output toneMint
class node_invoice_service,node_invoice_controller,node_invoice_data,node_dashboard,node_search toneRose
class node_auth,node_user_data,node_notifications toneIndigo
```

## Components

### API access

- [API routes](https://github.com/mehedi-200/garageflow-api/blob/main/routes/api.php): `routes/api.php`
- [Role middleware](https://github.com/mehedi-200/garageflow-api/blob/main/app/Http/Middleware/EnsureRole.php): `app/Http/Middleware/EnsureRole.php`
- [API controllers](https://github.com/mehedi-200/garageflow-api/tree/main/app/Http/Controllers): `app/Http/Controllers`
- [Response envelope](https://github.com/mehedi-200/garageflow-api/blob/main/app/Traits/ApiResponse.php): `app/Traits/ApiResponse.php`

### Garage records

- [Customer management](https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/CustomerService.php): `app/Services/CustomerService.php`
- [Vehicle registry](https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/VehicleService.php): `app/Services/VehicleService.php`
- [Customer and vehicle data](https://github.com/mehedi-200/garageflow-api/blob/main/app/Models/Customer.php): `app/Models/Customer.php`

### Job operations

- [Job workflow](https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/ServiceJobService.php): `app/Services/ServiceJobService.php`
- [Job endpoints](https://github.com/mehedi-200/garageflow-api/blob/main/app/Http/Controllers/ServiceJobController.php): `app/Http/Controllers/ServiceJobController.php`
- [Jobs and service items](https://github.com/mehedi-200/garageflow-api/blob/main/app/Models/ServiceJob.php): `app/Models/ServiceJob.php`
- [Job response resource](https://github.com/mehedi-200/garageflow-api/blob/main/app/Http/Resources/ServiceJobResource.php): `app/Http/Resources/ServiceJobResource.php`

### Billing and insights

- [Invoice processing](https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/InvoiceService.php): `app/Services/InvoiceService.php`
- [Invoice endpoints](https://github.com/mehedi-200/garageflow-api/blob/main/app/Http/Controllers/InvoiceController.php): `app/Http/Controllers/InvoiceController.php`
- [Invoice records](https://github.com/mehedi-200/garageflow-api/blob/main/app/Models/Invoice.php): `app/Models/Invoice.php`
- [Dashboard metrics](https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/DashboardService.php): `app/Services/DashboardService.php`
- [Grouped search](https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/SearchService.php): `app/Services/SearchService.php`

### Identity and alerts

- [Authentication](https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/AuthService.php): `app/Services/AuthService.php`
- [Users and roles](https://github.com/mehedi-200/garageflow-api/blob/main/app/Models/User.php): `app/Models/User.php`
- [Notifications](https://github.com/mehedi-200/garageflow-api/blob/main/app/Services/NotificationService.php): `app/Services/NotificationService.php`

### Other components

- **API client**

## Connections

- API client → API routes: sends requests (evidence: `README.md`)
- API routes → Role middleware: applies roles (evidence: `routes/api.php`)
- API routes → API controllers: routes to (evidence: `routes/api.php`)
- API controllers → Response envelope: formats responses (evidence: `app/Http/Controllers/CustomerController.php`)
- API controllers → Customer management: delegates customer work (evidence: `app/Http/Controllers/CustomerController.php`)
- API controllers → Vehicle registry: delegates vehicle work (evidence: `app/Http/Controllers/VehicleController.php`)
- API controllers → Job workflow: delegates job work (evidence: `app/Http/Controllers/ServiceJobController.php`)
- Job endpoints → Job workflow: changes job status (evidence: `app/Http/Controllers/ServiceJobController.php`)
- Job endpoints → Job response resource: serializes jobs (evidence: `app/Http/Controllers/ServiceJobController.php`)
- Job response resource → Jobs and service items: renders job fields (evidence: `app/Http/Resources/ServiceJobResource.php`)
- Job response resource → Invoice records: renders loaded invoice (evidence: `app/Http/Resources/ServiceJobResource.php`)
- Job workflow → Invoice processing: creates completion invoice (evidence: `app/Services/ServiceJobService.php`)
- Job workflow → Notifications: sends job alerts (evidence: `app/Services/ServiceJobService.php`)
- Invoice endpoints → Invoice processing: delegates invoice work (evidence: `app/Http/Controllers/InvoiceController.php`)
- Invoice processing → Invoice records: creates and updates (evidence: `app/Services/InvoiceService.php`)
- Invoice processing → Notifications: alerts admins on payment (evidence: `app/Services/InvoiceService.php`)
- Customer management → Customer and vehicle data: manages customer records
- Vehicle registry → Customer and vehicle data: manages vehicle records
- Jobs and service items → Customer and vehicle data: relates vehicle (evidence: `app/Models/Vehicle.php`)
- Jobs and service items → Users and roles: relates mechanic (evidence: `app/Models/ServiceJob.php`)
- Dashboard metrics → API controllers: provides dashboard metrics (evidence: `README.md`)
- Grouped search → Customer and vehicle data: searches customers and vehicles (evidence: `app/Services/SearchService.php`)
- Grouped search → Jobs and service items: searches jobs (evidence: `app/Services/SearchService.php`)
- Grouped search → Invoice records: searches invoices (evidence: `app/Services/SearchService.php`)
- Authentication → Users and roles: authenticates users (evidence: `app/Services/AuthService.php`)
- API client → Authentication: authenticates (evidence: `README.md`)
