# arya-satwika/dashboard-pws architecture

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

- Interactive diagram: https://gitdiagram.com/arya-satwika/dashboard-pws
- Repository: https://github.com/arya-satwika/dashboard-pws

## Overview

Dashboard PWS is a field-visit monitoring app for maternal and child health programs. Staff sign in, review coverage and follow-up priorities, identify a household/target, complete a structured visit checklist, and save the visit record locally. Separate routes cover activities, reports, and administration of checklist templates and staff. The checklist hook, local repository, dashboard route, and auth implementation are sampled; several route and feature connections are inferred only from names and are left unconnected where ownership is not established.

Main entry points: [`src/routes/index.tsx`](https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/index.tsx) (Monitoring dashboard), [`src/features/checklist/hooks/useChecklistForm.ts`](https://github.com/arya-satwika/dashboard-pws/blob/main/src/features/checklist/hooks/useChecklistForm.ts) (Checklist workflow), [`src/routes/sasaran.index.tsx`](https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/sasaran.index.tsx) (Target listing), [`src/routes/checklist.tsx`](https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/checklist.tsx) (Checklist route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["App navigation"]
  node_router["Route setup<br/>[router.tsx]"]
  node_root["Root layout<br/>[__root.tsx]"]
  node_shell["App shell<br/>[AppShell.tsx]"]
end

subgraph group_monitoring["Program monitoring"]
  node_dashboard["Monitoring dashboard<br/>[index.tsx]"]
  node_mock_data["Dashboard data<br/>[mock-data.ts]"]
  node_dashboard_views["Dashboard views<br/>[ChartCard.tsx]"]
  node_kegiatan["Activities<br/>[kegiatan.tsx]"]
  node_reports["Reports<br/>[laporan.tsx]"]
end

subgraph group_visits["Visit workflow"]
  node_sasaran["Target listing<br/>[sasaran.index.tsx]"]
  node_sasaran_detail["Target detail<br/>[sasaran.$id.tsx]"]
  node_checklist_route["Checklist route<br/>[checklist.tsx]"]
  node_checklist_hook["Checklist workflow"]
  node_checklist_form["Visit form<br/>[SasaranForm.tsx]"]
  node_validation["Visit validation"]
  node_repository["Visit repository"]
  node_local_repository["Local visit adapter"]
end

subgraph group_administration["Administration"]
  node_templates["Checklist templates"]
  node_management["Program management<br/>[kelola.tsx]"]
  node_template_admin["Template editor<br/>[FormKrSection.tsx]"]
end

subgraph group_identity["Identity and state"]
  node_login["Login route<br/>[login.tsx]"]
  node_auth_provider["Auth provider<br/>[auth.tsx]"]
  node_auth["Session auth<br/>[auth.ts]"]
  node_browser_storage[("Browser storage")]
end

node_staff(("Field staff"))

node_staff -->|"signs in"| node_login
node_login -->|"requests login"| node_auth_provider
node_auth_provider -->|"checks and saves"| node_auth
node_auth -->|"reads and writes"| node_browser_storage
node_staff -->|"reviews coverage"| node_dashboard
node_router -->|"mounts routes"| node_root
node_root -->|"wraps content"| node_shell
node_dashboard -->|"renders within"| node_shell
node_dashboard -->|"loads rows"| node_mock_data
node_dashboard -->|"renders metrics"| node_dashboard_views
node_dashboard -->|"links targets"| node_sasaran
node_staff -->|"selects target"| node_sasaran
node_sasaran -->|"opens detail"| node_sasaran_detail
node_sasaran_detail -->|"starts visit"| node_checklist_route
node_staff -->|"records visit"| node_checklist_route
node_checklist_route -->|"uses workflow"| node_checklist_hook
node_checklist_hook -->|"provides form state"| node_checklist_form
node_checklist_hook -->|"validates submission"| node_validation
node_checklist_hook -->|"loads templates"| node_templates
node_checklist_hook -->|"saves and lists"| node_repository
node_repository -->|"implemented by"| node_local_repository
node_local_repository -->|"reads and writes"| node_browser_storage
node_staff -->|"views activities"| node_kegiatan
node_staff -->|"views reports"| node_reports
node_staff -->|"manages program"| node_management
node_management -->|"edits templates"| node_template_admin

click node_router "https://github.com/arya-satwika/dashboard-pws/blob/main/src/router.tsx"
click node_root "https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/__root.tsx"
click node_shell "https://github.com/arya-satwika/dashboard-pws/blob/main/src/components/organisms/AppShell.tsx"
click node_login "https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/login.tsx"
click node_auth_provider "https://github.com/arya-satwika/dashboard-pws/blob/main/src/providers/auth.tsx"
click node_auth "https://github.com/arya-satwika/dashboard-pws/blob/main/src/lib/auth.ts"
click node_dashboard "https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/index.tsx"
click node_mock_data "https://github.com/arya-satwika/dashboard-pws/blob/main/src/lib/mock-data.ts"
click node_dashboard_views "https://github.com/arya-satwika/dashboard-pws/blob/main/src/components/organisms/ChartCard.tsx"
click node_sasaran "https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/sasaran.index.tsx"
click node_sasaran_detail "https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/sasaran.%24id.tsx"
click node_checklist_route "https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/checklist.tsx"
click node_checklist_hook "https://github.com/arya-satwika/dashboard-pws/blob/main/src/features/checklist/hooks/useChecklistForm.ts"
click node_checklist_form "https://github.com/arya-satwika/dashboard-pws/blob/main/src/features/checklist/components/SasaranForm.tsx"
click node_validation "https://github.com/arya-satwika/dashboard-pws/blob/main/src/features/checklist/services/validateKunjungan.ts"
click node_templates "https://github.com/arya-satwika/dashboard-pws/blob/main/src/hooks/use-kr-templates.ts"
click node_repository "https://github.com/arya-satwika/dashboard-pws/blob/main/src/lib/repositories/kunjungan.repository.ts"
click node_local_repository "https://github.com/arya-satwika/dashboard-pws/blob/main/src/lib/repositories/localKunjungan.repository.ts"
click node_kegiatan "https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/kegiatan.tsx"
click node_reports "https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/laporan.tsx"
click node_management "https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/kelola.tsx"
click node_template_admin "https://github.com/arya-satwika/dashboard-pws/blob/main/src/features/kelola/components/FormKrSection.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_router,node_root,node_shell toneBlue
class node_dashboard,node_mock_data,node_dashboard_views,node_kegiatan,node_reports toneAmber
class node_sasaran,node_sasaran_detail,node_checklist_route,node_checklist_hook,node_checklist_form,node_validation,node_repository,node_local_repository toneMint
class node_templates,node_management,node_template_admin toneRose
class node_login,node_auth_provider,node_auth,node_browser_storage,node_staff toneIndigo
```

## Components

### App navigation

- [Route setup](https://github.com/arya-satwika/dashboard-pws/blob/main/src/router.tsx): `src/router.tsx`
- [Root layout](https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/__root.tsx): `src/routes/__root.tsx`
- [App shell](https://github.com/arya-satwika/dashboard-pws/blob/main/src/components/organisms/AppShell.tsx): `src/components/organisms/AppShell.tsx`

### Program monitoring

- [Monitoring dashboard](https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Dashboard data](https://github.com/arya-satwika/dashboard-pws/blob/main/src/lib/mock-data.ts): `src/lib/mock-data.ts`
- [Dashboard views](https://github.com/arya-satwika/dashboard-pws/blob/main/src/components/organisms/ChartCard.tsx): `src/components/organisms/ChartCard.tsx`
- [Activities](https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/kegiatan.tsx): `src/routes/kegiatan.tsx`
- [Reports](https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/laporan.tsx): `src/routes/laporan.tsx`

### Visit workflow

- [Target listing](https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/sasaran.index.tsx): `src/routes/sasaran.index.tsx`
- [Target detail](https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/sasaran.%24id.tsx): `src/routes/sasaran.$id.tsx`
- [Checklist route](https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/checklist.tsx): `src/routes/checklist.tsx`
- [Checklist workflow](https://github.com/arya-satwika/dashboard-pws/blob/main/src/features/checklist/hooks/useChecklistForm.ts): `src/features/checklist/hooks/useChecklistForm.ts`
- [Visit form](https://github.com/arya-satwika/dashboard-pws/blob/main/src/features/checklist/components/SasaranForm.tsx): `src/features/checklist/components/SasaranForm.tsx`
- [Visit validation](https://github.com/arya-satwika/dashboard-pws/blob/main/src/features/checklist/services/validateKunjungan.ts): `src/features/checklist/services/validateKunjungan.ts`
- [Visit repository](https://github.com/arya-satwika/dashboard-pws/blob/main/src/lib/repositories/kunjungan.repository.ts): `src/lib/repositories/kunjungan.repository.ts`
- [Local visit adapter](https://github.com/arya-satwika/dashboard-pws/blob/main/src/lib/repositories/localKunjungan.repository.ts): `src/lib/repositories/localKunjungan.repository.ts`

### Administration

- [Checklist templates](https://github.com/arya-satwika/dashboard-pws/blob/main/src/hooks/use-kr-templates.ts): `src/hooks/use-kr-templates.ts`
- [Program management](https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/kelola.tsx): `src/routes/kelola.tsx`
- [Template editor](https://github.com/arya-satwika/dashboard-pws/blob/main/src/features/kelola/components/FormKrSection.tsx): `src/features/kelola/components/FormKrSection.tsx`

### Identity and state

- [Login route](https://github.com/arya-satwika/dashboard-pws/blob/main/src/routes/login.tsx): `src/routes/login.tsx`
- [Auth provider](https://github.com/arya-satwika/dashboard-pws/blob/main/src/providers/auth.tsx): `src/providers/auth.tsx`
- [Session auth](https://github.com/arya-satwika/dashboard-pws/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- **Browser storage**

### Other components

- **Field staff**

## Connections

- Field staff → Login route: signs in
- Login route → Auth provider: requests login
- Auth provider → Session auth: checks and saves
- Session auth → Browser storage: reads and writes
- Field staff → Monitoring dashboard: reviews coverage
- Route setup → Root layout: mounts routes
- Root layout → App shell: wraps content
- Monitoring dashboard → App shell: renders within
- Monitoring dashboard → Dashboard data: loads rows
- Monitoring dashboard → Dashboard views: renders metrics
- Monitoring dashboard → Target listing: links targets
- Field staff → Target listing: selects target
- Target listing → Target detail: opens detail
- Target detail → Checklist route: starts visit
- Field staff → Checklist route: records visit
- Checklist route → Checklist workflow: uses workflow
- Checklist workflow → Visit form: provides form state
- Checklist workflow → Visit validation: validates submission
- Checklist workflow → Checklist templates: loads templates
- Checklist workflow → Visit repository: saves and lists
- Visit repository → Local visit adapter: implemented by
- Local visit adapter → Browser storage: reads and writes
- Field staff → Activities: views activities
- Field staff → Reports: views reports
- Field staff → Program management: manages program
- Program management → Template editor: edits templates
