# arjuncodewave/instant_mechanic-booking-app architecture

> Architecture diagram of the GitHub repository arjuncodewave/instant_mechanic-booking-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arjuncodewave/instant_mechanic-booking-app
- Repository: https://github.com/arjuncodewave/instant_mechanic-booking-app

## Overview

Instant Mechanic is a SwiftUI mechanic-discovery and booking app backed by a FastAPI service. The documented user flow is to browse and search mechanics, inspect details, and proceed to a service request; the app fetches and displays mechanic data through its ViewModel. The backend exposes task/mechanic CRUD backed by SQLAlchemy. The booking screen shown in source navigates to a confirmation view, but no booking API is present in the sampled backend. Some view-to-view wiring is based on README descriptions rather than sampled view source.

Main entry points: [`Instant_Mechanic/Instant_Mechanic/View/ContentView.swift`](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/View/ContentView.swift) (Browse screen), [`Backend/src/tasks/controller.py`](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Backend/src/tasks/controller.py) (Mechanic operations), [`Instant_Mechanic/Instant_Mechanic/ViewModel/ProductViewModel.swift`](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/ViewModel/ProductViewModel.swift) (Product ViewModel), [`Backend/main.py`](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Backend/main.py) (FastAPI app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ios_ui["iOS experience"]
  node_app_entry["App entry"]
  node_browse["Browse screen<br/>[ContentView.swift]"]
  node_search["Search field"]
  node_mechanic_card["Mechanic card<br/>[CardView.swift]"]
  node_mechanic_detail["Mechanic details<br/>[DetailView.swift]"]
  node_service_request["Service request"]
  node_booking_done["Booking confirmation"]
end

subgraph group_ios_data["iOS data"]
  node_view_model["Product ViewModel"]
  node_filter["Product filter<br/>[Filter.swift]"]
  node_api_client["API client"]
  node_mechanic_model["Mechanic model<br/>[Model.swift]"]
end

subgraph group_backend_api["Backend API"]
  node_backend_app["FastAPI app<br/>[main.py]"]
  node_task_routes["Mechanic routes<br/>[router.py]"]
  node_task_controller["Mechanic operations<br/>[controller.py]"]
  node_task_schema["Mechanic schema<br/>[dtos.py]"]
end

subgraph group_backend_storage["Backend storage"]
  node_task_model["Mechanic record<br/>[models.py]"]
  node_db_session["Database session<br/>[db.py]"]
  node_mechanic_db[("Mechanic database")]
end

node_driver(("Mechanic seeker"))
node_api_service["Mechanic REST API"]

node_driver -->|"uses"| node_app_entry
node_app_entry -->|"opens"| node_browse
node_browse -->|"displays data"| node_view_model
node_browse -->|"offers search"| node_search
node_view_model -->|"filters mechanics"| node_filter
node_browse -->|"shows results"| node_mechanic_card
node_mechanic_card -->|"opens details"| node_mechanic_detail
node_mechanic_detail -->|"starts request"| node_service_request
node_service_request -->|"navigates"| node_booking_done
node_view_model -->|"fetches data"| node_api_client
node_api_client -->|"requests mechanics"| node_api_service
node_api_service -->|"HTTP request"| node_backend_app
node_backend_app -->|"mounts routes"| node_task_routes
node_task_routes -->|"dispatches"| node_task_controller
node_task_routes -->|"validates body"| node_task_schema
node_task_controller -->|"queries records"| node_task_model
node_task_controller -->|"uses session"| node_db_session
node_db_session -->|"connects"| node_mechanic_db
node_task_controller -->|"reads and writes"| node_mechanic_db
node_backend_app -->|"creates tables"| node_mechanic_db

click node_app_entry "https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/View/Instant_MechanicApp.swift"
click node_browse "https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/View/ContentView.swift"
click node_search "https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/View/SearchTextField.swift"
click node_mechanic_card "https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/View/CardView.swift"
click node_mechanic_detail "https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/View/DetailView.swift"
click node_service_request "https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/View/Requestservices.swift"
click node_booking_done "https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/View/CongatulationView.swift"
click node_view_model "https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/ViewModel/ProductViewModel.swift"
click node_filter "https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/ViewModel/Filter.swift"
click node_api_client "https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/Model/ProductDataService.swift"
click node_mechanic_model "https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/Model/Model.swift"
click node_backend_app "https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Backend/main.py"
click node_task_routes "https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Backend/src/tasks/router.py"
click node_task_controller "https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Backend/src/tasks/controller.py"
click node_task_schema "https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Backend/src/tasks/dtos.py"
click node_task_model "https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Backend/src/tasks/models.py"
click node_db_session "https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Backend/src/utils/db.py"

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_app_entry,node_browse,node_search,node_mechanic_card,node_mechanic_detail,node_service_request,node_booking_done toneBlue
class node_view_model,node_filter,node_api_client,node_mechanic_model toneAmber
class node_backend_app,node_task_routes,node_task_controller,node_task_schema,node_api_service toneMint
class node_task_model,node_db_session,node_mechanic_db toneRose
class node_driver toneIndigo
```

## Components

### iOS experience

- [App entry](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/View/Instant_MechanicApp.swift): `Instant_Mechanic/Instant_Mechanic/View/Instant_MechanicApp.swift`
- [Browse screen](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/View/ContentView.swift): `Instant_Mechanic/Instant_Mechanic/View/ContentView.swift`
- [Search field](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/View/SearchTextField.swift): `Instant_Mechanic/Instant_Mechanic/View/SearchTextField.swift`
- [Mechanic card](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/View/CardView.swift): `Instant_Mechanic/Instant_Mechanic/View/CardView.swift`
- [Mechanic details](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/View/DetailView.swift): `Instant_Mechanic/Instant_Mechanic/View/DetailView.swift`
- [Service request](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/View/Requestservices.swift): `Instant_Mechanic/Instant_Mechanic/View/Requestservices.swift`
- [Booking confirmation](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/View/CongatulationView.swift): `Instant_Mechanic/Instant_Mechanic/View/CongatulationView.swift`

### iOS data

- [Product ViewModel](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/ViewModel/ProductViewModel.swift): `Instant_Mechanic/Instant_Mechanic/ViewModel/ProductViewModel.swift`
- [Product filter](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/ViewModel/Filter.swift): `Instant_Mechanic/Instant_Mechanic/ViewModel/Filter.swift`
- [API client](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/Model/ProductDataService.swift): `Instant_Mechanic/Instant_Mechanic/Model/ProductDataService.swift`
- [Mechanic model](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Instant_Mechanic/Instant_Mechanic/Model/Model.swift): `Instant_Mechanic/Instant_Mechanic/Model/Model.swift`

### Backend API

- [FastAPI app](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Backend/main.py): `Backend/main.py`
- [Mechanic routes](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Backend/src/tasks/router.py): `Backend/src/tasks/router.py`
- [Mechanic operations](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Backend/src/tasks/controller.py): `Backend/src/tasks/controller.py`
- [Mechanic schema](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Backend/src/tasks/dtos.py): `Backend/src/tasks/dtos.py`

### Backend storage

- [Mechanic record](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Backend/src/tasks/models.py): `Backend/src/tasks/models.py`
- [Database session](https://github.com/arjuncodewave/instant_mechanic-booking-app/blob/main/Backend/src/utils/db.py): `Backend/src/utils/db.py`
- **Mechanic database**

### Other components

- **Mechanic seeker**
- **Mechanic REST API**

## Connections

- Mechanic seeker → App entry: uses
- App entry → Browse screen: opens
- Browse screen → Product ViewModel: displays data
- Browse screen → Search field: offers search
- Product ViewModel → Product filter: filters mechanics
- Browse screen → Mechanic card: shows results
- Mechanic card → Mechanic details: opens details
- Mechanic details → Service request: starts request
- Service request → Booking confirmation: navigates
- Product ViewModel → API client: fetches data
- API client → Mechanic REST API: requests mechanics
- Mechanic REST API → FastAPI app: HTTP request
- FastAPI app → Mechanic routes: mounts routes
- Mechanic routes → Mechanic operations: dispatches
- Mechanic routes → Mechanic schema: validates body
- Mechanic operations → Mechanic record: queries records
- Mechanic operations → Database session: uses session
- Database session → Mechanic database: connects
- Mechanic operations → Mechanic database: reads and writes
- FastAPI app → Mechanic database: creates tables
