# yyogaandhika/dharma-loka-school architecture

> Architecture diagram of the GitHub repository yyogaandhika/dharma-loka-school, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yyogaandhika/dharma-loka-school
- Repository: https://github.com/yyogaandhika/dharma-loka-school

## Overview

Dharma Loka School is a school information site and online PPDB admissions portal, with applicant and staff workflows. The central applicant path runs from public admissions information and account access through registration, document/payment management, and status tracking; staff administer applications and school content. The graph includes sampled call relationships and documented module references only. Several PPDB screens and data actions are indexed but unsampled, so their internal wiring is not asserted.

Main entry points: [`src/lib/supabase/server.ts`](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/lib/supabase/server.ts) (Supabase clients), [`src/app/(ppdb)/actions.ts`](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(ppdb)/actions.ts) (Admissions actions), [`src/components/shared/ReferenceSections.tsx`](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/components/shared/ReferenceSections.tsx) (Content widgets), [`src/lib/supabase/client.ts`](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/lib/supabase/client.ts) (Browser client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["School information"]
  node_publicpages["Public school pages"]
  node_homepage["Home experience<br/>[page.tsx]"]
  node_nav["Site navigation<br/>[Navbar.tsx]"]
  node_sharedcontent["Content widgets"]
  node_language["Language provider<br/>[LangProvider.tsx]"]
end

subgraph group_identity["Accounts and access"]
  node_authpages["Login and registration"]
  node_authactions["Authentication actions<br/>[actions.ts]"]
  node_authhelpers["User and role helpers<br/>[auth.ts]"]
end

subgraph group_admissions["PPDB admissions"]
  node_registration["Registration wizard"]
  node_ppdbactions["Admissions actions<br/>[actions.ts]"]
  node_applicantdashboard["Applicant dashboard<br/>[page.tsx]"]
  node_registrationdetail["Application detail<br/>[page.tsx]"]
  node_documents["Document manager"]
  node_payments["Payment section"]
  node_tracker["Realtime tracker"]
end

subgraph group_operations["Staff operations"]
  node_adminpage["Staff administration<br/>[page.tsx]"]
  node_adminactions["Admin actions<br/>[actions.ts]"]
end

subgraph group_platform["Data and services"]
  node_reference["School reference data<br/>[reference-data.ts]"]
  node_supabaseauth["Supabase authentication<br/>[auth.ts]"]
  node_supabaseclients["Supabase clients<br/>[server.ts]"]
  node_browserclient["Browser client<br/>[client.ts]"]
  node_dbtypes["Database schema types<br/>[types.ts]"]
  node_middleware["Session middleware<br/>[middleware.ts]"]
  node_nextmiddleware["Request middleware<br/>[middleware.ts]"]
end

node_visitor(("Visitor or applicant"))
node_supabase[("Supabase")]

node_visitor -->|"browses"| node_publicpages
node_visitor -.->|"signs in"| node_authpages
node_visitor -.->|"starts application"| node_registration
node_homepage -->|"renders"| node_sharedcontent
node_homepage -->|"uses"| node_language
node_nav -->|"reads"| node_reference
node_nav -->|"uses"| node_language
node_sharedcontent -->|"reads"| node_reference
node_sharedcontent -->|"uses"| node_language
node_authpages -->|"submits to"| node_authactions
node_authactions -->|"creates client"| node_supabaseclients
node_authhelpers -->|"creates client"| node_supabaseclients
node_registration -.->|"submits to"| node_ppdbactions
node_applicantdashboard -->|"checks identity"| node_authhelpers
node_applicantdashboard -->|"reads data"| node_supabaseclients
node_registrationdetail -.->|"renders"| node_documents
node_registrationdetail -.->|"renders"| node_payments
node_registrationdetail -.->|"renders"| node_tracker
node_documents -->|"uploads and requests links"| node_ppdbactions
node_adminpage -->|"manages content"| node_adminactions
node_adminpage -->|"requests document links"| node_ppdbactions
node_sharedcontent -->|"loads relational data"| node_adminactions
node_adminactions -->|"creates client"| node_supabaseclients
node_ppdbactions -->|"creates client"| node_supabaseclients
node_supabaseauth -->|"creates client"| node_supabaseclients
node_supabaseclients -->|"normalizes URL"| node_browserclient
node_browserclient -->|"types client"| node_dbtypes
node_supabaseclients -->|"types client"| node_dbtypes
node_authhelpers -->|"uses roles"| node_dbtypes
node_ppdbactions -->|"uses schema"| node_dbtypes
node_supabaseclients -.->|"connects"| node_supabase
node_browserclient -.->|"connects"| node_supabase
node_nextmiddleware -->|"delegates"| node_middleware
node_middleware -->|"creates client"| node_browserclient
node_middleware -.->|"refreshes session"| node_supabase

click node_publicpages "https://github.com/yyogaandhika/dharma-loka-school/tree/main/src/app/(public)"
click node_homepage "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(public)/page.tsx"
click node_nav "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/components/layout/Navbar.tsx"
click node_sharedcontent "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/components/shared/ReferenceSections.tsx"
click node_reference "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/lib/reference-data.ts"
click node_language "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/components/shared/LangProvider.tsx"
click node_authpages "https://github.com/yyogaandhika/dharma-loka-school/tree/main/src/app/(auth)"
click node_authactions "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(auth)/actions.ts"
click node_authhelpers "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/lib/supabase/auth.ts"
click node_registration "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(ppdb)/ppdb/daftar/PPDBRegistrationWizard.tsx"
click node_ppdbactions "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(ppdb)/actions.ts"
click node_applicantdashboard "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(ppdb)/ppdb/dashboard/page.tsx"
click node_registrationdetail "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(ppdb)/ppdb/pendaftaran/%5Bid%5D/page.tsx"
click node_documents "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(ppdb)/ppdb/pendaftaran/%5Bid%5D/PPDBDocumentManager.tsx"
click node_payments "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(ppdb)/ppdb/pendaftaran/%5Bid%5D/PPDBPaymentSection.tsx"
click node_tracker "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(ppdb)/ppdb/pendaftaran/%5Bid%5D/PPDBRealtimeTracker.tsx"
click node_adminpage "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(admin)/admin/page.tsx"
click node_adminactions "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(admin)/actions.ts"
click node_supabaseauth "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/lib/supabase/auth.ts"
click node_supabaseclients "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/lib/supabase/server.ts"
click node_browserclient "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/lib/supabase/client.ts"
click node_dbtypes "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/lib/supabase/types.ts"
click node_middleware "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/lib/supabase/middleware.ts"
click node_nextmiddleware "https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/middleware.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_publicpages,node_homepage,node_nav,node_sharedcontent,node_language toneBlue
class node_authpages,node_authactions,node_authhelpers,node_supabase toneAmber
class node_registration,node_ppdbactions,node_applicantdashboard,node_registrationdetail,node_documents,node_payments,node_tracker toneMint
class node_adminpage,node_adminactions toneRose
class node_reference,node_supabaseauth,node_supabaseclients,node_browserclient,node_dbtypes,node_middleware,node_nextmiddleware,node_visitor toneIndigo
```

## Components

### School information

- [Public school pages](https://github.com/yyogaandhika/dharma-loka-school/tree/main/src/app/(public)): `src/app/(public)`
- [Home experience](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(public)/page.tsx): `src/app/(public)/page.tsx`
- [Site navigation](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/components/layout/Navbar.tsx): `src/components/layout/Navbar.tsx`
- [Content widgets](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/components/shared/ReferenceSections.tsx): `src/components/shared/ReferenceSections.tsx`
- [Language provider](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/components/shared/LangProvider.tsx): `src/components/shared/LangProvider.tsx`

### Accounts and access

- [Login and registration](https://github.com/yyogaandhika/dharma-loka-school/tree/main/src/app/(auth)): `src/app/(auth)`
- [Authentication actions](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(auth)/actions.ts): `src/app/(auth)/actions.ts`
- [User and role helpers](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/lib/supabase/auth.ts): `src/lib/supabase/auth.ts`

### PPDB admissions

- [Registration wizard](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(ppdb)/ppdb/daftar/PPDBRegistrationWizard.tsx): `src/app/(ppdb)/ppdb/daftar/PPDBRegistrationWizard.tsx`
- [Admissions actions](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(ppdb)/actions.ts): `src/app/(ppdb)/actions.ts`
- [Applicant dashboard](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(ppdb)/ppdb/dashboard/page.tsx): `src/app/(ppdb)/ppdb/dashboard/page.tsx`
- [Application detail](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(ppdb)/ppdb/pendaftaran/%5Bid%5D/page.tsx): `src/app/(ppdb)/ppdb/pendaftaran/[id]/page.tsx`
- [Document manager](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(ppdb)/ppdb/pendaftaran/%5Bid%5D/PPDBDocumentManager.tsx): `src/app/(ppdb)/ppdb/pendaftaran/[id]/PPDBDocumentManager.tsx`
- [Payment section](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(ppdb)/ppdb/pendaftaran/%5Bid%5D/PPDBPaymentSection.tsx): `src/app/(ppdb)/ppdb/pendaftaran/[id]/PPDBPaymentSection.tsx`
- [Realtime tracker](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(ppdb)/ppdb/pendaftaran/%5Bid%5D/PPDBRealtimeTracker.tsx): `src/app/(ppdb)/ppdb/pendaftaran/[id]/PPDBRealtimeTracker.tsx`

### Staff operations

- [Staff administration](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(admin)/admin/page.tsx): `src/app/(admin)/admin/page.tsx`
- [Admin actions](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/app/(admin)/actions.ts): `src/app/(admin)/actions.ts`

### Data and services

- [School reference data](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/lib/reference-data.ts): `src/lib/reference-data.ts`
- [Supabase authentication](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/lib/supabase/auth.ts): `src/lib/supabase/auth.ts`
- [Supabase clients](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`
- [Browser client](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`
- [Database schema types](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/lib/supabase/types.ts): `src/lib/supabase/types.ts`
- [Session middleware](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/lib/supabase/middleware.ts): `src/lib/supabase/middleware.ts`
- [Request middleware](https://github.com/yyogaandhika/dharma-loka-school/blob/main/src/middleware.ts): `src/middleware.ts`

### Other components

- **Visitor or applicant**
- **Supabase**

## Connections

- Visitor or applicant → Public school pages: browses (evidence: `src/app/(public)/page.tsx`)
- Visitor or applicant → Login and registration: signs in
- Visitor or applicant → Registration wizard: starts application
- Home experience → Content widgets: renders (evidence: `src/app/(public)/page.tsx`)
- Home experience → Language provider: uses (evidence: `src/app/(public)/page.tsx`)
- Site navigation → School reference data: reads (evidence: `src/components/layout/Navbar.tsx`)
- Site navigation → Language provider: uses (evidence: `src/components/layout/Navbar.tsx`)
- Content widgets → School reference data: reads (evidence: `src/components/shared/ReferenceSections.tsx`)
- Content widgets → Language provider: uses (evidence: `src/components/shared/ReferenceSections.tsx`)
- Login and registration → Authentication actions: submits to (evidence: `src/app/(auth)/login/page.tsx`)
- Authentication actions → Supabase clients: creates client (evidence: `src/app/(auth)/actions.ts`)
- User and role helpers → Supabase clients: creates client (evidence: `src/lib/supabase/auth.ts`)
- Registration wizard → Admissions actions: submits to
- Applicant dashboard → User and role helpers: checks identity (evidence: `src/app/(ppdb)/ppdb/dashboard/page.tsx`)
- Applicant dashboard → Supabase clients: reads data (evidence: `src/app/(ppdb)/ppdb/dashboard/page.tsx`)
- Application detail → Document manager: renders
- Application detail → Payment section: renders
- Application detail → Realtime tracker: renders
- Document manager → Admissions actions: uploads and requests links (evidence: `src/app/(ppdb)/ppdb/pendaftaran/[id]/PPDBDocumentManager.tsx`)
- Staff administration → Admin actions: manages content (evidence: `src/app/(admin)/admin/page.tsx`)
- Staff administration → Admissions actions: requests document links (evidence: `src/app/(admin)/admin/page.tsx`)
- Content widgets → Admin actions: loads relational data (evidence: `src/components/shared/ReferenceSections.tsx`)
- Admin actions → Supabase clients: creates client (evidence: `src/app/(admin)/actions.ts`)
- Admissions actions → Supabase clients: creates client (evidence: `src/app/(ppdb)/actions.ts`)
- Supabase authentication → Supabase clients: creates client (evidence: `src/lib/supabase/auth.ts`)
- Supabase clients → Browser client: normalizes URL (evidence: `src/lib/supabase/server.ts`)
- Browser client → Database schema types: types client (evidence: `src/lib/supabase/client.ts`)
- Supabase clients → Database schema types: types client (evidence: `src/lib/supabase/server.ts`)
- User and role helpers → Database schema types: uses roles (evidence: `src/lib/supabase/auth.ts`)
- Admissions actions → Database schema types: uses schema (evidence: `src/app/(ppdb)/actions.ts`)
- Supabase clients → Supabase: connects
- Browser client → Supabase: connects
- Request middleware → Session middleware: delegates (evidence: `src/middleware.ts`)
- Session middleware → Browser client: creates client (evidence: `src/lib/supabase/middleware.ts`)
- Session middleware → Supabase: refreshes session
