# bongs20/smart-pabbura architecture

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

- Interactive diagram: https://gitdiagram.com/bongs20/smart-pabbura
- Repository: https://github.com/bongs20/smart-pabbura

## Overview

Smart-Pabbura is a Next.js oral-health monitoring application for tracking stomatitis symptoms, pain, pH, hydration, and recovery. Users record symptoms through periodic assessments and daily monitoring; those records are stored and surfaced in dashboards, history, and medical-report views. The app also includes account/profile management, dose tracking, notifications, and educational content. Supabase is documented as the authentication/backend integration, alongside local storage. Several page implementations were not sampled, so links for those capabilities are documented at the subsystem level rather than inferred from filenames.

Main entry points: [`lib/storage.ts`](https://github.com/bongs20/smart-pabbura/blob/main/lib/storage.ts) (Health and account storage), [`app/page.tsx`](https://github.com/bongs20/smart-pabbura/blob/main/app/page.tsx) (Health dashboard), [`app/cek-sariawan/page.tsx`](https://github.com/bongs20/smart-pabbura/blob/main/app/cek-sariawan/page.tsx) (Ulcer assessment), [`app/monitoring/page.tsx`](https://github.com/bongs20/smart-pabbura/blob/main/app/monitoring/page.tsx) (Daily monitoring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_care["Health tracking"]
  node_home["Health dashboard<br/>[page.tsx]"]
  node_assessment["Ulcer assessment<br/>[page.tsx]"]
  node_monitoring["Daily monitoring<br/>[page.tsx]"]
  node_painlog["Pain log<br/>[page.tsx]"]
  node_ulcerrecords["Ulcer records<br/>[page.tsx]"]
  node_dose["Dose tracking<br/>[page.tsx]"]
end

subgraph group_insights["Reports and guidance"]
  node_history["Health history<br/>[page.tsx]"]
  node_recommendations["Recommendations<br/>[page.tsx]"]
  node_education["Oral health education"]
  node_notifications["Notifications<br/>[page.tsx]"]
end

subgraph group_account["Account and access"]
  node_login["Sign in<br/>[page.tsx]"]
  node_registration["Registration<br/>[page.tsx]"]
  node_profile["Profile<br/>[page.tsx]"]
end

subgraph group_platform["Shared services"]
  node_records[("Health and account storage<br/>[storage.ts]")]
  node_supabase[("Supabase")]
  node_types["Domain types<br/>[index.ts]"]
end

node_user(("Patient"))

node_user -.->|"views"| node_home
node_user -.->|"assesses symptoms"| node_assessment
node_user -.->|"records metrics"| node_monitoring
node_user -.->|"tracks doses"| node_dose
node_assessment -->|"saves assessment"| node_records
node_monitoring -->|"saves measurements"| node_records
node_painlog -->|"uses records"| node_records
node_ulcerrecords -->|"uses records"| node_records
node_dose -->|"uses records"| node_records
node_home -->|"loads user"| node_records
node_history -->|"uses records"| node_records
node_login -->|"authenticates"| node_records
node_registration -->|"uses records"| node_records
node_profile -->|"updates profile"| node_records
node_records -->|"uses auth client"| node_supabase
node_monitoring -->|"updates report data"| node_history
node_home -->|"uses domain metrics"| node_types
node_assessment -->|"records health data"| node_types

click node_home "https://github.com/bongs20/smart-pabbura/blob/main/app/page.tsx"
click node_assessment "https://github.com/bongs20/smart-pabbura/blob/main/app/cek-sariawan/page.tsx"
click node_monitoring "https://github.com/bongs20/smart-pabbura/blob/main/app/monitoring/page.tsx"
click node_painlog "https://github.com/bongs20/smart-pabbura/blob/main/app/pain-log/page.tsx"
click node_ulcerrecords "https://github.com/bongs20/smart-pabbura/blob/main/app/ulcer-documentation/page.tsx"
click node_dose "https://github.com/bongs20/smart-pabbura/blob/main/app/dosis/page.tsx"
click node_history "https://github.com/bongs20/smart-pabbura/blob/main/app/riwayat/page.tsx"
click node_recommendations "https://github.com/bongs20/smart-pabbura/blob/main/app/rekomendasi/page.tsx"
click node_education "https://github.com/bongs20/smart-pabbura/tree/main/app/edukasi"
click node_notifications "https://github.com/bongs20/smart-pabbura/blob/main/app/notifikasi/page.tsx"
click node_login "https://github.com/bongs20/smart-pabbura/blob/main/app/login/page.tsx"
click node_registration "https://github.com/bongs20/smart-pabbura/blob/main/app/register/page.tsx"
click node_profile "https://github.com/bongs20/smart-pabbura/blob/main/app/profil/page.tsx"
click node_records "https://github.com/bongs20/smart-pabbura/blob/main/lib/storage.ts"
click node_types "https://github.com/bongs20/smart-pabbura/blob/main/types/index.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_home,node_assessment,node_monitoring,node_painlog,node_ulcerrecords,node_dose toneBlue
class node_history,node_recommendations,node_education,node_notifications toneAmber
class node_login,node_registration,node_profile toneMint
class node_records,node_supabase,node_types toneRose
class node_user toneIndigo
```

## Components

### Health tracking

- [Health dashboard](https://github.com/bongs20/smart-pabbura/blob/main/app/page.tsx): `app/page.tsx`
- [Ulcer assessment](https://github.com/bongs20/smart-pabbura/blob/main/app/cek-sariawan/page.tsx): `app/cek-sariawan/page.tsx`
- [Daily monitoring](https://github.com/bongs20/smart-pabbura/blob/main/app/monitoring/page.tsx): `app/monitoring/page.tsx`
- [Pain log](https://github.com/bongs20/smart-pabbura/blob/main/app/pain-log/page.tsx): `app/pain-log/page.tsx`
- [Ulcer records](https://github.com/bongs20/smart-pabbura/blob/main/app/ulcer-documentation/page.tsx): `app/ulcer-documentation/page.tsx`
- [Dose tracking](https://github.com/bongs20/smart-pabbura/blob/main/app/dosis/page.tsx): `app/dosis/page.tsx`

### Reports and guidance

- [Health history](https://github.com/bongs20/smart-pabbura/blob/main/app/riwayat/page.tsx): `app/riwayat/page.tsx`
- [Recommendations](https://github.com/bongs20/smart-pabbura/blob/main/app/rekomendasi/page.tsx): `app/rekomendasi/page.tsx`
- [Oral health education](https://github.com/bongs20/smart-pabbura/tree/main/app/edukasi): `app/edukasi`
- [Notifications](https://github.com/bongs20/smart-pabbura/blob/main/app/notifikasi/page.tsx): `app/notifikasi/page.tsx`

### Account and access

- [Sign in](https://github.com/bongs20/smart-pabbura/blob/main/app/login/page.tsx): `app/login/page.tsx`
- [Registration](https://github.com/bongs20/smart-pabbura/blob/main/app/register/page.tsx): `app/register/page.tsx`
- [Profile](https://github.com/bongs20/smart-pabbura/blob/main/app/profil/page.tsx): `app/profil/page.tsx`

### Shared services

- [Health and account storage](https://github.com/bongs20/smart-pabbura/blob/main/lib/storage.ts): `lib/storage.ts`
- **Supabase**
- [Domain types](https://github.com/bongs20/smart-pabbura/blob/main/types/index.ts): `types/index.ts`

### Other components

- **Patient**

## Connections

- Patient → Health dashboard: views
- Patient → Ulcer assessment: assesses symptoms
- Patient → Daily monitoring: records metrics
- Patient → Dose tracking: tracks doses
- Ulcer assessment → Health and account storage: saves assessment (evidence: `app/cek-sariawan/page.tsx`)
- Daily monitoring → Health and account storage: saves measurements (evidence: `app/monitoring/page.tsx`)
- Pain log → Health and account storage: uses records (evidence: `app/pain-log/page.tsx`)
- Ulcer records → Health and account storage: uses records (evidence: `app/ulcer-documentation/page.tsx`)
- Dose tracking → Health and account storage: uses records (evidence: `app/dosis/page.tsx`)
- Health dashboard → Health and account storage: loads user (evidence: `app/page.tsx`)
- Health history → Health and account storage: uses records (evidence: `app/riwayat/page.tsx`)
- Sign in → Health and account storage: authenticates (evidence: `app/login/page.tsx`)
- Registration → Health and account storage: uses records (evidence: `app/register/page.tsx`)
- Profile → Health and account storage: updates profile (evidence: `app/profil/page.tsx`)
- Health and account storage → Supabase: uses auth client (evidence: `lib/storage.ts`)
- Daily monitoring → Health history: updates report data (evidence: `app/monitoring/page.tsx`)
- Health dashboard → Domain types: uses domain metrics (evidence: `app/page.tsx`)
- Ulcer assessment → Domain types: records health data (evidence: `types/index.ts`)
