# ppk-01/pertemuan-9 architecture

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

- Interactive diagram: https://gitdiagram.com/ppk-01/pertemuan-9
- Repository: https://github.com/ppk-01/pertemuan-9

## Overview

Rawuh is a mobile practical-session attendance system with Aslab, Asprak (the `asisten` role), and praktikan workflows. Praktikan sign in, find a session, submit location-checked attendance, and may pay a late fine; assistants manage sessions and review leave requests, while Aslab manage labs, membership, and bulk imports. Firebase provides identity and realtime data; a Vercel backend handles fine generation and Midtrans payment notifications. The graph follows documented capabilities and sampled imports; unsampled service internals and some runtime wiring are represented at subsystem level rather than inferred in detail.

Main entry points: [`src/app`](https://github.com/ppk-01/pertemuan-9/tree/main/src/app) (Role navigation), [`server/api/fines/generate.ts`](https://github.com/ppk-01/pertemuan-9/blob/main/server/api/fines/generate.ts) (Fine generation), [`server/api/payments/create.ts`](https://github.com/ppk-01/pertemuan-9/blob/main/server/api/payments/create.ts) (Payment creation), [`src/store/appStore.ts`](https://github.com/ppk-01/pertemuan-9/blob/main/src/store/appStore.ts) (App state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_app["Role navigation"]
  node_global_state["App state<br/>[appStore.ts]"]
  node_aslab_state["Aslab state<br/>[aslabStore.ts]"]
  node_mobile_ui["Shared UI"]
  node_design_tokens["Design tokens"]
end

subgraph group_attendance["Sessions and attendance"]
  node_session_ui["Session display"]
  node_session_views["Session workflows"]
  node_praktikan_views["Praktikan workflows"]
  node_attendance_forms["Location attendance"]
  node_izin_review["Leave requests"]
  node_ai_sentiment["Local sentiment<br/>[ai.ts]"]
end

subgraph group_management["Lab management"]
  node_lab_admin["Lab administration"]
  node_membership["Membership and import"]
  node_aslab_dashboard["Aslab dashboard<br/>[AslabDashboard.tsx]"]
end

subgraph group_money["Fines and payments"]
  node_fine_service["Fine generation<br/>[generate.ts]"]
  node_payment_service["Payment creation<br/>[create.ts]"]
  node_payment_webhook["Payment webhook<br/>[notification.ts]"]
  node_midtrans["Midtrans Sandbox"]
end

subgraph group_platform["Data and integrations"]
  node_client_services["Client data services"]
  node_session_data["Session data<br/>[sessions.ts]"]
  node_firebase[("Firebase")]
  node_server_auth["Backend authentication<br/>[auth.ts]"]
  node_server_firebase["Admin data access<br/>[firebaseAdmin.ts]"]
  node_expo_push["Expo Push Service"]
end

node_practikan(("Praktikan"))
node_asprak(("Asprak"))
node_aslab(("Aslab"))

node_practikan -->|"uses"| node_app
node_asprak -->|"uses"| node_app
node_aslab -->|"uses"| node_app
node_app -->|"loads state"| node_global_state
node_app -->|"shows dashboard"| node_aslab_state
node_app -->|"routes"| node_session_views
node_app -->|"routes"| node_praktikan_views
node_global_state -->|"uses"| node_session_data
node_session_views -->|"reviews requests"| node_izin_review
node_izin_review -->|"shows suggestion"| node_ai_sentiment
node_praktikan_views -->|"records attendance"| node_attendance_forms
node_praktikan_views -->|"requests payment"| node_fine_service
node_session_data -->|"reads and writes"| node_firebase
node_global_state -->|"coordinates features"| node_client_services
node_aslab -->|"manages labs"| node_lab_admin
node_aslab -->|"imports members"| node_membership
node_app -->|"routes"| node_lab_admin
node_app -->|"routes"| node_membership
node_aslab_state -->|"supplies state"| node_aslab_dashboard
node_session_views -->|"generates fines"| node_fine_service
node_fine_service -->|"authenticates"| node_server_auth
node_payment_service -->|"authenticates"| node_server_auth
node_fine_service -->|"stores bills"| node_server_firebase
node_payment_service -->|"reads bill data"| node_server_firebase
node_payment_service -->|"creates payment"| node_midtrans
node_midtrans -->|"sends notification"| node_payment_webhook
node_payment_webhook -.->|"updates payment"| node_server_firebase
node_fine_service -->|"sends bill alerts"| node_expo_push
node_payment_webhook -->|"sends payment alerts"| node_expo_push
node_mobile_ui -->|"uses tokens"| node_design_tokens
node_session_ui -->|"uses tokens"| node_design_tokens

click node_app "https://github.com/ppk-01/pertemuan-9/tree/main/src/app"
click node_global_state "https://github.com/ppk-01/pertemuan-9/blob/main/src/store/appStore.ts"
click node_aslab_state "https://github.com/ppk-01/pertemuan-9/blob/main/src/store/aslabStore.ts"
click node_mobile_ui "https://github.com/ppk-01/pertemuan-9/tree/main/src/components/ui"
click node_design_tokens "https://github.com/ppk-01/pertemuan-9/tree/main/src/theme"
click node_session_ui "https://github.com/ppk-01/pertemuan-9/tree/main/src/components/session"
click node_session_views "https://github.com/ppk-01/pertemuan-9/tree/main/src/app/asisten"
click node_praktikan_views "https://github.com/ppk-01/pertemuan-9/tree/main/src/app/praktikan"
click node_attendance_forms "https://github.com/ppk-01/pertemuan-9/tree/main/src/features/presensi"
click node_izin_review "https://github.com/ppk-01/pertemuan-9/blob/main/src/features/asisten/IzinReviewSheet.tsx"
click node_ai_sentiment "https://github.com/ppk-01/pertemuan-9/blob/main/src/services/ai.ts"
click node_lab_admin "https://github.com/ppk-01/pertemuan-9/tree/main/src/features/lab"
click node_membership "https://github.com/ppk-01/pertemuan-9/tree/main/src/features/bulk"
click node_aslab_dashboard "https://github.com/ppk-01/pertemuan-9/blob/main/src/features/aslab/dashboard/AslabDashboard.tsx"
click node_fine_service "https://github.com/ppk-01/pertemuan-9/blob/main/server/api/fines/generate.ts"
click node_payment_service "https://github.com/ppk-01/pertemuan-9/blob/main/server/api/payments/create.ts"
click node_payment_webhook "https://github.com/ppk-01/pertemuan-9/blob/main/server/api/payments/notification.ts"
click node_client_services "https://github.com/ppk-01/pertemuan-9/tree/main/src/services"
click node_session_data "https://github.com/ppk-01/pertemuan-9/blob/main/src/services/sessions.ts"
click node_server_auth "https://github.com/ppk-01/pertemuan-9/blob/main/server/lib/auth.ts"
click node_server_firebase "https://github.com/ppk-01/pertemuan-9/blob/main/server/lib/firebaseAdmin.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_global_state,node_aslab_state,node_mobile_ui,node_design_tokens toneBlue
class node_session_ui,node_session_views,node_praktikan_views,node_attendance_forms,node_izin_review,node_ai_sentiment toneAmber
class node_lab_admin,node_membership,node_aslab_dashboard toneMint
class node_fine_service,node_payment_service,node_payment_webhook,node_midtrans toneRose
class node_client_services,node_session_data,node_firebase,node_server_auth,node_server_firebase,node_expo_push,node_practikan,node_asprak,node_aslab toneIndigo
```

## Components

### Mobile app

- [Role navigation](https://github.com/ppk-01/pertemuan-9/tree/main/src/app): `src/app`
- [App state](https://github.com/ppk-01/pertemuan-9/blob/main/src/store/appStore.ts): `src/store/appStore.ts`
- [Aslab state](https://github.com/ppk-01/pertemuan-9/blob/main/src/store/aslabStore.ts): `src/store/aslabStore.ts`
- [Shared UI](https://github.com/ppk-01/pertemuan-9/tree/main/src/components/ui): `src/components/ui`
- [Design tokens](https://github.com/ppk-01/pertemuan-9/tree/main/src/theme): `src/theme`

### Sessions and attendance

- [Session display](https://github.com/ppk-01/pertemuan-9/tree/main/src/components/session): `src/components/session`
- [Session workflows](https://github.com/ppk-01/pertemuan-9/tree/main/src/app/asisten): `src/app/asisten`
- [Praktikan workflows](https://github.com/ppk-01/pertemuan-9/tree/main/src/app/praktikan): `src/app/praktikan`
- [Location attendance](https://github.com/ppk-01/pertemuan-9/tree/main/src/features/presensi): `src/features/presensi`
- [Leave requests](https://github.com/ppk-01/pertemuan-9/blob/main/src/features/asisten/IzinReviewSheet.tsx): `src/features/asisten/IzinReviewSheet.tsx`
- [Local sentiment](https://github.com/ppk-01/pertemuan-9/blob/main/src/services/ai.ts): `src/services/ai.ts`

### Lab management

- [Lab administration](https://github.com/ppk-01/pertemuan-9/tree/main/src/features/lab): `src/features/lab`
- [Membership and import](https://github.com/ppk-01/pertemuan-9/tree/main/src/features/bulk): `src/features/bulk`
- [Aslab dashboard](https://github.com/ppk-01/pertemuan-9/blob/main/src/features/aslab/dashboard/AslabDashboard.tsx): `src/features/aslab/dashboard/AslabDashboard.tsx`

### Fines and payments

- [Fine generation](https://github.com/ppk-01/pertemuan-9/blob/main/server/api/fines/generate.ts): `server/api/fines/generate.ts`
- [Payment creation](https://github.com/ppk-01/pertemuan-9/blob/main/server/api/payments/create.ts): `server/api/payments/create.ts`
- [Payment webhook](https://github.com/ppk-01/pertemuan-9/blob/main/server/api/payments/notification.ts): `server/api/payments/notification.ts`
- **Midtrans Sandbox**

### Data and integrations

- [Client data services](https://github.com/ppk-01/pertemuan-9/tree/main/src/services): `src/services`
- [Session data](https://github.com/ppk-01/pertemuan-9/blob/main/src/services/sessions.ts): `src/services/sessions.ts`
- **Firebase**
- [Backend authentication](https://github.com/ppk-01/pertemuan-9/blob/main/server/lib/auth.ts): `server/lib/auth.ts`
- [Admin data access](https://github.com/ppk-01/pertemuan-9/blob/main/server/lib/firebaseAdmin.ts): `server/lib/firebaseAdmin.ts`
- **Expo Push Service**

### Other components

- **Praktikan**
- **Asprak**
- **Aslab**

## Connections

- Praktikan → Role navigation: uses (evidence: `README.md`)
- Asprak → Role navigation: uses (evidence: `README.md`)
- Aslab → Role navigation: uses (evidence: `README.md`)
- Role navigation → App state: loads state (evidence: `src/app/index.tsx`)
- Role navigation → Aslab state: shows dashboard (evidence: `src/app/aslab/index.tsx`)
- Role navigation → Session workflows: routes (evidence: `README.md`)
- Role navigation → Praktikan workflows: routes (evidence: `README.md`)
- App state → Session data: uses (evidence: `src/store/appStore.ts`)
- Session workflows → Leave requests: reviews requests (evidence: `README.md`)
- Leave requests → Local sentiment: shows suggestion (evidence: `src/features/asisten/IzinReviewSheet.tsx`)
- Praktikan workflows → Location attendance: records attendance (evidence: `README.md`)
- Praktikan workflows → Fine generation: requests payment (evidence: `README.md`)
- Session data → Firebase: reads and writes (evidence: `src/services/sessions.ts`)
- App state → Client data services: coordinates features (evidence: `src/store/appStore.ts`)
- Aslab → Lab administration: manages labs (evidence: `README.md`)
- Aslab → Membership and import: imports members (evidence: `README.md`)
- Role navigation → Lab administration: routes (evidence: `README.md`)
- Role navigation → Membership and import: routes (evidence: `README.md`)
- Aslab state → Aslab dashboard: supplies state (evidence: `src/app/aslab/index.tsx`)
- Session workflows → Fine generation: generates fines (evidence: `README.md`)
- Fine generation → Backend authentication: authenticates (evidence: `server/api/fines/generate.ts`)
- Payment creation → Backend authentication: authenticates (evidence: `server/api/payments/create.ts`)
- Fine generation → Admin data access: stores bills (evidence: `server/api/fines/generate.ts`)
- Payment creation → Admin data access: reads bill data (evidence: `server/api/payments/create.ts`)
- Payment creation → Midtrans Sandbox: creates payment (evidence: `README.md`)
- Midtrans Sandbox → Payment webhook: sends notification (evidence: `README.md`)
- Payment webhook → Admin data access: updates payment
- Fine generation → Expo Push Service: sends bill alerts (evidence: `README.md`)
- Payment webhook → Expo Push Service: sends payment alerts (evidence: `README.md`)
- Shared UI → Design tokens: uses tokens (evidence: `src/components/ui/Button.tsx`)
- Session display → Design tokens: uses tokens (evidence: `src/components/session/SessionRow.tsx`)
