# ungakadaidigital-ux/me-and-mech architecture

> Architecture diagram of the GitHub repository ungakadaidigital-ux/me-and-mech, 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/ungakadaidigital-ux/me-and-mech
- Repository: https://github.com/ungakadaidigital-ux/me-and-mech

## Overview

Me & Mech is a Tamil-first workshop-management platform: mechanics use an Android app to manage workshop records and billing, with a backend API supporting authentication, operational workflows, subscriptions, and engagement. The mobile app also supports offline data and synchronization. README-described capabilities include voice billing, WhatsApp notifications, push engagement, referrals, inventory, and reports. Several modules are represented from the README and tree rather than inspected source; edges are limited to documented or excerpted relationships.

Main entry points: [`apps/backend/src/app.ts`](https://github.com/ungakadaidigital-ux/me-and-mech/blob/main/apps/backend/src/app.ts) (HTTP API), [`apps/backend/src/modules/voice`](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/voice) (Voice billing), [`apps/mobile/src/api/client.ts`](https://github.com/ungakadaidigital-ux/me-and-mech/blob/main/apps/mobile/src/api/client.ts) (API client), [`apps/mobile/App.tsx`](https://github.com/ungakadaidigital-ux/me-and-mech/blob/main/apps/mobile/App.tsx) (Mobile application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_mobile_app["Mobile application<br/>[App.tsx]"]
  node_mobile_auth["Authentication flows<br/>[useAuth.ts]"]
  node_mobile_api["API client<br/>[client.ts]"]
  node_offline[("Offline storage and sync")]
  node_mobile_screens["Workshop screens"]
end

subgraph group_backend["API foundation"]
  node_backend_api["HTTP API<br/>[app.ts]"]
  node_auth_sessions["OTP and sessions"]
  node_onboarding["Workshop onboarding"]
  node_middleware["Request access controls"]
  node_repositories[("Workshop repositories")]
  node_shared["Shared domain types"]
end

subgraph group_operations["Workshop operations"]
  node_customers_vehicles["Customers and vehicles"]
  node_job_cards["Job cards"]
  node_inventory["Inventory"]
  node_invoices["Invoices and PDFs"]
  node_reports["Reports and analytics"]
end

subgraph group_growth["Billing and growth"]
  node_subscriptions["Subscriptions"]
  node_referrals["Referral rewards"]
end

subgraph group_engagement["Voice and engagement"]
  node_voice["Voice billing"]
  node_notifications["WhatsApp notifications"]
  node_engagement["Push and scheduled engagement"]
end

node_mechanic(("Workshop mechanic"))
node_qstash["QStash scheduler"]
node_payment_provider["Razorpay"]
node_sarvam["Sarvam transcription"]
node_gpt["GPT extraction"]
node_supabase[("Supabase storage")]

node_mechanic -->|"uses"| node_mobile_app
node_mobile_app -->|"initializes"| node_offline
node_mobile_app -.->|"hosts flows"| node_mobile_auth
node_mobile_auth -->|"requests"| node_mobile_api
node_mobile_screens -.->|"fetches data"| node_mobile_api
node_mobile_api -->|"sends HTTP requests"| node_backend_api
node_backend_api -->|"applies controls"| node_middleware
node_backend_api -.->|"routes auth"| node_auth_sessions
node_backend_api -->|"routes registration"| node_onboarding
node_onboarding -->|"issues session"| node_auth_sessions
node_backend_api -.->|"routes operations"| node_customers_vehicles
node_backend_api -.->|"routes job cards"| node_job_cards
node_job_cards -->|"checks referral success"| node_referrals
node_backend_api -->|"routes inventory"| node_inventory
node_backend_api -.->|"routes invoicing"| node_invoices
node_backend_api -->|"routes reports"| node_reports
node_backend_api -->|"routes subscriptions"| node_subscriptions
node_subscriptions -->|"verifies webhooks"| node_payment_provider
node_backend_api -->|"routes referrals"| node_referrals
node_qstash -->|"invokes worker"| node_referrals
node_qstash -->|"invokes triggers"| node_engagement
node_backend_api -->|"routes voice"| node_voice
node_voice -.->|"transcribes audio"| node_sarvam
node_voice -.->|"extracts details"| node_gpt
node_voice -->|"stores audio"| node_supabase
node_backend_api -->|"routes webhooks"| node_notifications
node_backend_api -->|"routes triggers"| node_engagement
node_mobile_api -->|"uses response types"| node_shared
node_repositories -.->|"persists records"| node_supabase

click node_mobile_app "https://github.com/ungakadaidigital-ux/me-and-mech/blob/main/apps/mobile/App.tsx"
click node_mobile_auth "https://github.com/ungakadaidigital-ux/me-and-mech/blob/main/apps/mobile/src/api/hooks/useAuth.ts"
click node_mobile_api "https://github.com/ungakadaidigital-ux/me-and-mech/blob/main/apps/mobile/src/api/client.ts"
click node_offline "https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/mobile/src/offline"
click node_mobile_screens "https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/mobile/src/screens"
click node_backend_api "https://github.com/ungakadaidigital-ux/me-and-mech/blob/main/apps/backend/src/app.ts"
click node_auth_sessions "https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/auth"
click node_onboarding "https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/onboarding"
click node_middleware "https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/middleware"
click node_repositories "https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/db/repositories"
click node_customers_vehicles "https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/customer"
click node_job_cards "https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/job-card"
click node_inventory "https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/inventory"
click node_invoices "https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/invoice"
click node_reports "https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/reports"
click node_subscriptions "https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/subscription"
click node_referrals "https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/referral"
click node_voice "https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/voice"
click node_notifications "https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/notification"
click node_engagement "https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/engagement"
click node_shared "https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/packages/shared/src/types"

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_mobile_app,node_mobile_auth,node_mobile_api,node_offline,node_mobile_screens toneBlue
class node_backend_api,node_auth_sessions,node_onboarding,node_middleware,node_repositories,node_shared,node_supabase toneAmber
class node_customers_vehicles,node_job_cards,node_inventory,node_invoices,node_reports toneMint
class node_subscriptions,node_referrals,node_qstash toneRose
class node_voice,node_notifications,node_engagement,node_mechanic,node_payment_provider,node_sarvam,node_gpt toneIndigo
```

## Components

### Mobile app

- [Mobile application](https://github.com/ungakadaidigital-ux/me-and-mech/blob/main/apps/mobile/App.tsx): `apps/mobile/App.tsx`
- [Authentication flows](https://github.com/ungakadaidigital-ux/me-and-mech/blob/main/apps/mobile/src/api/hooks/useAuth.ts): `apps/mobile/src/api/hooks/useAuth.ts`
- [API client](https://github.com/ungakadaidigital-ux/me-and-mech/blob/main/apps/mobile/src/api/client.ts): `apps/mobile/src/api/client.ts`
- [Offline storage and sync](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/mobile/src/offline): `apps/mobile/src/offline`
- [Workshop screens](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/mobile/src/screens): `apps/mobile/src/screens`

### API foundation

- [HTTP API](https://github.com/ungakadaidigital-ux/me-and-mech/blob/main/apps/backend/src/app.ts): `apps/backend/src/app.ts`
- [OTP and sessions](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/auth): `apps/backend/src/modules/auth`
- [Workshop onboarding](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/onboarding): `apps/backend/src/modules/onboarding`
- [Request access controls](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/middleware): `apps/backend/src/middleware`
- [Workshop repositories](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/db/repositories): `apps/backend/src/db/repositories`
- [Shared domain types](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/packages/shared/src/types): `packages/shared/src/types`

### Workshop operations

- [Customers and vehicles](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/customer): `apps/backend/src/modules/customer`
- [Job cards](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/job-card): `apps/backend/src/modules/job-card`
- [Inventory](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/inventory): `apps/backend/src/modules/inventory`
- [Invoices and PDFs](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/invoice): `apps/backend/src/modules/invoice`
- [Reports and analytics](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/reports): `apps/backend/src/modules/reports`

### Billing and growth

- [Subscriptions](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/subscription): `apps/backend/src/modules/subscription`
- [Referral rewards](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/referral): `apps/backend/src/modules/referral`

### Voice and engagement

- [Voice billing](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/voice): `apps/backend/src/modules/voice`
- [WhatsApp notifications](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/notification): `apps/backend/src/modules/notification`
- [Push and scheduled engagement](https://github.com/ungakadaidigital-ux/me-and-mech/tree/main/apps/backend/src/modules/engagement): `apps/backend/src/modules/engagement`

### Other components

- **Workshop mechanic**
- **QStash scheduler**
- **Razorpay**
- **Sarvam transcription**
- **GPT extraction**
- **Supabase storage**

## Connections

- Workshop mechanic → Mobile application: uses (evidence: `README.md`)
- Mobile application → Offline storage and sync: initializes (evidence: `apps/mobile/App.tsx`)
- Mobile application → Authentication flows: hosts flows
- Authentication flows → API client: requests (evidence: `apps/mobile/src/api/hooks/useAuth.ts`)
- Workshop screens → API client: fetches data
- API client → HTTP API: sends HTTP requests (evidence: `apps/mobile/src/api/client.ts`)
- HTTP API → Request access controls: applies controls (evidence: `README.md`)
- HTTP API → OTP and sessions: routes auth
- HTTP API → Workshop onboarding: routes registration (evidence: `apps/backend/src/modules/onboarding/onboarding.routes.ts`)
- Workshop onboarding → OTP and sessions: issues session (evidence: `apps/backend/src/modules/onboarding/onboarding.routes.ts`)
- HTTP API → Customers and vehicles: routes operations
- HTTP API → Job cards: routes job cards
- Job cards → Referral rewards: checks referral success (evidence: `apps/backend/src/modules/job-card/job-card.controller.ts`)
- HTTP API → Inventory: routes inventory (evidence: `apps/backend/src/modules/inventory/inventory.routes.ts`)
- HTTP API → Invoices and PDFs: routes invoicing
- HTTP API → Reports and analytics: routes reports (evidence: `apps/backend/src/modules/reports/reports.routes.ts`)
- HTTP API → Subscriptions: routes subscriptions (evidence: `apps/backend/src/modules/subscription/subscription.routes.ts`)
- Subscriptions → Razorpay: verifies webhooks (evidence: `apps/backend/src/modules/subscription/subscription.routes.ts`)
- HTTP API → Referral rewards: routes referrals (evidence: `apps/backend/src/modules/referral/referral.routes.ts`)
- QStash scheduler → Referral rewards: invokes worker (evidence: `apps/backend/src/modules/referral/referral.routes.ts`)
- QStash scheduler → Push and scheduled engagement: invokes triggers (evidence: `apps/backend/src/modules/engagement/engagement.routes.ts`)
- HTTP API → Voice billing: routes voice (evidence: `apps/backend/src/modules/voice/voice.routes.ts`)
- Voice billing → Sarvam transcription: transcribes audio (evidence: `README.md`)
- Voice billing → GPT extraction: extracts details (evidence: `README.md`)
- Voice billing → Supabase storage: stores audio
- HTTP API → WhatsApp notifications: routes webhooks (evidence: `apps/backend/src/modules/notification/wati-webhook.routes.ts`)
- HTTP API → Push and scheduled engagement: routes triggers (evidence: `apps/backend/src/modules/engagement/engagement.routes.ts`)
- API client → Shared domain types: uses response types (evidence: `apps/mobile/src/api/client.ts`)
- Workshop repositories → Supabase storage: persists records
