# husseizo/garage-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/husseizo/garage-management-system
- Repository: https://github.com/husseizo/garage-management-system

## Overview

GMS is a foundation-stage garage management web app: customers can enter public booking, tracking, and portal routes, while staff sign in to a dashboard for garage operations. The README describes booking, scheduling, reminders, notifications, and reporting, but says those business features remain unimplemented; their routes and modules are represented as planned capability areas, not asserted runtime pipelines. Customer and vehicle services, staff authorization, database access, and localization have source evidence. Several other links are omitted or marked unverified because their implementation was not sampled.

Main entry points: [`src/modules/customers/service.ts`](https://github.com/husseizo/garage-management-system/blob/main/src/modules/customers/service.ts) (Customer services), [`src/modules/vehicles/service.ts`](https://github.com/husseizo/garage-management-system/blob/main/src/modules/vehicles/service.ts) (Vehicle services), [`src/server/auth/guards.ts`](https://github.com/husseizo/garage-management-system/blob/main/src/server/auth/guards.ts) (Staff access guards), [`src/app/dashboard/page.tsx`](https://github.com/husseizo/garage-management-system/blob/main/src/app/dashboard/page.tsx) (Staff dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_public["Public pages<br/>[page.tsx]"]
  node_booking_ui["Guest booking<br/>[page.tsx]"]
  node_tracking["Appointment tracking<br/>[page.tsx]"]
  node_portal["Customer portal<br/>[page.tsx]"]
  node_login["Staff sign-in<br/>[page.tsx]"]
  node_dashboard["Staff dashboard<br/>[page.tsx]"]
  node_customer_pages["Customer records UI<br/>[page.tsx]"]
  node_vehicle_pages["Vehicle records UI<br/>[page.tsx]"]
  node_search["Dashboard search<br/>[page.tsx]"]
  node_booking_ops["Booking operations<br/>[page.tsx]"]
  node_calendar["Appointment calendar<br/>[page.tsx]"]
  node_ops_pages["Garage operations pages<br/>[page.tsx]"]
  node_reminder_page["Reminder page<br/>[page.tsx]"]
end

subgraph group_identity["Staff identity"]
  node_auth["Auth session<br/>[auth.ts]"]
  node_guards["Staff access guards<br/>[guards.ts]"]
  node_roles["Role permissions<br/>[permissions.ts]"]
end

subgraph group_domain["Garage records"]
  node_customers["Customer services<br/>[service.ts]"]
  node_vehicles["Vehicle services<br/>[service.ts]"]
  node_booking_module["Booking module<br/>[index.ts]"]
  node_scheduling["Capacity scheduling<br/>[index.ts]"]
  node_reminders["Service reminders<br/>[index.ts]"]
  node_notifications["Notifications<br/>[index.ts]"]
end

subgraph group_platform["Shared platform"]
  node_db[("Neon database access<br/>[client.ts]")]
  node_garage_profile["Garage profile<br/>[garage.ts]"]
  node_i18n["Localization<br/>[server.ts]"]
end

node_customer(("Customer"))
node_staff(("Garage staff"))

node_customer -->|"visits"| node_public
node_customer -.->|"requests service"| node_booking_ui
node_customer -.->|"checks appointment"| node_tracking
node_customer -.->|"views history"| node_portal
node_staff -->|"signs in"| node_login
node_staff -->|"uses"| node_dashboard
node_login -->|"uses redirects"| node_auth
node_auth -->|"validates session"| node_guards
node_guards -->|"checks permissions"| node_roles
node_dashboard -->|"requires staff"| node_guards
node_customer_pages -->|"checks access"| node_guards
node_customer_pages -->|"reads records"| node_customers
node_vehicle_pages -->|"reads records"| node_vehicles
node_search -->|"searches customers"| node_customers
node_search -->|"searches vehicles"| node_vehicles
node_customers -->|"queries and writes"| node_db
node_vehicles -->|"queries and writes"| node_db
node_garage_profile -->|"reads profile"| node_db
node_customers -->|"gets region"| node_garage_profile
node_vehicles -->|"gets settings"| node_garage_profile
node_booking_ui -.->|"submits booking"| node_booking_module
node_booking_ops -.->|"manages requests"| node_booking_module
node_calendar -.->|"uses capacity scheduling"| node_scheduling
node_reminder_page -.->|"manages reminders"| node_reminders
node_reminders -.->|"dispatches notices"| node_notifications
node_ops_pages -.->|"supports bay capacity"| node_scheduling
node_dashboard -->|"loads translations"| node_i18n

click node_public "https://github.com/husseizo/garage-management-system/blob/main/src/app/(public)/page.tsx"
click node_booking_ui "https://github.com/husseizo/garage-management-system/blob/main/src/app/(public)/book/page.tsx"
click node_tracking "https://github.com/husseizo/garage-management-system/blob/main/src/app/(public)/track/page.tsx"
click node_portal "https://github.com/husseizo/garage-management-system/blob/main/src/app/(public)/portal/page.tsx"
click node_login "https://github.com/husseizo/garage-management-system/blob/main/src/app/(auth)/login/page.tsx"
click node_dashboard "https://github.com/husseizo/garage-management-system/blob/main/src/app/dashboard/page.tsx"
click node_customer_pages "https://github.com/husseizo/garage-management-system/blob/main/src/app/dashboard/customers/page.tsx"
click node_vehicle_pages "https://github.com/husseizo/garage-management-system/blob/main/src/app/dashboard/vehicles/page.tsx"
click node_search "https://github.com/husseizo/garage-management-system/blob/main/src/app/dashboard/search/page.tsx"
click node_booking_ops "https://github.com/husseizo/garage-management-system/blob/main/src/app/dashboard/bookings/page.tsx"
click node_calendar "https://github.com/husseizo/garage-management-system/blob/main/src/app/dashboard/calendar/page.tsx"
click node_ops_pages "https://github.com/husseizo/garage-management-system/blob/main/src/app/dashboard/technicians/page.tsx"
click node_reminder_page "https://github.com/husseizo/garage-management-system/blob/main/src/app/dashboard/reminders/page.tsx"
click node_auth "https://github.com/husseizo/garage-management-system/blob/main/src/server/auth/auth.ts"
click node_guards "https://github.com/husseizo/garage-management-system/blob/main/src/server/auth/guards.ts"
click node_roles "https://github.com/husseizo/garage-management-system/blob/main/src/modules/staff/permissions.ts"
click node_customers "https://github.com/husseizo/garage-management-system/blob/main/src/modules/customers/service.ts"
click node_vehicles "https://github.com/husseizo/garage-management-system/blob/main/src/modules/vehicles/service.ts"
click node_booking_module "https://github.com/husseizo/garage-management-system/blob/main/src/modules/bookings/index.ts"
click node_scheduling "https://github.com/husseizo/garage-management-system/blob/main/src/modules/scheduling/index.ts"
click node_reminders "https://github.com/husseizo/garage-management-system/blob/main/src/modules/reminders/index.ts"
click node_notifications "https://github.com/husseizo/garage-management-system/blob/main/src/modules/notifications/index.ts"
click node_db "https://github.com/husseizo/garage-management-system/blob/main/src/server/db/client.ts"
click node_garage_profile "https://github.com/husseizo/garage-management-system/blob/main/src/server/garage.ts"
click node_i18n "https://github.com/husseizo/garage-management-system/blob/main/src/i18n/server.ts"

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_public,node_booking_ui,node_tracking,node_portal,node_login,node_dashboard,node_customer_pages,node_vehicle_pages,node_search,node_booking_ops,node_calendar,node_ops_pages,node_reminder_page toneBlue
class node_auth,node_guards,node_roles toneAmber
class node_customers,node_vehicles,node_booking_module,node_scheduling,node_reminders,node_notifications toneMint
class node_db,node_garage_profile,node_i18n toneRose
class node_customer,node_staff toneIndigo
```

## Components

### User interfaces

- [Public pages](https://github.com/husseizo/garage-management-system/blob/main/src/app/(public)/page.tsx): `src/app/(public)/page.tsx`
- [Guest booking](https://github.com/husseizo/garage-management-system/blob/main/src/app/(public)/book/page.tsx): `src/app/(public)/book/page.tsx`
- [Appointment tracking](https://github.com/husseizo/garage-management-system/blob/main/src/app/(public)/track/page.tsx): `src/app/(public)/track/page.tsx`
- [Customer portal](https://github.com/husseizo/garage-management-system/blob/main/src/app/(public)/portal/page.tsx): `src/app/(public)/portal/page.tsx`
- [Staff sign-in](https://github.com/husseizo/garage-management-system/blob/main/src/app/(auth)/login/page.tsx): `src/app/(auth)/login/page.tsx`
- [Staff dashboard](https://github.com/husseizo/garage-management-system/blob/main/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [Customer records UI](https://github.com/husseizo/garage-management-system/blob/main/src/app/dashboard/customers/page.tsx): `src/app/dashboard/customers/page.tsx`
- [Vehicle records UI](https://github.com/husseizo/garage-management-system/blob/main/src/app/dashboard/vehicles/page.tsx): `src/app/dashboard/vehicles/page.tsx`
- [Dashboard search](https://github.com/husseizo/garage-management-system/blob/main/src/app/dashboard/search/page.tsx): `src/app/dashboard/search/page.tsx`
- [Booking operations](https://github.com/husseizo/garage-management-system/blob/main/src/app/dashboard/bookings/page.tsx): `src/app/dashboard/bookings/page.tsx`
- [Appointment calendar](https://github.com/husseizo/garage-management-system/blob/main/src/app/dashboard/calendar/page.tsx): `src/app/dashboard/calendar/page.tsx`
- [Garage operations pages](https://github.com/husseizo/garage-management-system/blob/main/src/app/dashboard/technicians/page.tsx): `src/app/dashboard/technicians/page.tsx`
- [Reminder page](https://github.com/husseizo/garage-management-system/blob/main/src/app/dashboard/reminders/page.tsx): `src/app/dashboard/reminders/page.tsx`

### Staff identity

- [Auth session](https://github.com/husseizo/garage-management-system/blob/main/src/server/auth/auth.ts): `src/server/auth/auth.ts`
- [Staff access guards](https://github.com/husseizo/garage-management-system/blob/main/src/server/auth/guards.ts): `src/server/auth/guards.ts`
- [Role permissions](https://github.com/husseizo/garage-management-system/blob/main/src/modules/staff/permissions.ts): `src/modules/staff/permissions.ts`

### Garage records

- [Customer services](https://github.com/husseizo/garage-management-system/blob/main/src/modules/customers/service.ts): `src/modules/customers/service.ts`
- [Vehicle services](https://github.com/husseizo/garage-management-system/blob/main/src/modules/vehicles/service.ts): `src/modules/vehicles/service.ts`
- [Booking module](https://github.com/husseizo/garage-management-system/blob/main/src/modules/bookings/index.ts): `src/modules/bookings/index.ts`
- [Capacity scheduling](https://github.com/husseizo/garage-management-system/blob/main/src/modules/scheduling/index.ts): `src/modules/scheduling/index.ts`
- [Service reminders](https://github.com/husseizo/garage-management-system/blob/main/src/modules/reminders/index.ts): `src/modules/reminders/index.ts`
- [Notifications](https://github.com/husseizo/garage-management-system/blob/main/src/modules/notifications/index.ts): `src/modules/notifications/index.ts`

### Shared platform

- [Neon database access](https://github.com/husseizo/garage-management-system/blob/main/src/server/db/client.ts): `src/server/db/client.ts`
- [Garage profile](https://github.com/husseizo/garage-management-system/blob/main/src/server/garage.ts): `src/server/garage.ts`
- [Localization](https://github.com/husseizo/garage-management-system/blob/main/src/i18n/server.ts): `src/i18n/server.ts`

### Other components

- **Customer**
- **Garage staff**

## Connections

- Customer → Public pages: visits (evidence: `README.md`)
- Customer → Guest booking: requests service (evidence: `README.md`)
- Customer → Appointment tracking: checks appointment (evidence: `README.md`)
- Customer → Customer portal: views history (evidence: `README.md`)
- Garage staff → Staff sign-in: signs in (evidence: `README.md`)
- Garage staff → Staff dashboard: uses (evidence: `README.md`)
- Staff sign-in → Auth session: uses redirects (evidence: `src/app/(auth)/login/page.tsx`)
- Auth session → Staff access guards: validates session (evidence: `src/server/auth/guards.ts`)
- Staff access guards → Role permissions: checks permissions (evidence: `src/server/auth/guards.ts`)
- Staff dashboard → Staff access guards: requires staff (evidence: `src/app/dashboard/page.tsx`)
- Customer records UI → Staff access guards: checks access (evidence: `src/app/dashboard/customers/page.tsx`)
- Customer records UI → Customer services: reads records (evidence: `src/app/dashboard/customers/page.tsx`)
- Vehicle records UI → Vehicle services: reads records (evidence: `src/app/dashboard/vehicles/page.tsx`)
- Dashboard search → Customer services: searches customers (evidence: `src/app/dashboard/search/page.tsx`)
- Dashboard search → Vehicle services: searches vehicles (evidence: `src/app/dashboard/search/page.tsx`)
- Customer services → Neon database access: queries and writes (evidence: `src/modules/customers/service.ts`)
- Vehicle services → Neon database access: queries and writes (evidence: `src/modules/vehicles/service.ts`)
- Garage profile → Neon database access: reads profile (evidence: `src/server/garage.ts`)
- Customer services → Garage profile: gets region (evidence: `src/modules/customers/service.ts`)
- Vehicle services → Garage profile: gets settings (evidence: `src/modules/vehicles/service.ts`)
- Guest booking → Booking module: submits booking
- Booking operations → Booking module: manages requests (evidence: `README.md`)
- Appointment calendar → Capacity scheduling: uses capacity scheduling (evidence: `README.md`)
- Reminder page → Service reminders: manages reminders (evidence: `README.md`)
- Service reminders → Notifications: dispatches notices (evidence: `README.md`)
- Garage operations pages → Capacity scheduling: supports bay capacity (evidence: `README.md`)
- Staff dashboard → Localization: loads translations (evidence: `src/app/dashboard/page.tsx`)
