# vryon09/clinic-app architecture

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

- Interactive diagram: https://gitdiagram.com/vryon09/clinic-app
- Repository: https://github.com/vryon09/clinic-app

## Overview

This is a clinic-management application with a React frontend, Express API, and SQLite persistence. Staff authenticate, manage patients and consultations, record clinical details, handle laboratory requests/results, and bill patients; dashboards and administrative settings support that work. The tree also shows backup, signatures, clinic information, activity logs, and Google authentication. The README is empty, so capability coverage comes from the source tree and route registrations; some subsystem internals and frontend-to-API wiring were not sampled and are left unasserted or marked unverified.

Main entry points: [`frontend/src/ui/App.tsx`](https://github.com/vryon09/clinic-app/blob/main/frontend/src/ui/App.tsx) (Application routes), [`backend/src/server.ts`](https://github.com/vryon09/clinic-app/blob/main/backend/src/server.ts) (HTTP API), [`backend/src/config/prisma.ts`](https://github.com/vryon09/clinic-app/blob/main/backend/src/config/prisma.ts) (SQLite database), [`backend/src/controller/recordController.ts`](https://github.com/vryon09/clinic-app/blob/main/backend/src/controller/recordController.ts) (Consultation records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Clinic interface"]
  node_frontend["Application routes<br/>[App.tsx]"]
  node_authui["Sign-in screens"]
  node_patientui["Patient workspace"]
  node_consultui["Consultation workspace"]
  node_labui["Lab screens"]
  node_billingui["Billing workspace"]
  node_dashboardui["Dashboard"]
  node_settingsui["Settings and archive"]
end

subgraph group_clinical["Clinical records"]
  node_patients["Patient records"]
  node_consultations["Consultation records"]
  node_labs["Laboratory workflow"]
end

subgraph group_operations["Clinic operations"]
  node_billing["Invoices and payments"]
  node_clinicops["Clinic administration"]
end

subgraph group_api["API and access"]
  node_http["HTTP API<br/>[server.ts]"]
  node_authapi["Identity and users<br/>[authController.ts]"]
  node_access["Token and permissions"]
end

subgraph group_persistence["Persistence and integrations"]
  node_db[("SQLite database<br/>[prisma.ts]")]
  node_backup["Backup and restore"]
  node_google["Google sign-in"]
end

node_staff(("Clinic staff"))

node_staff -->|"uses"| node_frontend
node_frontend -->|"routes to"| node_authui
node_frontend -->|"routes to"| node_dashboardui
node_frontend -->|"routes to"| node_patientui
node_frontend -->|"routes to"| node_consultui
node_frontend -->|"routes to"| node_labui
node_frontend -->|"routes to"| node_billingui
node_frontend -->|"routes to"| node_settingsui
node_frontend -.->|"sends API requests"| node_http
node_http -->|"mounts routes"| node_authapi
node_http -->|"mounts routes"| node_patients
node_http -->|"mounts routes"| node_consultations
node_http -->|"mounts routes"| node_labs
node_http -->|"mounts routes"| node_billing
node_http -->|"mounts routes"| node_clinicops
node_authapi -->|"reads and writes"| node_db
node_patients -->|"reads and writes"| node_db
node_consultations -->|"reads and writes"| node_db
node_billing -->|"reads and writes"| node_db
node_labs -.->|"persists results"| node_db
node_authapi -->|"uses token checks"| node_access
node_billing -->|"gated by routes"| node_access
node_consultations -->|"gated by routes"| node_access
node_backup -->|"backs up data"| node_db
node_backup -.->|"optional cloud storage"| node_google
node_clinicops -.->|"uses shared database"| node_db

click node_frontend "https://github.com/vryon09/clinic-app/blob/main/frontend/src/ui/App.tsx"
click node_authui "https://github.com/vryon09/clinic-app/tree/main/frontend/src/ui/components/pages/auth"
click node_patientui "https://github.com/vryon09/clinic-app/tree/main/frontend/src/ui/components/pages/patients"
click node_consultui "https://github.com/vryon09/clinic-app/tree/main/frontend/src/ui/components/pages/consultations"
click node_labui "https://github.com/vryon09/clinic-app/tree/main/frontend/src/ui/components/pages/labRequests"
click node_billingui "https://github.com/vryon09/clinic-app/tree/main/frontend/src/ui/components/pages/billing"
click node_dashboardui "https://github.com/vryon09/clinic-app/tree/main/frontend/src/ui/components/pages/dashboard"
click node_settingsui "https://github.com/vryon09/clinic-app/tree/main/frontend/src/ui/components/pages/settings"
click node_http "https://github.com/vryon09/clinic-app/blob/main/backend/src/server.ts"
click node_authapi "https://github.com/vryon09/clinic-app/blob/main/backend/src/controller/authController.ts"
click node_access "https://github.com/vryon09/clinic-app/tree/main/backend/src/middleware"
click node_patients "https://github.com/vryon09/clinic-app/blob/main/backend/src/controller/patientController.ts"
click node_consultations "https://github.com/vryon09/clinic-app/blob/main/backend/src/controller/recordController.ts"
click node_labs "https://github.com/vryon09/clinic-app/blob/main/backend/src/controller/labRequestController.ts"
click node_billing "https://github.com/vryon09/clinic-app/blob/main/backend/src/controller/billingController.ts"
click node_clinicops "https://github.com/vryon09/clinic-app/tree/main/backend/src/controller"
click node_db "https://github.com/vryon09/clinic-app/blob/main/backend/src/config/prisma.ts"
click node_backup "https://github.com/vryon09/clinic-app/blob/main/backend/src/controller/backupController.ts"
click node_google "https://github.com/vryon09/clinic-app/blob/main/backend/src/controller/googleAuthController.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_frontend,node_authui,node_patientui,node_consultui,node_labui,node_billingui,node_dashboardui,node_settingsui toneBlue
class node_patients,node_consultations,node_labs toneAmber
class node_billing,node_clinicops toneMint
class node_http,node_authapi,node_access toneRose
class node_db,node_backup,node_google,node_staff toneIndigo
```

## Components

### Clinic interface

- [Application routes](https://github.com/vryon09/clinic-app/blob/main/frontend/src/ui/App.tsx): `frontend/src/ui/App.tsx`
- [Sign-in screens](https://github.com/vryon09/clinic-app/tree/main/frontend/src/ui/components/pages/auth): `frontend/src/ui/components/pages/auth`
- [Patient workspace](https://github.com/vryon09/clinic-app/tree/main/frontend/src/ui/components/pages/patients): `frontend/src/ui/components/pages/patients`
- [Consultation workspace](https://github.com/vryon09/clinic-app/tree/main/frontend/src/ui/components/pages/consultations): `frontend/src/ui/components/pages/consultations`
- [Lab screens](https://github.com/vryon09/clinic-app/tree/main/frontend/src/ui/components/pages/labRequests): `frontend/src/ui/components/pages/labRequests`
- [Billing workspace](https://github.com/vryon09/clinic-app/tree/main/frontend/src/ui/components/pages/billing): `frontend/src/ui/components/pages/billing`
- [Dashboard](https://github.com/vryon09/clinic-app/tree/main/frontend/src/ui/components/pages/dashboard): `frontend/src/ui/components/pages/dashboard`
- [Settings and archive](https://github.com/vryon09/clinic-app/tree/main/frontend/src/ui/components/pages/settings): `frontend/src/ui/components/pages/settings`

### Clinical records

- [Patient records](https://github.com/vryon09/clinic-app/blob/main/backend/src/controller/patientController.ts): `backend/src/controller/patientController.ts`
- [Consultation records](https://github.com/vryon09/clinic-app/blob/main/backend/src/controller/recordController.ts): `backend/src/controller/recordController.ts`
- [Laboratory workflow](https://github.com/vryon09/clinic-app/blob/main/backend/src/controller/labRequestController.ts): `backend/src/controller/labRequestController.ts`

### Clinic operations

- [Invoices and payments](https://github.com/vryon09/clinic-app/blob/main/backend/src/controller/billingController.ts): `backend/src/controller/billingController.ts`
- [Clinic administration](https://github.com/vryon09/clinic-app/tree/main/backend/src/controller): `backend/src/controller`

### API and access

- [HTTP API](https://github.com/vryon09/clinic-app/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [Identity and users](https://github.com/vryon09/clinic-app/blob/main/backend/src/controller/authController.ts): `backend/src/controller/authController.ts`
- [Token and permissions](https://github.com/vryon09/clinic-app/tree/main/backend/src/middleware): `backend/src/middleware`

### Persistence and integrations

- [SQLite database](https://github.com/vryon09/clinic-app/blob/main/backend/src/config/prisma.ts): `backend/src/config/prisma.ts`
- [Backup and restore](https://github.com/vryon09/clinic-app/blob/main/backend/src/controller/backupController.ts): `backend/src/controller/backupController.ts`
- [Google sign-in](https://github.com/vryon09/clinic-app/blob/main/backend/src/controller/googleAuthController.ts): `backend/src/controller/googleAuthController.ts`

### Other components

- **Clinic staff**

## Connections

- Clinic staff → Application routes: uses
- Application routes → Sign-in screens: routes to (evidence: `frontend/src/ui/App.tsx`)
- Application routes → Dashboard: routes to (evidence: `frontend/src/ui/App.tsx`)
- Application routes → Patient workspace: routes to (evidence: `frontend/src/ui/App.tsx`)
- Application routes → Consultation workspace: routes to (evidence: `frontend/src/ui/App.tsx`)
- Application routes → Lab screens: routes to (evidence: `frontend/src/ui/App.tsx`)
- Application routes → Billing workspace: routes to (evidence: `frontend/src/ui/App.tsx`)
- Application routes → Settings and archive: routes to (evidence: `frontend/src/ui/App.tsx`)
- Application routes → HTTP API: sends API requests
- HTTP API → Identity and users: mounts routes (evidence: `backend/src/server.ts`)
- HTTP API → Patient records: mounts routes (evidence: `backend/src/server.ts`)
- HTTP API → Consultation records: mounts routes (evidence: `backend/src/server.ts`)
- HTTP API → Laboratory workflow: mounts routes (evidence: `backend/src/server.ts`)
- HTTP API → Invoices and payments: mounts routes (evidence: `backend/src/server.ts`)
- HTTP API → Clinic administration: mounts routes (evidence: `backend/src/server.ts`)
- Identity and users → SQLite database: reads and writes (evidence: `backend/src/controller/authController.ts`)
- Patient records → SQLite database: reads and writes (evidence: `backend/src/controller/patientController.ts`)
- Consultation records → SQLite database: reads and writes (evidence: `backend/src/controller/recordController.ts`)
- Invoices and payments → SQLite database: reads and writes (evidence: `backend/src/controller/billingController.ts`)
- Laboratory workflow → SQLite database: persists results
- Identity and users → Token and permissions: uses token checks (evidence: `backend/src/routes/authRoutes.ts`)
- Invoices and payments → Token and permissions: gated by routes (evidence: `backend/src/routes/billingRoutes.ts`)
- Consultation records → Token and permissions: gated by routes (evidence: `backend/src/routes/recordRoutes.ts`)
- Backup and restore → SQLite database: backs up data (evidence: `backend/src/controller/backupController.ts`)
- Backup and restore → Google sign-in: optional cloud storage
- Clinic administration → SQLite database: uses shared database (evidence: `backend/src/controller/billingController.ts`)
