# shafin-ahmed-201/fixmate-client architecture

> Architecture diagram of the GitHub repository shafin-ahmed-201/fixmate-client, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shafin-ahmed-201/fixmate-client
- Repository: https://github.com/shafin-ahmed-201/fixmate-client

## Overview

FixMate is a repair-services marketplace frontend. Customers browse services, submit booking requests, track bookings, and pay; technicians publish services and manage requests; administrators oversee users, services, bookings, and transactions. BetterAuth sessions supply JWTs to the separate FixMate API, while Stripe handles checkout. The README documents these flows and state transitions; sampled pages and the source index support the shown API/auth relationships. Some role pages and integrations were not sampled, so those links are documented rather than inferred from filenames.

Main entry points: [`lib/api.ts`](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/lib/api.ts) (Typed API Client), [`app/dashboard/customer/bookings/page.tsx`](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/customer/bookings/page.tsx) (Booking Management), [`app/(public)/page.tsx`](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/(public)/page.tsx) (Marketplace Home), [`app/(public)/services/page.tsx`](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/(public)/services/page.tsx) (Service Browse)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Service Discovery"]
  node_home["Marketplace Home<br/>[page.tsx]"]
  node_browse["Service Browse<br/>[page.tsx]"]
  node_service_detail["Service Detail<br/>[service-detail.tsx]"]
  node_booking_assistant["Voice Booking"]
  node_service_card["Service Card<br/>[service-card.tsx]"]
end

subgraph group_identity["Identity and API"]
  node_sign_in["Sign In<br/>[page.tsx]"]
  node_sign_up["Sign Up<br/>[page.tsx]"]
  node_auth_client["Auth Client<br/>[auth-client.ts]"]
  node_auth_route["Auth Route<br/>[route.ts]"]
  node_auth_server["Auth Server<br/>[auth.ts]"]
  node_api_layer["Typed API Client<br/>[api.ts]"]
end

subgraph group_operations["Marketplace Operations"]
  node_customer_ops["Customer Dashboard<br/>[page.tsx]"]
  node_customer_bookings["Booking Management<br/>[page.tsx]"]
  node_customer_payments["Payment History<br/>[page.tsx]"]
  node_technician_ops["Technician Dashboard<br/>[page.tsx]"]
  node_service_management["Technician Services<br/>[page.tsx]"]
  node_request_management["Technician Requests<br/>[page.tsx]"]
  node_admin_ops["Admin Overview<br/>[page.tsx]"]
  node_admin_services["Service Approval<br/>[page.tsx]"]
  node_admin_bookings["Admin Bookings<br/>[page.tsx]"]
  node_admin_users["User Management<br/>[page.tsx]"]
  node_admin_transactions["Transactions<br/>[page.tsx]"]
  node_profile["Profile Editor<br/>[page.tsx]"]
  node_payment_return["Payment Verification<br/>[page.tsx]"]
end

subgraph group_shared["Shared UI"]
  node_format["Formatting Helpers<br/>[format.ts]"]
  node_status_badges["Status Badges<br/>[badges.tsx]"]
  node_empty_state["Empty State<br/>[empty-state.tsx]"]
  node_stat_card["Dashboard Stats<br/>[stat-card.tsx]"]
  node_confirm_dialog["Confirmation Dialog<br/>[confirm-dialog.tsx]"]
end

node_customer(("Customer"))
node_technician(("Technician"))
node_admin(("Administrator"))
node_fixmate_api["FixMate API"]
node_stripe["Stripe Checkout"]

