# iqbalussain/jobmanager architecture

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

- Interactive diagram: https://gitdiagram.com/iqbalussain/jobmanager
- Repository: https://github.com/iqbalussain/jobmanager

## Overview

Job Manager is an offline-aware, role-protected job-order application. Users sign in, work with job orders through dashboard and management views, and follow approval, execution, and invoicing states; administrators also manage users and reference data, while reports and alerts support oversight. The documented runtime pairs Supabase with a per-user Dexie cache and Realtime reconciliation. Some feature components are named in the route shell or README but were not excerpted, so their internal calls are not expanded here.

Main entry points: [`src/pages/Index.tsx`](https://github.com/iqbalussain/jobmanager/blob/main/src/pages/Index.tsx) (Authenticated workspace), [`src/App.tsx`](https://github.com/iqbalussain/jobmanager/blob/main/src/App.tsx) (App shell and routes), [`src/services/jobOrdersApi.ts`](https://github.com/iqbalussain/jobmanager/blob/main/src/services/jobOrdersApi.ts) (Job-order API), [`src/services/syncService.ts`](https://github.com/iqbalussain/jobmanager/blob/main/src/services/syncService.ts) (Synchronization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application workflow"]
  node_shell["App shell and routes<br/>[App.tsx]"]
  node_workspace["Authenticated workspace<br/>[Index.tsx]"]
  node_dashboard["Dashboard"]
end

subgraph group_jobs["Job operations"]
  node_jobforms["Job creation and editing"]
  node_jobdetails["Job details<br/>[JobDetails.tsx]"]
  node_jobapi["Job-order API<br/>[jobOrdersApi.ts]"]
  node_jobtypes["Job domain types<br/>[jobOrder.ts]"]
  node_transforms["Cache/UI transforms"]
  node_approved["Approved jobs"]
  node_reports["Reports and export<br/>[ReportsPage.tsx]"]
  node_pdf["PDF generation"]
end

subgraph group_platform["Identity and sync"]
  node_auth["Authentication<br/>[useAuth.tsx]"]
  node_sync["Synchronization<br/>[syncService.ts]"]
  node_cachehooks["Offline job access<br/>[useDexieJobs.ts]"]
  node_cache[("Dexie cache<br/>[dexieDb.ts]")]
  node_supabase["Supabase client<br/>[client.ts]"]
  node_realtime["Realtime subscription<br/>[realtime.ts]"]
end

subgraph group_oversight["Administration and alerts"]
  node_admin["Admin management"]
  node_adminjobs["Admin job management"]
  node_alerts["Workflow alerts"]
  node_notifications["Notification state"]
  node_edgefunctions["Supabase Edge Functions"]
end

node_user(("Signed-in user"))

node_user -->|"uses"| node_shell
node_shell -->|"provides auth"| node_auth
node_shell -->|"routes to"| node_workspace
node_workspace -->|"renders view"| node_dashboard
node_workspace -->|"opens details"| node_jobdetails
node_workspace -->|"renders view"| node_approved
node_workspace -->|"renders view"| node_adminjobs
node_workspace -->|"renders view"| node_admin
node_workspace -->|"renders view"| node_reports
node_workspace -->|"loads jobs"| node_cachehooks
node_jobdetails -->|"uses job details"| node_jobapi
node_jobforms -.->|"creates jobs"| node_jobapi
node_jobapi -->|"reads and writes"| node_supabase
node_jobapi -->|"uses types"| node_jobtypes
node_cachehooks -->|"reads cache"| node_cache
node_cachehooks -->|"requests sync"| node_sync
node_sync -->|"updates cache"| node_cache
node_sync -->|"syncs records"| node_supabase
node_transforms -->|"maps records"| node_jobtypes
node_reports -.->|"exports reports"| node_pdf
node_shell -->|"subscribes edits"| node_realtime
node_shell -->|"checks sync"| node_sync
node_shell -->|"mounts alerts"| node_alerts
node_shell -->|"provides notifications"| node_notifications
node_alerts -->|"updates jobs"| node_jobapi
node_alerts -->|"updates cache"| node_sync
node_notifications -->|"gets user"| node_auth
node_admin -->|"manages records"| node_supabase
node_adminjobs -->|"opens job"| node_jobdetails
node_user -.->|"requests secured actions"| node_edgefunctions

click node_shell "https://github.com/iqbalussain/jobmanager/blob/main/src/App.tsx"
click node_auth "https://github.com/iqbalussain/jobmanager/blob/main/src/hooks/useAuth.tsx"
click node_workspace "https://github.com/iqbalussain/jobmanager/blob/main/src/pages/Index.tsx"
click node_dashboard "https://github.com/iqbalussain/jobmanager/blob/main/src/components/ModernDashboard.tsx"
click node_jobforms "https://github.com/iqbalussain/jobmanager/blob/main/src/components/job-form/JobFormWithImageUpload.tsx"
click node_jobdetails "https://github.com/iqbalussain/jobmanager/blob/main/src/components/JobDetails.tsx"
click node_jobapi "https://github.com/iqbalussain/jobmanager/blob/main/src/services/jobOrdersApi.ts"
click node_jobtypes "https://github.com/iqbalussain/jobmanager/blob/main/src/types/jobOrder.ts"
click node_transforms "https://github.com/iqbalussain/jobmanager/blob/main/src/utils/jobOrderTransforms.ts"
click node_approved "https://github.com/iqbalussain/jobmanager/blob/main/src/components/job-management/ApprovedJobsList.tsx"
click node_reports "https://github.com/iqbalussain/jobmanager/blob/main/src/components/ReportsPage.tsx"
click node_pdf "https://github.com/iqbalussain/jobmanager/blob/main/src/utils/pdf/pdfContentGenerator.ts"
click node_sync "https://github.com/iqbalussain/jobmanager/blob/main/src/services/syncService.ts"
click node_cachehooks "https://github.com/iqbalussain/jobmanager/blob/main/src/hooks/useDexieJobs.ts"
click node_cache "https://github.com/iqbalussain/jobmanager/blob/main/src/lib/dexieDb.ts"
click node_supabase "https://github.com/iqbalussain/jobmanager/blob/main/src/integrations/supabase/client.ts"
click node_realtime "https://github.com/iqbalussain/jobmanager/blob/main/src/lib/realtime.ts"
click node_admin "https://github.com/iqbalussain/jobmanager/blob/main/src/components/AdminManagement.tsx"
click node_adminjobs "https://github.com/iqbalussain/jobmanager/blob/main/src/components/AdminJobManagement.tsx"
click node_alerts "https://github.com/iqbalussain/jobmanager/blob/main/src/components/WorkflowAlertManager.tsx"
click node_notifications "https://github.com/iqbalussain/jobmanager/blob/main/src/contexts/NotificationContext.tsx"
click node_edgefunctions "https://github.com/iqbalussain/jobmanager/tree/main/supabase/functions"

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_shell,node_workspace,node_dashboard,node_user toneBlue
class node_jobforms,node_jobdetails,node_jobapi,node_jobtypes,node_transforms,node_approved,node_reports,node_pdf toneAmber
class node_auth,node_sync,node_cachehooks,node_cache,node_supabase,node_realtime toneMint
class node_admin,node_adminjobs,node_alerts,node_notifications,node_edgefunctions toneRose
```

## Components

### Application workflow

- [App shell and routes](https://github.com/iqbalussain/jobmanager/blob/main/src/App.tsx): `src/App.tsx`
- [Authenticated workspace](https://github.com/iqbalussain/jobmanager/blob/main/src/pages/Index.tsx): `src/pages/Index.tsx`
- [Dashboard](https://github.com/iqbalussain/jobmanager/blob/main/src/components/ModernDashboard.tsx): `src/components/ModernDashboard.tsx`

### Job operations

- [Job creation and editing](https://github.com/iqbalussain/jobmanager/blob/main/src/components/job-form/JobFormWithImageUpload.tsx): `src/components/job-form/JobFormWithImageUpload.tsx`
- [Job details](https://github.com/iqbalussain/jobmanager/blob/main/src/components/JobDetails.tsx): `src/components/JobDetails.tsx`
- [Job-order API](https://github.com/iqbalussain/jobmanager/blob/main/src/services/jobOrdersApi.ts): `src/services/jobOrdersApi.ts`
- [Job domain types](https://github.com/iqbalussain/jobmanager/blob/main/src/types/jobOrder.ts): `src/types/jobOrder.ts`
- [Cache/UI transforms](https://github.com/iqbalussain/jobmanager/blob/main/src/utils/jobOrderTransforms.ts): `src/utils/jobOrderTransforms.ts`
- [Approved jobs](https://github.com/iqbalussain/jobmanager/blob/main/src/components/job-management/ApprovedJobsList.tsx): `src/components/job-management/ApprovedJobsList.tsx`
- [Reports and export](https://github.com/iqbalussain/jobmanager/blob/main/src/components/ReportsPage.tsx): `src/components/ReportsPage.tsx`
- [PDF generation](https://github.com/iqbalussain/jobmanager/blob/main/src/utils/pdf/pdfContentGenerator.ts): `src/utils/pdf/pdfContentGenerator.ts`

### Identity and sync

- [Authentication](https://github.com/iqbalussain/jobmanager/blob/main/src/hooks/useAuth.tsx): `src/hooks/useAuth.tsx`
- [Synchronization](https://github.com/iqbalussain/jobmanager/blob/main/src/services/syncService.ts): `src/services/syncService.ts`
- [Offline job access](https://github.com/iqbalussain/jobmanager/blob/main/src/hooks/useDexieJobs.ts): `src/hooks/useDexieJobs.ts`
- [Dexie cache](https://github.com/iqbalussain/jobmanager/blob/main/src/lib/dexieDb.ts): `src/lib/dexieDb.ts`
- [Supabase client](https://github.com/iqbalussain/jobmanager/blob/main/src/integrations/supabase/client.ts): `src/integrations/supabase/client.ts`
- [Realtime subscription](https://github.com/iqbalussain/jobmanager/blob/main/src/lib/realtime.ts): `src/lib/realtime.ts`

### Administration and alerts

- [Admin management](https://github.com/iqbalussain/jobmanager/blob/main/src/components/AdminManagement.tsx): `src/components/AdminManagement.tsx`
- [Admin job management](https://github.com/iqbalussain/jobmanager/blob/main/src/components/AdminJobManagement.tsx): `src/components/AdminJobManagement.tsx`
- [Workflow alerts](https://github.com/iqbalussain/jobmanager/blob/main/src/components/WorkflowAlertManager.tsx): `src/components/WorkflowAlertManager.tsx`
- [Notification state](https://github.com/iqbalussain/jobmanager/blob/main/src/contexts/NotificationContext.tsx): `src/contexts/NotificationContext.tsx`
- [Supabase Edge Functions](https://github.com/iqbalussain/jobmanager/tree/main/supabase/functions): `supabase/functions`

### Other components

- **Signed-in user**

## Connections

- Signed-in user → App shell and routes: uses (evidence: `README.md`)
- App shell and routes → Authentication: provides auth (evidence: `src/App.tsx`)
- App shell and routes → Authenticated workspace: routes to (evidence: `src/App.tsx`)
- Authenticated workspace → Dashboard: renders view (evidence: `src/pages/Index.tsx`)
- Authenticated workspace → Job details: opens details (evidence: `src/pages/Index.tsx`)
- Authenticated workspace → Approved jobs: renders view (evidence: `src/pages/Index.tsx`)
- Authenticated workspace → Admin job management: renders view (evidence: `src/pages/Index.tsx`)
- Authenticated workspace → Admin management: renders view (evidence: `src/pages/Index.tsx`)
- Authenticated workspace → Reports and export: renders view (evidence: `src/pages/Index.tsx`)
- Authenticated workspace → Offline job access: loads jobs (evidence: `src/pages/Index.tsx`)
- Job details → Job-order API: uses job details
- Job creation and editing → Job-order API: creates jobs
- Job-order API → Supabase client: reads and writes (evidence: `src/services/jobOrdersApi.ts`)
- Job-order API → Job domain types: uses types (evidence: `src/services/jobOrdersApi.ts`)
- Offline job access → Dexie cache: reads cache (evidence: `src/hooks/useDexieJobs.ts`)
- Offline job access → Synchronization: requests sync (evidence: `src/hooks/useDexieJobs.ts`)
- Synchronization → Dexie cache: updates cache (evidence: `src/services/syncService.ts`)
- Synchronization → Supabase client: syncs records (evidence: `README.md`)
- Cache/UI transforms → Job domain types: maps records (evidence: `src/utils/jobOrderTransforms.ts`)
- Reports and export → PDF generation: exports reports
- App shell and routes → Realtime subscription: subscribes edits (evidence: `src/App.tsx`)
- App shell and routes → Synchronization: checks sync (evidence: `src/App.tsx`)
- App shell and routes → Workflow alerts: mounts alerts (evidence: `src/App.tsx`)
- App shell and routes → Notification state: provides notifications (evidence: `src/App.tsx`)
- Workflow alerts → Job-order API: updates jobs (evidence: `src/components/WorkflowAlertManager.tsx`)
- Workflow alerts → Synchronization: updates cache (evidence: `src/components/WorkflowAlertManager.tsx`)
- Notification state → Authentication: gets user (evidence: `src/contexts/NotificationContext.tsx`)
- Admin management → Supabase client: manages records
- Admin job management → Job details: opens job (evidence: `src/components/AdminJobManagement.tsx`)
- Signed-in user → Supabase Edge Functions: requests secured actions (evidence: `README.md`)
