# itztotaeba/nabungnikah2 architecture

> Architecture diagram of the GitHub repository itztotaeba/nabungnikah2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/itztotaeba/nabungnikah2
- Repository: https://github.com/itztotaeba/nabungnikah2

## Overview

Nabung Nikah is a wedding-planning app whose main workflow is managing a couple’s plans across budget, savings, guests, vendors, and tasks, then viewing progress on a dashboard. Data is persisted locally and can sync to Supabase; accounts and collaboration support shared planning. The graph preserves documented export, realtime, audit, and financial-analysis capabilities. Relationships are limited to README statements, shown excerpts, and SOURCE INDEX references; unsampled implementations are represented only where their paths are present in the tree.

Main entry points: [`src/store.ts`](https://github.com/itztotaeba/nabungnikah2/blob/main/src/store.ts) (Wedding data state), [`src/App.tsx`](https://github.com/itztotaeba/nabungnikah2/blob/main/src/App.tsx) (App navigation), [`src/syncStore.ts`](https://github.com/itztotaeba/nabungnikah2/blob/main/src/syncStore.ts) (Cloud sync state), [`src/components/Dashboard.tsx`](https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/Dashboard.tsx) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Planning workspace"]
  node_app["App navigation<br/>[App.tsx]"]
  node_budget["Budget manager<br/>[BudgetManager.tsx]"]
  node_savings["Savings tracker<br/>[SavingsTracker.tsx]"]
  node_guests["Guest manager<br/>[GuestManager.tsx]"]
  node_vendors["Vendor manager<br/>[VendorManager.tsx]"]
  node_comparison["Vendor comparison"]
  node_timeline["Task timeline"]
  node_defaults["Default tasks<br/>[defaultTasks.ts]"]
end

subgraph group_insights["Dashboard and exports"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_emergency["Emergency buffer"]
  node_calculations["Planning calculations<br/>[helpers.ts]"]
  node_excel["Excel export<br/>[excelGenerator.ts]"]
  node_pdf["PDF export<br/>[pdfGenerator.ts]"]
end

subgraph group_sharing["Accounts and collaboration"]
  node_authui["Authentication UI<br/>[AuthModal.tsx]"]
  node_auth["Authentication state<br/>[authStore.ts]"]
  node_collabui["Collaboration settings"]
  node_collab["Membership and invites"]
  node_audit["Audit trail<br/>[auditTrail.ts]"]
end

subgraph group_persistence["State and sync"]
  node_weddingstate["Wedding data state<br/>[store.ts]"]
  node_localstorage[("Browser local storage")]
  node_syncprovider["Cloud sync provider"]
  node_sync["Cloud sync state<br/>[syncStore.ts]"]
  node_realtime["Realtime sync hook<br/>[useRealtimeSync.ts]"]
  node_supabaseclient["Supabase client<br/>[supabase.ts]"]
end

node_couple(("Couple"))
node_supabase[("Supabase service")]

node_couple -->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_budget
node_app -->|"routes to"| node_savings
node_app -->|"routes to"| node_guests
node_app -->|"routes to"| node_vendors
node_app -->|"routes to"| node_timeline
node_vendors -->|"renders"| node_comparison
node_timeline -->|"uses task data"| node_defaults
node_budget -->|"reads and updates"| node_weddingstate
node_savings -->|"reads and updates"| node_weddingstate
node_guests -->|"reads and updates"| node_weddingstate
node_vendors -->|"reads and updates"| node_weddingstate
node_timeline -->|"reads and updates"| node_weddingstate
node_dashboard -->|"reads"| node_weddingstate
node_dashboard -->|"renders"| node_emergency
node_emergency -->|"calculates buffer"| node_calculations
node_budget -->|"uses calculations"| node_calculations
node_dashboard -->|"exports"| node_excel
node_dashboard -->|"exports"| node_pdf
node_guests -->|"exports guest list"| node_pdf
node_app -->|"shows sign-in"| node_authui
node_authui -->|"uses auth state"| node_auth
node_auth -->|"authenticates with"| node_supabaseclient
node_collabui -->|"uses collaboration state"| node_collab
node_collab -->|"reads user"| node_auth
node_collab -->|"manages membership"| node_supabaseclient
node_weddingstate -->|"persists locally"| node_localstorage
node_weddingstate -->|"records changes"| node_audit
node_syncprovider -->|"connects sync"| node_sync
node_syncprovider -->|"connects data state"| node_weddingstate
node_syncprovider -->|"connects collaboration"| node_collab
node_sync -->|"reads and hydrates"| node_weddingstate
node_sync -->|"reads wedding context"| node_collab
node_sync -->|"reads user"| node_auth
node_sync -->|"syncs data"| node_supabaseclient
node_realtime -->|"subscribes"| node_supabaseclient
node_realtime -->|"updates sync state"| node_sync
node_supabaseclient -->|"connects"| node_supabase

click node_app "https://github.com/itztotaeba/nabungnikah2/blob/main/src/App.tsx"
click node_budget "https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/BudgetManager.tsx"
click node_savings "https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/SavingsTracker.tsx"
click node_guests "https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/GuestManager.tsx"
click node_vendors "https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/VendorManager.tsx"
click node_comparison "https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/ComparisonAnalysis.tsx"
click node_timeline "https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/TimelineManager.tsx"
click node_defaults "https://github.com/itztotaeba/nabungnikah2/blob/main/src/data/defaultTasks.ts"
click node_dashboard "https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/Dashboard.tsx"
click node_emergency "https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/EmergencyBufferAlert.tsx"
click node_calculations "https://github.com/itztotaeba/nabungnikah2/blob/main/src/helpers.ts"
click node_excel "https://github.com/itztotaeba/nabungnikah2/blob/main/src/helpers/excelGenerator.ts"
click node_pdf "https://github.com/itztotaeba/nabungnikah2/blob/main/src/helpers/pdfGenerator.ts"
click node_authui "https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/AuthModal.tsx"
click node_auth "https://github.com/itztotaeba/nabungnikah2/blob/main/src/authStore.ts"
click node_collabui "https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/CollaborationSection.tsx"
click node_collab "https://github.com/itztotaeba/nabungnikah2/blob/main/src/collaborationStore.ts"
click node_audit "https://github.com/itztotaeba/nabungnikah2/blob/main/src/helpers/auditTrail.ts"
click node_weddingstate "https://github.com/itztotaeba/nabungnikah2/blob/main/src/store.ts"
click node_syncprovider "https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/SupabaseSyncProvider.tsx"
click node_sync "https://github.com/itztotaeba/nabungnikah2/blob/main/src/syncStore.ts"
click node_realtime "https://github.com/itztotaeba/nabungnikah2/blob/main/src/hooks/useRealtimeSync.ts"
click node_supabaseclient "https://github.com/itztotaeba/nabungnikah2/blob/main/src/lib/supabase.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_budget,node_savings,node_guests,node_vendors,node_comparison,node_timeline,node_defaults toneBlue
class node_dashboard,node_emergency,node_calculations,node_excel,node_pdf,node_supabase toneAmber
class node_authui,node_auth,node_collabui,node_collab,node_audit toneMint
class node_weddingstate,node_localstorage,node_syncprovider,node_sync,node_realtime,node_supabaseclient toneRose
class node_couple toneIndigo
```

## Components

### Planning workspace

- [App navigation](https://github.com/itztotaeba/nabungnikah2/blob/main/src/App.tsx): `src/App.tsx`
- [Budget manager](https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/BudgetManager.tsx): `src/components/BudgetManager.tsx`
- [Savings tracker](https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/SavingsTracker.tsx): `src/components/SavingsTracker.tsx`
- [Guest manager](https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/GuestManager.tsx): `src/components/GuestManager.tsx`
- [Vendor manager](https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/VendorManager.tsx): `src/components/VendorManager.tsx`
- [Vendor comparison](https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/ComparisonAnalysis.tsx): `src/components/ComparisonAnalysis.tsx`
- [Task timeline](https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/TimelineManager.tsx): `src/components/TimelineManager.tsx`
- [Default tasks](https://github.com/itztotaeba/nabungnikah2/blob/main/src/data/defaultTasks.ts): `src/data/defaultTasks.ts`

### Dashboard and exports

- [Dashboard](https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/Dashboard.tsx): `src/components/Dashboard.tsx`
- [Emergency buffer](https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/EmergencyBufferAlert.tsx): `src/components/EmergencyBufferAlert.tsx`
- [Planning calculations](https://github.com/itztotaeba/nabungnikah2/blob/main/src/helpers.ts): `src/helpers.ts`
- [Excel export](https://github.com/itztotaeba/nabungnikah2/blob/main/src/helpers/excelGenerator.ts): `src/helpers/excelGenerator.ts`
- [PDF export](https://github.com/itztotaeba/nabungnikah2/blob/main/src/helpers/pdfGenerator.ts): `src/helpers/pdfGenerator.ts`

### Accounts and collaboration

- [Authentication UI](https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/AuthModal.tsx): `src/components/AuthModal.tsx`
- [Authentication state](https://github.com/itztotaeba/nabungnikah2/blob/main/src/authStore.ts): `src/authStore.ts`
- [Collaboration settings](https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/CollaborationSection.tsx): `src/components/CollaborationSection.tsx`
- [Membership and invites](https://github.com/itztotaeba/nabungnikah2/blob/main/src/collaborationStore.ts): `src/collaborationStore.ts`
- [Audit trail](https://github.com/itztotaeba/nabungnikah2/blob/main/src/helpers/auditTrail.ts): `src/helpers/auditTrail.ts`

### State and sync

- [Wedding data state](https://github.com/itztotaeba/nabungnikah2/blob/main/src/store.ts): `src/store.ts`
- **Browser local storage**
- [Cloud sync provider](https://github.com/itztotaeba/nabungnikah2/blob/main/src/components/SupabaseSyncProvider.tsx): `src/components/SupabaseSyncProvider.tsx`
- [Cloud sync state](https://github.com/itztotaeba/nabungnikah2/blob/main/src/syncStore.ts): `src/syncStore.ts`
- [Realtime sync hook](https://github.com/itztotaeba/nabungnikah2/blob/main/src/hooks/useRealtimeSync.ts): `src/hooks/useRealtimeSync.ts`
- [Supabase client](https://github.com/itztotaeba/nabungnikah2/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`

### Other components

- **Couple**
- **Supabase service**

## Connections

- Couple → App navigation: uses (evidence: `README.md`)
- App navigation → Dashboard: routes to (evidence: `src/App.tsx`)
- App navigation → Budget manager: routes to (evidence: `src/App.tsx`)
- App navigation → Savings tracker: routes to (evidence: `src/App.tsx`)
- App navigation → Guest manager: routes to (evidence: `src/App.tsx`)
- App navigation → Vendor manager: routes to (evidence: `src/App.tsx`)
- App navigation → Task timeline: routes to (evidence: `src/App.tsx`)
- Vendor manager → Vendor comparison: renders (evidence: `src/components/VendorManager.tsx`)
- Task timeline → Default tasks: uses task data (evidence: `src/data/defaultTasks.ts`)
- Budget manager → Wedding data state: reads and updates (evidence: `src/components/BudgetManager.tsx`)
- Savings tracker → Wedding data state: reads and updates (evidence: `src/components/SavingsTracker.tsx`)
- Guest manager → Wedding data state: reads and updates (evidence: `src/components/GuestManager.tsx`)
- Vendor manager → Wedding data state: reads and updates (evidence: `src/components/VendorManager.tsx`)
- Task timeline → Wedding data state: reads and updates (evidence: `src/components/TimelineManager.tsx`)
- Dashboard → Wedding data state: reads (evidence: `src/components/Dashboard.tsx`)
- Dashboard → Emergency buffer: renders (evidence: `src/components/Dashboard.tsx`)
- Emergency buffer → Planning calculations: calculates buffer (evidence: `src/components/EmergencyBufferAlert.tsx`)
- Budget manager → Planning calculations: uses calculations (evidence: `src/components/BudgetManager.tsx`)
- Dashboard → Excel export: exports (evidence: `src/components/Dashboard.tsx`)
- Dashboard → PDF export: exports (evidence: `src/components/Dashboard.tsx`)
- Guest manager → PDF export: exports guest list (evidence: `src/components/GuestManager.tsx`)
- App navigation → Authentication UI: shows sign-in (evidence: `src/App.tsx`)
- Authentication UI → Authentication state: uses auth state (evidence: `src/components/AuthModal.tsx`)
- Authentication state → Supabase client: authenticates with (evidence: `src/authStore.ts`)
- Collaboration settings → Membership and invites: uses collaboration state (evidence: `src/components/CollaborationSection.tsx`)
- Membership and invites → Authentication state: reads user (evidence: `src/collaborationStore.ts`)
- Membership and invites → Supabase client: manages membership (evidence: `src/collaborationStore.ts`)
- Wedding data state → Browser local storage: persists locally (evidence: `src/store.ts`)
- Wedding data state → Audit trail: records changes (evidence: `src/store.ts`)
- Cloud sync provider → Cloud sync state: connects sync (evidence: `src/components/SupabaseSyncProvider.tsx`)
- Cloud sync provider → Wedding data state: connects data state (evidence: `src/components/SupabaseSyncProvider.tsx`)
- Cloud sync provider → Membership and invites: connects collaboration (evidence: `src/components/SupabaseSyncProvider.tsx`)
- Cloud sync state → Wedding data state: reads and hydrates (evidence: `src/syncStore.ts`)
- Cloud sync state → Membership and invites: reads wedding context (evidence: `src/syncStore.ts`)
- Cloud sync state → Authentication state: reads user (evidence: `src/syncStore.ts`)
- Cloud sync state → Supabase client: syncs data (evidence: `src/syncStore.ts`)
- Realtime sync hook → Supabase client: subscribes (evidence: `src/hooks/useRealtimeSync.ts`)
- Realtime sync hook → Cloud sync state: updates sync state (evidence: `src/hooks/useRealtimeSync.ts`)
- Supabase client → Supabase service: connects (evidence: `src/lib/supabase.ts`)