node_customer -->|"browses"| node_home
node_customer -->|"searches services"| node_browse
node_browse -->|"loads listings"| node_api_layer
node_home -->|"loads services"| node_api_layer
node_browse -->|"renders"| node_service_card
node_home -->|"renders"| node_service_card
node_customer -->|"requests booking"| node_service_detail
node_service_detail -->|"submits request"| node_api_layer
node_service_detail -->|"uses assistant"| node_booking_assistant
node_customer -->|"authenticates"| node_sign_in
node_customer -->|"registers"| node_sign_up
node_technician -->|"registers"| node_sign_up
node_sign_in -->|"signs in"| node_auth_client
node_sign_up -->|"creates account"| node_auth_client
node_auth_client -.->|"uses auth routes"| node_auth_route
node_auth_route -->|"dispatches"| node_auth_server
node_api_layer -->|"fetches JWT"| node_auth_route
node_api_layer -->|"sends API requests"| node_fixmate_api
node_customer -->|"views activity"| node_customer_ops
node_customer_ops -->|"loads dashboard data"| node_api_layer
node_customer -->|"manages bookings"| node_customer_bookings
node_customer_bookings -->|"updates bookings"| node_api_layer
node_customer -->|"views payments"| node_customer_payments
node_technician -->|"views activity"| node_technician_ops
node_technician_ops -->|"loads dashboard data"| node_api_layer
node_technician -->|"manages services"| node_service_management
node_service_management -->|"updates services"| node_api_layer
node_technician -->|"handles requests"| node_request_management
node_request_management -->|"changes status"| node_api_layer
node_admin -->|"oversees marketplace"| node_admin_ops
node_admin_ops -->|"loads statistics"| node_api_layer
node_admin -->|"approves services"| node_admin_services
node_admin -->|"reviews bookings"| node_admin_bookings
node_admin -->|"manages users"| node_admin_users
node_admin -->|"reviews transactions"| node_admin_transactions
node_customer -->|"edits profile"| node_profile
node_profile -->|"saves profile"| node_api_layer
node_customer -->|"starts checkout"| node_stripe
node_stripe -->|"returns session"| node_payment_return
node_payment_return -->|"verifies payment"| node_api_layer
node_api_layer -.->|"uses helpers"| node_format
node_customer_bookings -->|"renders status"| node_status_badges
node_customer_bookings -->|"confirms cancellation"| node_confirm_dialog
node_customer_bookings -->|"renders empty state"| node_empty_state
node_customer_ops -->|"renders metrics"| node_stat_card
node_admin_ops -->|"renders metrics"| node_stat_card

