# fariqul/docteer architecture

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

- Interactive diagram: https://gitdiagram.com/fariqul/docteer
- Repository: https://github.com/fariqul/docteer

## Overview

This repository is a clinic queue and patient-care web application, despite the README describing a Vite template. Staff register patients, record triage, route patients through laboratory and clinic examinations, and dispense prescribed medicines; a separate display presents queues. Admin screens cover staff, medicines, monitoring, reports, and display settings. The router and sampled feature code establish the main entry points and some Supabase interactions; unsampled feature internals and their exact data flows are not inferred.

Main entry points: [`src/app/router.tsx`](https://github.com/fariqul/docteer/blob/master/src/app/router.tsx) (Route dispatch), [`src/lib/supabase.ts`](https://github.com/fariqul/docteer/blob/master/src/lib/supabase.ts) (Supabase client), [`src/App.tsx`](https://github.com/fariqul/docteer/blob/master/src/App.tsx) (App provider), [`src/features/triage/Triage.tsx`](https://github.com/fariqul/docteer/blob/master/src/features/triage/Triage.tsx) (Triage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_app["App provider<br/>[App.tsx]"]
  node_router["Route dispatch<br/>[router.tsx]"]
  node_layout["Navigation layout<br/>[index.tsx]"]
end

subgraph group_care["Patient care"]
  node_registration["Patient registration<br/>[Registration.tsx]"]
  node_triage["Triage<br/>[Triage.tsx]"]
  node_lab["Laboratory<br/>[Laboratory.tsx]"]
  node_clinic["Clinical examination<br/>[Clinic.tsx]"]
  node_pharmacy["Pharmacy dispensing<br/>[Pharmacy.tsx]"]
end

subgraph group_ops["Clinic operations"]
  node_dashboard["Clinic dashboard<br/>[Dashboard.tsx]"]
  node_display["Queue display<br/>[DisplayMonitor.tsx]"]
  node_admin["Admin management<br/>[AdminPages.tsx]"]
end

subgraph group_infra["Data and state"]
  node_stores["Auth and UI state<br/>[index.ts]"]
  node_supabaseclient["Supabase client<br/>[supabase.ts]"]
  node_schema[("Database schema")]
end

node_staff(("Staff / admin"))
node_supabase[("Supabase service")]

node_staff -->|"opens"| node_app
node_app -->|"provides routes"| node_router
node_router -->|"renders shell"| node_layout
node_router -->|"routes to"| node_dashboard
node_router -->|"routes to"| node_registration
node_router -->|"routes to"| node_triage
node_router -->|"routes to"| node_lab
node_router -->|"routes to"| node_clinic
node_router -->|"routes to"| node_pharmacy
node_router -->|"routes to"| node_display
node_router -->|"routes to"| node_admin
node_router -->|"checks access"| node_stores
node_triage -->|"queries queues"| node_supabaseclient
node_lab -->|"reads and saves"| node_supabaseclient
node_clinic -->|"reads and writes"| node_supabaseclient
node_pharmacy -->|"reads and updates"| node_supabaseclient
node_supabaseclient -->|"connects"| node_supabase
node_supabase -.->|"uses schema"| node_schema

click node_app "https://github.com/fariqul/docteer/blob/master/src/App.tsx"
click node_router "https://github.com/fariqul/docteer/blob/master/src/app/router.tsx"
click node_layout "https://github.com/fariqul/docteer/blob/master/src/components/layout/index.tsx"
click node_dashboard "https://github.com/fariqul/docteer/blob/master/src/features/dashboard/Dashboard.tsx"
click node_registration "https://github.com/fariqul/docteer/blob/master/src/features/registration/Registration.tsx"
click node_triage "https://github.com/fariqul/docteer/blob/master/src/features/triage/Triage.tsx"
click node_lab "https://github.com/fariqul/docteer/blob/master/src/features/laboratory/Laboratory.tsx"
click node_clinic "https://github.com/fariqul/docteer/blob/master/src/features/clinic/Clinic.tsx"
click node_pharmacy "https://github.com/fariqul/docteer/blob/master/src/features/pharmacy/Pharmacy.tsx"
click node_display "https://github.com/fariqul/docteer/blob/master/src/features/display/DisplayMonitor.tsx"
click node_admin "https://github.com/fariqul/docteer/blob/master/src/features/admin/AdminPages.tsx"
click node_stores "https://github.com/fariqul/docteer/blob/master/src/stores/index.ts"
click node_supabaseclient "https://github.com/fariqul/docteer/blob/master/src/lib/supabase.ts"
click node_schema "https://github.com/fariqul/docteer/blob/master/supabase/migrations/001_initial_schema.sql"

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,node_router,node_layout toneBlue
class node_registration,node_triage,node_lab,node_clinic,node_pharmacy,node_supabase toneAmber
class node_dashboard,node_display,node_admin toneMint
class node_stores,node_supabaseclient,node_schema toneRose
class node_staff toneIndigo
```

## Components

### App shell

- [App provider](https://github.com/fariqul/docteer/blob/master/src/App.tsx): `src/App.tsx`
- [Route dispatch](https://github.com/fariqul/docteer/blob/master/src/app/router.tsx): `src/app/router.tsx`
- [Navigation layout](https://github.com/fariqul/docteer/blob/master/src/components/layout/index.tsx): `src/components/layout/index.tsx`

### Patient care

- [Patient registration](https://github.com/fariqul/docteer/blob/master/src/features/registration/Registration.tsx): `src/features/registration/Registration.tsx`
- [Triage](https://github.com/fariqul/docteer/blob/master/src/features/triage/Triage.tsx): `src/features/triage/Triage.tsx`
- [Laboratory](https://github.com/fariqul/docteer/blob/master/src/features/laboratory/Laboratory.tsx): `src/features/laboratory/Laboratory.tsx`
- [Clinical examination](https://github.com/fariqul/docteer/blob/master/src/features/clinic/Clinic.tsx): `src/features/clinic/Clinic.tsx`
- [Pharmacy dispensing](https://github.com/fariqul/docteer/blob/master/src/features/pharmacy/Pharmacy.tsx): `src/features/pharmacy/Pharmacy.tsx`

### Clinic operations

- [Clinic dashboard](https://github.com/fariqul/docteer/blob/master/src/features/dashboard/Dashboard.tsx): `src/features/dashboard/Dashboard.tsx`
- [Queue display](https://github.com/fariqul/docteer/blob/master/src/features/display/DisplayMonitor.tsx): `src/features/display/DisplayMonitor.tsx`
- [Admin management](https://github.com/fariqul/docteer/blob/master/src/features/admin/AdminPages.tsx): `src/features/admin/AdminPages.tsx`

### Data and state

- [Auth and UI state](https://github.com/fariqul/docteer/blob/master/src/stores/index.ts): `src/stores/index.ts`
- [Supabase client](https://github.com/fariqul/docteer/blob/master/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Database schema](https://github.com/fariqul/docteer/blob/master/supabase/migrations/001_initial_schema.sql): `supabase/migrations/001_initial_schema.sql`

### Other components

- **Staff / admin**
- **Supabase service**

## Connections

- Staff / admin → App provider: opens
- App provider → Route dispatch: provides routes
- Route dispatch → Navigation layout: renders shell
- Route dispatch → Clinic dashboard: routes to
- Route dispatch → Patient registration: routes to
- Route dispatch → Triage: routes to
- Route dispatch → Laboratory: routes to
- Route dispatch → Clinical examination: routes to
- Route dispatch → Pharmacy dispensing: routes to
- Route dispatch → Queue display: routes to
- Route dispatch → Admin management: routes to
- Route dispatch → Auth and UI state: checks access
- Triage → Supabase client: queries queues
- Laboratory → Supabase client: reads and saves
- Clinical examination → Supabase client: reads and writes
- Pharmacy dispensing → Supabase client: reads and updates
- Supabase client → Supabase service: connects
- Supabase service → Database schema: uses schema
