# angel-stacee/tcccms architecture

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

- Interactive diagram: https://gitdiagram.com/angel-stacee/tcccms
- Repository: https://github.com/angel-stacee/tcccms

## Overview

This is a browser-based clinic-management application, with a Capacitor Android shell also present. The main user workflow is to enter through the landing or login screens, reach the routed clinic workspace, and manage patient records, clinic visits, and medicine inventory; dashboards and reports provide operational summaries. The sampled pages use a shared API service, with in-memory record caching and notification helpers. The README is still the generic Vite template, so it does not substantiate further product capabilities; links to unsampled routes are limited to the route wiring visible in the app entry point and source index.

Main entry points: [`src/App.tsx`](https://github.com/angel-stacee/tcccms/blob/main/src/App.tsx) (Route application), [`src/services/api.ts`](https://github.com/angel-stacee/tcccms/blob/main/src/services/api.ts) (API client), [`src/pages/ClinicVisits.tsx`](https://github.com/angel-stacee/tcccms/blob/main/src/pages/ClinicVisits.tsx) (Clinic visits), [`src/pages/Dashboard.tsx`](https://github.com/angel-stacee/tcccms/blob/main/src/pages/Dashboard.tsx) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Entry and workspace"]
  node_app["Route application<br/>[App.tsx]"]
  node_landing["Landing and chat<br/>[Landing.tsx]"]
  node_login["Login<br/>[Login.tsx]"]
  node_layout["Main layout<br/>[MainLayout.tsx]"]
end

subgraph group_clinical["Clinical operations"]
  node_students["Patient records"]
  node_student_forms["Patient forms<br/>[StudentForms.tsx]"]
  node_clinic_visits["Clinic visits<br/>[ClinicVisits.tsx]"]
  node_visit_table["Visit table"]
  node_visit_modal["Visit editor"]
  node_medicine["Medicine inventory<br/>[Medicine.tsx]"]
  node_medicine_modal["Medicine editor<br/>[MedicineModal.tsx]"]
end

subgraph group_insights["Insights and administration"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_widgets["Dashboard widgets"]
  node_visit_chart["Visit charts"]
  node_reason_chart["Reason chart"]
  node_reports["Reports<br/>[Reports.tsx]"]
  node_organization["Organization management<br/>[Organization.tsx]"]
  node_profile["Profile<br/>[Profile.tsx]"]
  node_settings["Settings<br/>[Settings.tsx]"]
end

subgraph group_shared["Shared services"]
  node_api["API client<br/>[api.ts]"]
  node_cache["Record cache<br/>[recordCache.ts]"]
  node_notifications["Notification service<br/>[notifications.ts]"]
  node_pdf["PDF export<br/>[pdfExport.ts]"]
  node_formatters["Data formatters<br/>[formatters.ts]"]
  node_reason_colors["Reason styling<br/>[reasonColors.tsx]"]
end

node_user(("Clinic user"))
node_backend["Clinic API"]

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_login
node_app -->|"wraps routes"| node_layout
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_students
node_app -->|"routes to"| node_clinic_visits
node_app -->|"routes to"| node_medicine
node_app -->|"routes to"| node_reports
node_app -->|"routes to"| node_organization
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_settings
node_landing -->|"requests data"| node_api
node_login -->|"authenticates via"| node_api
node_dashboard -->|"requests data"| node_api
node_dashboard -->|"renders"| node_widgets
node_dashboard -->|"renders"| node_visit_chart
node_dashboard -->|"renders"| node_reason_chart
node_students -->|"requests records"| node_api
node_students -->|"uses forms"| node_student_forms
node_students -->|"reads through"| node_cache
node_clinic_visits -->|"requests visits"| node_api
node_clinic_visits -->|"renders"| node_visit_table
node_clinic_visits -->|"uses editor"| node_visit_modal
node_clinic_visits -->|"reads through"| node_cache
node_clinic_visits -->|"exports reports"| node_pdf
node_clinic_visits -->|"uses alerts"| node_notifications
node_medicine -->|"requests inventory"| node_api
node_medicine -->|"uses editor"| node_medicine_modal
node_medicine -->|"uses alerts"| node_notifications
node_reports -->|"requests data"| node_api
node_reports -->|"reads through"| node_cache
node_reports -->|"exports reports"| node_pdf
node_organization -->|"requests data"| node_api
node_api -->|"sends requests"| node_backend
node_api -->|"invalidates"| node_cache
node_notifications -->|"calls"| node_api
node_pdf -->|"formats values"| node_formatters
node_visit_table -->|"styles reasons"| node_reason_colors
node_reason_chart -->|"uses colors"| node_reason_colors

click node_app "https://github.com/angel-stacee/tcccms/blob/main/src/App.tsx"
click node_landing "https://github.com/angel-stacee/tcccms/blob/main/src/pages/Landing.tsx"
click node_login "https://github.com/angel-stacee/tcccms/blob/main/src/pages/Login.tsx"
click node_layout "https://github.com/angel-stacee/tcccms/blob/main/src/components/layout/MainLayout.tsx"
click node_dashboard "https://github.com/angel-stacee/tcccms/blob/main/src/pages/Dashboard.tsx"
click node_widgets "https://github.com/angel-stacee/tcccms/blob/main/src/components/dashboard/DashboardWidgets.tsx"
click node_visit_chart "https://github.com/angel-stacee/tcccms/blob/main/src/components/dashboard/InteractiveClinicVisitsChart.tsx"
click node_reason_chart "https://github.com/angel-stacee/tcccms/blob/main/src/components/dashboard/VisitReasonsPieChart.tsx"
click node_students "https://github.com/angel-stacee/tcccms/blob/main/src/pages/StudentManagement.tsx"
click node_student_forms "https://github.com/angel-stacee/tcccms/blob/main/src/components/student-management/StudentForms.tsx"
click node_clinic_visits "https://github.com/angel-stacee/tcccms/blob/main/src/pages/ClinicVisits.tsx"
click node_visit_table "https://github.com/angel-stacee/tcccms/blob/main/src/components/clinic-visits/ClinicVisitTable.tsx"
click node_visit_modal "https://github.com/angel-stacee/tcccms/blob/main/src/components/clinic-visits/ClinicVisitModal.tsx"
click node_medicine "https://github.com/angel-stacee/tcccms/blob/main/src/pages/Medicine.tsx"
click node_medicine_modal "https://github.com/angel-stacee/tcccms/blob/main/src/components/medicine/MedicineModal.tsx"
click node_reports "https://github.com/angel-stacee/tcccms/blob/main/src/pages/Reports.tsx"
click node_organization "https://github.com/angel-stacee/tcccms/blob/main/src/pages/Organization.tsx"
click node_profile "https://github.com/angel-stacee/tcccms/blob/main/src/pages/Profile.tsx"
click node_settings "https://github.com/angel-stacee/tcccms/blob/main/src/pages/Settings.tsx"
click node_api "https://github.com/angel-stacee/tcccms/blob/main/src/services/api.ts"
click node_cache "https://github.com/angel-stacee/tcccms/blob/main/src/services/recordCache.ts"
click node_notifications "https://github.com/angel-stacee/tcccms/blob/main/src/services/notifications.ts"
click node_pdf "https://github.com/angel-stacee/tcccms/blob/main/src/utils/pdfExport.ts"
click node_formatters "https://github.com/angel-stacee/tcccms/blob/main/src/utils/formatters.ts"
click node_reason_colors "https://github.com/angel-stacee/tcccms/blob/main/src/utils/reasonColors.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_app,node_landing,node_login,node_layout,node_user toneBlue
class node_students,node_student_forms,node_clinic_visits,node_visit_table,node_visit_modal,node_medicine,node_medicine_modal toneAmber
class node_dashboard,node_widgets,node_visit_chart,node_reason_chart,node_reports,node_organization,node_profile,node_settings,node_backend toneMint
class node_api,node_cache,node_notifications,node_pdf,node_formatters,node_reason_colors toneRose
```

## Components

### Entry and workspace

- [Route application](https://github.com/angel-stacee/tcccms/blob/main/src/App.tsx): `src/App.tsx`
- [Landing and chat](https://github.com/angel-stacee/tcccms/blob/main/src/pages/Landing.tsx): `src/pages/Landing.tsx`
- [Login](https://github.com/angel-stacee/tcccms/blob/main/src/pages/Login.tsx): `src/pages/Login.tsx`
- [Main layout](https://github.com/angel-stacee/tcccms/blob/main/src/components/layout/MainLayout.tsx): `src/components/layout/MainLayout.tsx`

### Clinical operations

- [Patient records](https://github.com/angel-stacee/tcccms/blob/main/src/pages/StudentManagement.tsx): `src/pages/StudentManagement.tsx`
- [Patient forms](https://github.com/angel-stacee/tcccms/blob/main/src/components/student-management/StudentForms.tsx): `src/components/student-management/StudentForms.tsx`
- [Clinic visits](https://github.com/angel-stacee/tcccms/blob/main/src/pages/ClinicVisits.tsx): `src/pages/ClinicVisits.tsx`
- [Visit table](https://github.com/angel-stacee/tcccms/blob/main/src/components/clinic-visits/ClinicVisitTable.tsx): `src/components/clinic-visits/ClinicVisitTable.tsx`
- [Visit editor](https://github.com/angel-stacee/tcccms/blob/main/src/components/clinic-visits/ClinicVisitModal.tsx): `src/components/clinic-visits/ClinicVisitModal.tsx`
- [Medicine inventory](https://github.com/angel-stacee/tcccms/blob/main/src/pages/Medicine.tsx): `src/pages/Medicine.tsx`
- [Medicine editor](https://github.com/angel-stacee/tcccms/blob/main/src/components/medicine/MedicineModal.tsx): `src/components/medicine/MedicineModal.tsx`

### Insights and administration

- [Dashboard](https://github.com/angel-stacee/tcccms/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Dashboard widgets](https://github.com/angel-stacee/tcccms/blob/main/src/components/dashboard/DashboardWidgets.tsx): `src/components/dashboard/DashboardWidgets.tsx`
- [Visit charts](https://github.com/angel-stacee/tcccms/blob/main/src/components/dashboard/InteractiveClinicVisitsChart.tsx): `src/components/dashboard/InteractiveClinicVisitsChart.tsx`
- [Reason chart](https://github.com/angel-stacee/tcccms/blob/main/src/components/dashboard/VisitReasonsPieChart.tsx): `src/components/dashboard/VisitReasonsPieChart.tsx`
- [Reports](https://github.com/angel-stacee/tcccms/blob/main/src/pages/Reports.tsx): `src/pages/Reports.tsx`
- [Organization management](https://github.com/angel-stacee/tcccms/blob/main/src/pages/Organization.tsx): `src/pages/Organization.tsx`
- [Profile](https://github.com/angel-stacee/tcccms/blob/main/src/pages/Profile.tsx): `src/pages/Profile.tsx`
- [Settings](https://github.com/angel-stacee/tcccms/blob/main/src/pages/Settings.tsx): `src/pages/Settings.tsx`

### Shared services

- [API client](https://github.com/angel-stacee/tcccms/blob/main/src/services/api.ts): `src/services/api.ts`
- [Record cache](https://github.com/angel-stacee/tcccms/blob/main/src/services/recordCache.ts): `src/services/recordCache.ts`
- [Notification service](https://github.com/angel-stacee/tcccms/blob/main/src/services/notifications.ts): `src/services/notifications.ts`
- [PDF export](https://github.com/angel-stacee/tcccms/blob/main/src/utils/pdfExport.ts): `src/utils/pdfExport.ts`
- [Data formatters](https://github.com/angel-stacee/tcccms/blob/main/src/utils/formatters.ts): `src/utils/formatters.ts`
- [Reason styling](https://github.com/angel-stacee/tcccms/blob/main/src/utils/reasonColors.tsx): `src/utils/reasonColors.tsx`

### Other components

- **Clinic user**
- **Clinic API**

## Connections

- Clinic user → Route application: opens (evidence: `src/App.tsx`)
- Route application → Landing and chat: routes to (evidence: `src/App.tsx`)
- Route application → Login: routes to (evidence: `src/App.tsx`)
- Route application → Main layout: wraps routes (evidence: `src/App.tsx`)
- Route application → Dashboard: routes to (evidence: `src/App.tsx`)
- Route application → Patient records: routes to (evidence: `src/App.tsx`)
- Route application → Clinic visits: routes to (evidence: `src/App.tsx`)
- Route application → Medicine inventory: routes to (evidence: `src/App.tsx`)
- Route application → Reports: routes to (evidence: `src/App.tsx`)
- Route application → Organization management: routes to (evidence: `src/App.tsx`)
- Route application → Profile: routes to (evidence: `src/App.tsx`)
- Route application → Settings: routes to (evidence: `src/App.tsx`)
- Landing and chat → API client: requests data (evidence: `src/pages/Landing.tsx`)
- Login → API client: authenticates via (evidence: `src/pages/Login.tsx`)
- Dashboard → API client: requests data (evidence: `src/pages/Dashboard.tsx`)
- Dashboard → Dashboard widgets: renders (evidence: `src/pages/Dashboard.tsx`)
- Dashboard → Visit charts: renders (evidence: `src/pages/Dashboard.tsx`)
- Dashboard → Reason chart: renders (evidence: `src/pages/Dashboard.tsx`)
- Patient records → API client: requests records (evidence: `src/pages/StudentManagement.tsx`)
- Patient records → Patient forms: uses forms (evidence: `src/pages/StudentManagement.tsx`)
- Patient records → Record cache: reads through (evidence: `src/pages/StudentManagement.tsx`)
- Clinic visits → API client: requests visits (evidence: `src/pages/ClinicVisits.tsx`)
- Clinic visits → Visit table: renders (evidence: `src/pages/ClinicVisits.tsx`)
- Clinic visits → Visit editor: uses editor (evidence: `src/pages/ClinicVisits.tsx`)
- Clinic visits → Record cache: reads through (evidence: `src/pages/ClinicVisits.tsx`)
- Clinic visits → PDF export: exports reports (evidence: `src/pages/ClinicVisits.tsx`)
- Clinic visits → Notification service: uses alerts (evidence: `src/pages/ClinicVisits.tsx`)
- Medicine inventory → API client: requests inventory (evidence: `src/pages/Medicine.tsx`)
- Medicine inventory → Medicine editor: uses editor (evidence: `src/pages/Medicine.tsx`)
- Medicine inventory → Notification service: uses alerts (evidence: `src/pages/Medicine.tsx`)
- Reports → API client: requests data (evidence: `src/pages/Reports.tsx`)
- Reports → Record cache: reads through (evidence: `src/pages/Reports.tsx`)
- Reports → PDF export: exports reports (evidence: `src/pages/Reports.tsx`)
- Organization management → API client: requests data (evidence: `src/pages/Organization.tsx`)
- API client → Clinic API: sends requests (evidence: `src/services/api.ts`)
- API client → Record cache: invalidates (evidence: `src/services/api.ts`)
- Notification service → API client: calls (evidence: `src/services/notifications.ts`)
- PDF export → Data formatters: formats values (evidence: `src/utils/pdfExport.ts`)
- Visit table → Reason styling: styles reasons (evidence: `src/components/clinic-visits/ClinicVisitTable.tsx`)
- Reason chart → Reason styling: uses colors (evidence: `src/components/dashboard/VisitReasonsPieChart.tsx`)