click node_home "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/(public)/page.tsx"
click node_browse "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/(public)/services/page.tsx"
click node_service_detail "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/(public)/services/%5Bid%5D/service-detail.tsx"
click node_booking_assistant "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/components/voice-booking-assistant.tsx"
click node_service_card "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/components/service-card.tsx"
click node_sign_in "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/(auth)/sign-in/page.tsx"
click node_sign_up "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/(auth)/sign-up/page.tsx"
click node_auth_client "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/lib/auth-client.ts"
click node_auth_route "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/api/auth/%5B...all%5D/route.ts"
click node_auth_server "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/lib/auth.ts"
click node_api_layer "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/lib/api.ts"
click node_customer_ops "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/customer/page.tsx"
click node_customer_bookings "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/customer/bookings/page.tsx"
click node_customer_payments "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/customer/payments/page.tsx"
click node_technician_ops "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/technician/page.tsx"
click node_service_management "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/technician/my-services/page.tsx"
click node_request_management "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/technician/requests/page.tsx"
click node_admin_ops "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/admin/page.tsx"
click node_admin_services "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/admin/services/page.tsx"
click node_admin_bookings "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/admin/bookings/page.tsx"
click node_admin_users "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/admin/users/page.tsx"
click node_admin_transactions "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/admin/transactions/page.tsx"
click node_profile "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/profile/page.tsx"
click node_payment_return "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/payment/success/page.tsx"
click node_format "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/lib/format.ts"
click node_status_badges "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/components/badges.tsx"
click node_empty_state "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/components/empty-state.tsx"
click node_stat_card "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/components/stat-card.tsx"
click node_confirm_dialog "https://github.com/shafin-ahmed-201/fixmate-client/blob/main/components/confirm-dialog.tsx"

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_home,node_browse,node_service_detail,node_booking_assistant,node_service_card toneBlue
class node_sign_in,node_sign_up,node_auth_client,node_auth_route,node_auth_server,node_api_layer toneAmber
class node_customer_ops,node_customer_bookings,node_customer_payments,node_technician_ops,node_service_management,node_request_management,node_admin_ops,node_admin_services,node_admin_bookings,node_admin_users,node_admin_transactions,node_profile,node_payment_return,node_fixmate_api toneMint
class node_format,node_status_badges,node_empty_state,node_stat_card,node_confirm_dialog toneRose
class node_customer,node_technician,node_admin,node_stripe toneIndigo
```

## Components

### Service Discovery

- [Marketplace Home](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/(public)/page.tsx): `app/(public)/page.tsx`
- [Service Browse](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/(public)/services/page.tsx): `app/(public)/services/page.tsx`
- [Service Detail](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/(public)/services/%5Bid%5D/service-detail.tsx): `app/(public)/services/[id]/service-detail.tsx`
- [Voice Booking](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/components/voice-booking-assistant.tsx): `components/voice-booking-assistant.tsx`
- [Service Card](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/components/service-card.tsx): `components/service-card.tsx`

### Identity and API

- [Sign In](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/(auth)/sign-in/page.tsx): `app/(auth)/sign-in/page.tsx`
- [Sign Up](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/(auth)/sign-up/page.tsx): `app/(auth)/sign-up/page.tsx`
- [Auth Client](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/lib/auth-client.ts): `lib/auth-client.ts`
- [Auth Route](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/api/auth/%5B...all%5D/route.ts): `app/api/auth/[...all]/route.ts`
- [Auth Server](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/lib/auth.ts): `lib/auth.ts`
- [Typed API Client](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/lib/api.ts): `lib/api.ts`

### Marketplace Operations

- [Customer Dashboard](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/customer/page.tsx): `app/dashboard/customer/page.tsx`
- [Booking Management](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/customer/bookings/page.tsx): `app/dashboard/customer/bookings/page.tsx`
- [Payment History](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/customer/payments/page.tsx): `app/dashboard/customer/payments/page.tsx`
- [Technician Dashboard](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/technician/page.tsx): `app/dashboard/technician/page.tsx`
- [Technician Services](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/technician/my-services/page.tsx): `app/dashboard/technician/my-services/page.tsx`
- [Technician Requests](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/technician/requests/page.tsx): `app/dashboard/technician/requests/page.tsx`
- [Admin Overview](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/admin/page.tsx): `app/dashboard/admin/page.tsx`
- [Service Approval](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/admin/services/page.tsx): `app/dashboard/admin/services/page.tsx`
- [Admin Bookings](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/admin/bookings/page.tsx): `app/dashboard/admin/bookings/page.tsx`
- [User Management](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/admin/users/page.tsx): `app/dashboard/admin/users/page.tsx`
- [Transactions](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/admin/transactions/page.tsx): `app/dashboard/admin/transactions/page.tsx`
- [Profile Editor](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/dashboard/profile/page.tsx): `app/dashboard/profile/page.tsx`
- [Payment Verification](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/app/payment/success/page.tsx): `app/payment/success/page.tsx`

### Shared UI

- [Formatting Helpers](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/lib/format.ts): `lib/format.ts`
- [Status Badges](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/components/badges.tsx): `components/badges.tsx`
- [Empty State](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/components/empty-state.tsx): `components/empty-state.tsx`
- [Dashboard Stats](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/components/stat-card.tsx): `components/stat-card.tsx`
- [Confirmation Dialog](https://github.com/shafin-ahmed-201/fixmate-client/blob/main/components/confirm-dialog.tsx): `components/confirm-dialog.tsx`

### Other components

- **Customer**
- **Technician**
- **Administrator**
- **FixMate API**
- **Stripe Checkout**

## Connections

- Customer → Marketplace Home: browses (evidence: `README.md`)
- Customer → Service Browse: searches services (evidence: `README.md`)
- Service Browse → Typed API Client: loads listings (evidence: `app/(public)/services/page.tsx`)
- Marketplace Home → Typed API Client: loads services (evidence: `app/(public)/page.tsx`)
- Service Browse → Service Card: renders (evidence: `app/(public)/services/page.tsx`)
- Marketplace Home → Service Card: renders (evidence: `app/(public)/page.tsx`)
- Customer → Service Detail: requests booking (evidence: `README.md`)
- Service Detail → Typed API Client: submits request (evidence: `app/(public)/services/[id]/service-detail.tsx`)
- Service Detail → Voice Booking: uses assistant (evidence: `app/(public)/services/[id]/service-detail.tsx`)
- Customer → Sign In: authenticates (evidence: `README.md`)
- Customer → Sign Up: registers (evidence: `README.md`)
- Technician → Sign Up: registers (evidence: `README.md`)
- Sign In → Auth Client: signs in (evidence: `app/(auth)/sign-in/page.tsx`)
- Sign Up → Auth Client: creates account (evidence: `app/(auth)/sign-up/page.tsx`)
- Auth Client → Auth Route: uses auth routes
- Auth Route → Auth Server: dispatches (evidence: `app/api/auth/[...all]/route.ts`)
- Typed API Client → Auth Route: fetches JWT (evidence: `lib/api.ts`)
- Typed API Client → FixMate API: sends API requests (evidence: `README.md`)
- Customer → Customer Dashboard: views activity (evidence: `README.md`)
- Customer Dashboard → Typed API Client: loads dashboard data (evidence: `app/dashboard/customer/page.tsx`)
- Customer → Booking Management: manages bookings (evidence: `README.md`)
- Booking Management → Typed API Client: updates bookings (evidence: `app/dashboard/customer/bookings/page.tsx`)
- Customer → Payment History: views payments (evidence: `README.md`)
- Technician → Technician Dashboard: views activity (evidence: `README.md`)
- Technician Dashboard → Typed API Client: loads dashboard data (evidence: `app/dashboard/technician/page.tsx`)
- Technician → Technician Services: manages services (evidence: `README.md`)
- Technician Services → Typed API Client: updates services (evidence: `app/dashboard/technician/my-services/page.tsx`)
- Technician → Technician Requests: handles requests (evidence: `README.md`)
- Technician Requests → Typed API Client: changes status (evidence: `app/dashboard/technician/requests/page.tsx`)
- Administrator → Admin Overview: oversees marketplace (evidence: `README.md`)
- Admin Overview → Typed API Client: loads statistics (evidence: `app/dashboard/admin/page.tsx`)
- Administrator → Service Approval: approves services (evidence: `README.md`)
- Administrator → Admin Bookings: reviews bookings (evidence: `README.md`)
- Administrator → User Management: manages users (evidence: `README.md`)
- Administrator → Transactions: reviews transactions (evidence: `README.md`)
- Customer → Profile Editor: edits profile (evidence: `README.md`)
- Profile Editor → Typed API Client: saves profile (evidence: `app/dashboard/profile/page.tsx`)
- Customer → Stripe Checkout: starts checkout (evidence: `README.md`)
- Stripe Checkout → Payment Verification: returns session (evidence: `README.md`)
- Payment Verification → Typed API Client: verifies payment (evidence: `app/payment/success/page.tsx`)
- Typed API Client → Formatting Helpers: uses helpers
- Booking Management → Status Badges: renders status (evidence: `app/dashboard/customer/bookings/page.tsx`)
- Booking Management → Confirmation Dialog: confirms cancellation (evidence: `app/dashboard/customer/bookings/page.tsx`)
- Booking Management → Empty State: renders empty state (evidence: `app/dashboard/customer/bookings/page.tsx`)
- Customer Dashboard → Dashboard Stats: renders metrics (evidence: `app/dashboard/customer/page.tsx`)
- Admin Overview → Dashboard Stats: renders metrics (evidence: `app/dashboard/admin/page.tsx`)
