# machioneel/monalisa-1 architecture

> Architecture diagram of the GitHub repository machioneel/monalisa-1, 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/machioneel/monalisa-1
- Repository: https://github.com/machioneel/monalisa-1

## Overview

MONALISA is a Bapas case-management application. Staff register clients and incoming Litmas requests; work is assigned to PKs, who handle tasks and client guidance, while Kasie/Kasubsie roles monitor work. The README documents these role-based capabilities and Supabase-backed storage. Some workflow implementations and dashboard modules are unsampled, so their links are shown only where supported by the README or sampled routing/authentication code.

Main entry points: [`src/integrations/supabase/client.ts`](https://github.com/machioneel/monalisa-1/blob/main/src/integrations/supabase/client.ts) (Supabase client), [`src/components/registrasi`](https://github.com/machioneel/monalisa-1/tree/main/src/components/registrasi) (Client and service registration), [`src/App.tsx`](https://github.com/machioneel/monalisa-1/blob/main/src/App.tsx) (Application routes), [`src/components/admin`](https://github.com/machioneel/monalisa-1/tree/main/src/components/admin) (User and role administration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and routing"]
  node_app["Application routes<br/>[App.tsx]"]
  node_login["Login<br/>[Login.tsx]"]
  node_auth["Auth and RBAC<br/>[AuthContext.tsx]"]
  node_guard["Protected routes<br/>[ProtectedRoute.tsx]"]
end

subgraph group_registration["Client registration"]
  node_registration["Client and service registration"]
  node_clients["Client records<br/>[FormKlien.tsx]"]
  node_guarantor["Guarantor records<br/>[FormPenjamin.tsx]"]
end

subgraph group_casework["Litmas and PK work"]
  node_litmasreg["Litmas request registration<br/>[FormLitmas.tsx]"]
  node_pkwork["PK task management"]
  node_guidance["Client guidance"]
  node_reports["Litmas reports"]
end

subgraph group_oversight["Administration and oversight"]
  node_dashboard["Role dashboard<br/>[Dashboard.tsx]"]
  node_supervision["Section supervision<br/>[Dashboard.tsx]"]
  node_wajib["Mandatory reporting<br/>[WajibLapor.tsx]"]
  node_admin["User and role administration"]
  node_content["Announcements and events"]
  node_reference["Reference data"]
end

subgraph group_platform["Backend platform"]
  node_supabase["Supabase client<br/>[client.ts]"]
  node_database[("Supabase database")]
  node_authservice["Supabase Auth"]
  node_edge["Admin Edge Function"]
end

node_staff(("Bapas staff"))

node_staff -->|"opens"| node_app
node_app -->|"routes"| node_login
node_app -->|"protects"| node_guard
node_app -->|"routes"| node_dashboard
node_login -->|"signs in"| node_auth
node_guard -->|"checks access"| node_auth
node_auth -->|"queries auth and roles"| node_supabase
node_supabase -->|"auth requests"| node_authservice
node_supabase -->|"database requests"| node_database
node_staff -->|"registers services"| node_registration
node_registration -->|"records clients"| node_clients
node_registration -->|"records guarantors"| node_guarantor
node_registration -->|"registers requests"| node_litmasreg
node_staff -->|"handles assigned work"| node_pkwork
node_staff -->|"records guidance"| node_guidance
node_staff -->|"uploads reports"| node_reports
node_staff -->|"monitors cases"| node_supervision
node_staff -->|"manages reporting"| node_wajib
node_staff -->|"administers access"| node_admin
node_staff -->|"manages announcements"| node_content
node_staff -->|"manages reference data"| node_reference
node_registration -->|"persists records"| node_supabase
node_litmasreg -->|"persists requests"| node_supabase
node_pkwork -->|"loads and updates tasks"| node_supabase
node_guidance -->|"persists guidance"| node_supabase
node_reports -->|"stores report data"| node_supabase
node_supervision -->|"loads monitoring data"| node_supabase
node_wajib -->|"loads reporting data"| node_supabase
node_admin -->|"manages records"| node_supabase
node_content -->|"manages events"| node_supabase
node_reference -->|"manages reference tables"| node_supabase
node_admin -.->|"creates users"| node_edge

click node_app "https://github.com/machioneel/monalisa-1/blob/main/src/App.tsx"
click node_login "https://github.com/machioneel/monalisa-1/blob/main/src/pages/Login.tsx"
click node_auth "https://github.com/machioneel/monalisa-1/blob/main/src/contexts/AuthContext.tsx"
click node_guard "https://github.com/machioneel/monalisa-1/blob/main/src/components/ProtectedRoute.tsx"
click node_dashboard "https://github.com/machioneel/monalisa-1/blob/main/src/pages/Dashboard.tsx"
click node_registration "https://github.com/machioneel/monalisa-1/tree/main/src/components/registrasi"
click node_clients "https://github.com/machioneel/monalisa-1/blob/main/src/components/registrasi/FormKlien.tsx"
click node_guarantor "https://github.com/machioneel/monalisa-1/blob/main/src/components/registrasi/FormPenjamin.tsx"
click node_litmasreg "https://github.com/machioneel/monalisa-1/blob/main/src/components/registrasi/FormLayanan/FormLitmas.tsx"
click node_pkwork "https://github.com/machioneel/monalisa-1/tree/main/src/components/pk/FormPK/FormLitmas"
click node_guidance "https://github.com/machioneel/monalisa-1/tree/main/src/components/pk/FormPK/FormPembimbingan"
click node_reports "https://github.com/machioneel/monalisa-1/tree/main/src/components/litmas"
click node_supervision "https://github.com/machioneel/monalisa-1/blob/main/src/pages/Dashboard.tsx"
click node_wajib "https://github.com/machioneel/monalisa-1/blob/main/src/pages/WajibLapor.tsx"
click node_admin "https://github.com/machioneel/monalisa-1/tree/main/src/components/admin"
click node_content "https://github.com/machioneel/monalisa-1/blob/main/src/components/admin/AdminContentManager.tsx"
click node_reference "https://github.com/machioneel/monalisa-1/blob/main/src/components/admin/ReferenceDataManager.tsx"
click node_supabase "https://github.com/machioneel/monalisa-1/blob/main/src/integrations/supabase/client.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_app,node_login,node_auth,node_guard toneBlue
class node_registration,node_clients,node_guarantor toneAmber
class node_litmasreg,node_pkwork,node_guidance,node_reports toneMint
class node_dashboard,node_supervision,node_wajib,node_admin,node_content,node_reference toneRose
class node_supabase,node_database,node_authservice,node_edge,node_staff toneIndigo
```

## Components

### Access and routing

- [Application routes](https://github.com/machioneel/monalisa-1/blob/main/src/App.tsx): `src/App.tsx`
- [Login](https://github.com/machioneel/monalisa-1/blob/main/src/pages/Login.tsx): `src/pages/Login.tsx`
- [Auth and RBAC](https://github.com/machioneel/monalisa-1/blob/main/src/contexts/AuthContext.tsx): `src/contexts/AuthContext.tsx`
- [Protected routes](https://github.com/machioneel/monalisa-1/blob/main/src/components/ProtectedRoute.tsx): `src/components/ProtectedRoute.tsx`

### Client registration

- [Client and service registration](https://github.com/machioneel/monalisa-1/tree/main/src/components/registrasi): `src/components/registrasi`
- [Client records](https://github.com/machioneel/monalisa-1/blob/main/src/components/registrasi/FormKlien.tsx): `src/components/registrasi/FormKlien.tsx`
- [Guarantor records](https://github.com/machioneel/monalisa-1/blob/main/src/components/registrasi/FormPenjamin.tsx): `src/components/registrasi/FormPenjamin.tsx`

### Litmas and PK work

- [Litmas request registration](https://github.com/machioneel/monalisa-1/blob/main/src/components/registrasi/FormLayanan/FormLitmas.tsx): `src/components/registrasi/FormLayanan/FormLitmas.tsx`
- [PK task management](https://github.com/machioneel/monalisa-1/tree/main/src/components/pk/FormPK/FormLitmas): `src/components/pk/FormPK/FormLitmas`
- [Client guidance](https://github.com/machioneel/monalisa-1/tree/main/src/components/pk/FormPK/FormPembimbingan): `src/components/pk/FormPK/FormPembimbingan`
- [Litmas reports](https://github.com/machioneel/monalisa-1/tree/main/src/components/litmas): `src/components/litmas`

### Administration and oversight

- [Role dashboard](https://github.com/machioneel/monalisa-1/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Section supervision](https://github.com/machioneel/monalisa-1/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Mandatory reporting](https://github.com/machioneel/monalisa-1/blob/main/src/pages/WajibLapor.tsx): `src/pages/WajibLapor.tsx`
- [User and role administration](https://github.com/machioneel/monalisa-1/tree/main/src/components/admin): `src/components/admin`
- [Announcements and events](https://github.com/machioneel/monalisa-1/blob/main/src/components/admin/AdminContentManager.tsx): `src/components/admin/AdminContentManager.tsx`
- [Reference data](https://github.com/machioneel/monalisa-1/blob/main/src/components/admin/ReferenceDataManager.tsx): `src/components/admin/ReferenceDataManager.tsx`

### Backend platform

- [Supabase client](https://github.com/machioneel/monalisa-1/blob/main/src/integrations/supabase/client.ts): `src/integrations/supabase/client.ts`
- **Supabase database**
- **Supabase Auth**
- **Admin Edge Function**

### Other components

- **Bapas staff**

## Connections

- Bapas staff → Application routes: opens
- Application routes → Login: routes
- Application routes → Protected routes: protects
- Application routes → Role dashboard: routes
- Login → Auth and RBAC: signs in
- Protected routes → Auth and RBAC: checks access
- Auth and RBAC → Supabase client: queries auth and roles
- Supabase client → Supabase Auth: auth requests
- Supabase client → Supabase database: database requests
- Bapas staff → Client and service registration: registers services
- Client and service registration → Client records: records clients
- Client and service registration → Guarantor records: records guarantors
- Client and service registration → Litmas request registration: registers requests
- Bapas staff → PK task management: handles assigned work
- Bapas staff → Client guidance: records guidance
- Bapas staff → Litmas reports: uploads reports
- Bapas staff → Section supervision: monitors cases
- Bapas staff → Mandatory reporting: manages reporting
- Bapas staff → User and role administration: administers access
- Bapas staff → Announcements and events: manages announcements
- Bapas staff → Reference data: manages reference data
- Client and service registration → Supabase client: persists records
- Litmas request registration → Supabase client: persists requests
- PK task management → Supabase client: loads and updates tasks
- Client guidance → Supabase client: persists guidance
- Litmas reports → Supabase client: stores report data
- Section supervision → Supabase client: loads monitoring data
- Mandatory reporting → Supabase client: loads reporting data
- User and role administration → Supabase client: manages records
- Announcements and events → Supabase client: manages events
- Reference data → Supabase client: manages reference tables
- User and role administration → Admin Edge Function: creates users
