# naufalms29/sim-panti-asuwain architecture

> Architecture diagram of the GitHub repository naufalms29/sim-panti-asuwain, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/naufalms29/sim-panti-asuwain
- Repository: https://github.com/naufalms29/sim-panti-asuwain

## Overview

Sistem Informasi Manajemen Panti Asuhan Asuwain is a web application for public information and services, donor and child self-service, and staff operations. Public visitors browse the landing page, submit or track visit requests, and view donation information. Signed-in users authenticate and reach role-limited dashboards for their own records or staff management of children, donations, finances, inventory, visits, and institutional content. The README documents these capabilities and Prisma/MySQL; sampled source confirms landing-page composition, authentication, inventory actions, and protected private-file delivery. Other feature-level wiring is not sampled, so those links reflect README documentation.

Main entry points: [`src/app/(dashboard)/dashboard`](https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/app/(dashboard)/dashboard) (Role dashboards), [`src/lib/prisma.ts`](https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/lib/prisma.ts) (MySQL via Prisma), [`src/app/page.tsx`](https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/app/page.tsx) (Public landing), [`src/app/api/berkas-anak/[id_berkas]/route.ts`](https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/app/api/berkas-anak/%5Bid_berkas%5D/route.ts) (Private file endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public Experience"]
  node_landing["Public landing<br/>[page.tsx]"]
  node_cms_content["Institution content"]
  node_public_activities["News and activities"]
  node_landing_sections["Landing sections"]
  node_public_visits["Visit request and tracking"]
end

subgraph group_access["Access and Self-Service"]
  node_auth_pages["Login and registration"]
  node_auth_runtime["Authentication<br/>[auth.ts]"]
  node_auth_service["Credential and OTP service<br/>[auth.service.ts]"]
  node_dashboard["Role dashboards"]
  node_private_documents["Child documents"]
  node_document_endpoint["Private file endpoint<br/>[route.ts]"]
end

subgraph group_operations["Panti Operations"]
  node_child_records["Children and alumni"]
  node_donations["Donations and donors"]
  node_finance_inventory["Finance and inventory"]
  node_visit_admin["Visit management"]
  node_institution_admin["Institution management"]
  node_activity_admin["News and activities admin"]
end

subgraph group_platform["Shared Platform"]
  node_role_policy["Role permissions<br/>[rbac.ts]"]
  node_document_storage["Private file storage"]
  node_database[("MySQL via Prisma<br/>[prisma.ts]")]
end

node_visitor(("Public visitor"))
node_staff(("Admin and staff"))
node_member(("Donor or child"))

node_visitor -->|"opens"| node_landing
node_landing -->|"loads profile content"| node_cms_content
node_landing -->|"loads activities and news"| node_public_activities
node_landing -->|"renders"| node_landing_sections
node_landing_sections -->|"includes visit portal"| node_public_visits
node_visitor -->|"requests or tracks visit"| node_public_visits
node_visitor -->|"views donation information"| node_landing_sections
node_member -->|"signs in or registers"| node_auth_pages
node_auth_pages -->|"uses authentication"| node_auth_runtime
node_auth_runtime -->|"verifies credentials"| node_auth_service
node_auth_runtime -->|"loads user record"| node_database
node_member -->|"opens role dashboard"| node_dashboard
node_dashboard -->|"checks permissions"| node_role_policy
node_staff -->|"manages records"| node_dashboard
node_dashboard -->|"manages children and alumni"| node_child_records
node_dashboard -->|"manages or views donations"| node_donations
node_dashboard -->|"manages finances and logistics"| node_finance_inventory
node_dashboard -->|"verifies visit requests"| node_visit_admin
node_dashboard -->|"manages institutional content"| node_institution_admin
node_dashboard -->|"manages news and activities"| node_activity_admin
node_member -->|"views own documents"| node_private_documents
node_private_documents -->|"requests protected file"| node_document_endpoint
node_document_endpoint -->|"checks access"| node_role_policy
node_document_endpoint -->|"looks up document owner"| node_database
node_document_endpoint -->|"resolves and reads file"| node_document_storage
node_child_records -.->|"stores records"| node_database
node_donations -.->|"stores donation records"| node_database
node_finance_inventory -.->|"stores operational records"| node_database
node_visit_admin -.->|"stores visit schedules"| node_database
node_institution_admin -.->|"stores institution content"| node_database
node_activity_admin -.->|"stores activities and news"| node_database

click node_landing "https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/app/page.tsx"
click node_cms_content "https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/cms/services"
click node_public_activities "https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/features/kegiatan/services/kegiatan.service.ts"
click node_landing_sections "https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/landing/components"
click node_public_visits "https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/kunjungan/components/public"
click node_auth_pages "https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/app/(auth)"
click node_auth_runtime "https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/auth.ts"
click node_auth_service "https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/features/auth/services/auth.service.ts"
click node_role_policy "https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/lib/rbac.ts"
click node_dashboard "https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/app/(dashboard)/dashboard"
click node_child_records "https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/anak-panti"
click node_private_documents "https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/berkas-anak"
click node_document_endpoint "https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/app/api/berkas-anak/%5Bid_berkas%5D/route.ts"
click node_document_storage "https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/features/berkas-anak/utils/berkas-storage.utils.ts"
click node_donations "https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/donasi"
click node_finance_inventory "https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/inventaris"
click node_visit_admin "https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/kunjungan"
click node_institution_admin "https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/cms"
click node_activity_admin "https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/kegiatan"
click node_database "https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/lib/prisma.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_landing,node_cms_content,node_public_activities,node_landing_sections,node_public_visits toneBlue
class node_auth_pages,node_auth_runtime,node_auth_service,node_dashboard,node_private_documents,node_document_endpoint toneAmber
class node_child_records,node_donations,node_finance_inventory,node_visit_admin,node_institution_admin,node_activity_admin toneMint
class node_role_policy,node_document_storage,node_database toneRose
class node_visitor,node_staff,node_member toneIndigo
```

## Components

### Public Experience

- [Public landing](https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Institution content](https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/cms/services): `src/features/cms/services`
- [News and activities](https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/features/kegiatan/services/kegiatan.service.ts): `src/features/kegiatan/services/kegiatan.service.ts`
- [Landing sections](https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/landing/components): `src/features/landing/components`
- [Visit request and tracking](https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/kunjungan/components/public): `src/features/kunjungan/components/public`

### Access and Self-Service

- [Login and registration](https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/app/(auth)): `src/app/(auth)`
- [Authentication](https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/auth.ts): `src/auth.ts`
- [Credential and OTP service](https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/features/auth/services/auth.service.ts): `src/features/auth/services/auth.service.ts`
- [Role dashboards](https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/app/(dashboard)/dashboard): `src/app/(dashboard)/dashboard`
- [Child documents](https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/berkas-anak): `src/features/berkas-anak`
- [Private file endpoint](https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/app/api/berkas-anak/%5Bid_berkas%5D/route.ts): `src/app/api/berkas-anak/[id_berkas]/route.ts`

### Panti Operations

- [Children and alumni](https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/anak-panti): `src/features/anak-panti`
- [Donations and donors](https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/donasi): `src/features/donasi`
- [Finance and inventory](https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/inventaris): `src/features/inventaris`
- [Visit management](https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/kunjungan): `src/features/kunjungan`
- [Institution management](https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/cms): `src/features/cms`
- [News and activities admin](https://github.com/naufalms29/sim-panti-asuwain/tree/main/src/features/kegiatan): `src/features/kegiatan`

### Shared Platform

- [Role permissions](https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/lib/rbac.ts): `src/lib/rbac.ts`
- [Private file storage](https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/features/berkas-anak/utils/berkas-storage.utils.ts): `src/features/berkas-anak/utils/berkas-storage.utils.ts`
- [MySQL via Prisma](https://github.com/naufalms29/sim-panti-asuwain/blob/main/src/lib/prisma.ts): `src/lib/prisma.ts`

### Other components

- **Public visitor**
- **Admin and staff**
- **Donor or child**

## Connections

- Public visitor → Public landing: opens (evidence: `src/app/page.tsx`)
- Public landing → Institution content: loads profile content (evidence: `src/app/page.tsx`)
- Public landing → News and activities: loads activities and news (evidence: `src/app/page.tsx`)
- Public landing → Landing sections: renders (evidence: `src/app/page.tsx`)
- Landing sections → Visit request and tracking: includes visit portal
- Public visitor → Visit request and tracking: requests or tracks visit (evidence: `README.md`)
- Public visitor → Landing sections: views donation information (evidence: `README.md`)
- Donor or child → Login and registration: signs in or registers (evidence: `README.md`)
- Login and registration → Authentication: uses authentication (evidence: `src/app/(auth)/login/page.tsx`)
- Authentication → Credential and OTP service: verifies credentials (evidence: `src/auth.ts`)
- Authentication → MySQL via Prisma: loads user record (evidence: `src/auth.ts`)
- Donor or child → Role dashboards: opens role dashboard (evidence: `README.md`)
- Role dashboards → Role permissions: checks permissions (evidence: `README.md`)
- Admin and staff → Role dashboards: manages records (evidence: `README.md`)
- Role dashboards → Children and alumni: manages children and alumni (evidence: `README.md`)
- Role dashboards → Donations and donors: manages or views donations (evidence: `README.md`)
- Role dashboards → Finance and inventory: manages finances and logistics (evidence: `README.md`)
- Role dashboards → Visit management: verifies visit requests (evidence: `README.md`)
- Role dashboards → Institution management: manages institutional content (evidence: `README.md`)
- Role dashboards → News and activities admin: manages news and activities (evidence: `README.md`)
- Donor or child → Child documents: views own documents (evidence: `README.md`)
- Child documents → Private file endpoint: requests protected file (evidence: `README.md`)
- Private file endpoint → Role permissions: checks access (evidence: `src/app/api/berkas-anak/[id_berkas]/route.ts`)
- Private file endpoint → MySQL via Prisma: looks up document owner (evidence: `src/app/api/berkas-anak/[id_berkas]/route.ts`)
- Private file endpoint → Private file storage: resolves and reads file (evidence: `src/app/api/berkas-anak/[id_berkas]/route.ts`)
- Children and alumni → MySQL via Prisma: stores records (evidence: `README.md`)
- Donations and donors → MySQL via Prisma: stores donation records (evidence: `README.md`)
- Finance and inventory → MySQL via Prisma: stores operational records (evidence: `README.md`)
- Visit management → MySQL via Prisma: stores visit schedules (evidence: `README.md`)
- Institution management → MySQL via Prisma: stores institution content (evidence: `README.md`)
- News and activities admin → MySQL via Prisma: stores activities and news (evidence: `README.md`)
