# slayer-10/kishwar architecture

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

- Interactive diagram: https://gitdiagram.com/slayer-10/kishwar
- Repository: https://github.com/slayer-10/kishwar

## Overview

KISHWAR is a Next.js event-registration and management system. Participants and teams browse events, register, submit payment evidence, and receive invoices and QR tickets; administrators, front-desk officers, and ambassadors manage the event through role-specific dashboards. The README documents the broader role and payment capabilities, while excerpts confirm authentication lookup, public event rendering, and registration-review behavior. Unsampled subsystems are included at their supported tree paths; their internal wiring is not inferred beyond README statements.

Main entry points: [`lib/prisma.ts`](https://github.com/slayer-10/kishwar/blob/main/lib/prisma.ts) (PostgreSQL via Prisma), [`app/(dashboard)/registration-review-actions.ts`](https://github.com/slayer-10/kishwar/blob/main/app/(dashboard)/registration-review-actions.ts) (Registration review), [`app/(dashboard)`](https://github.com/slayer-10/kishwar/tree/main/app/(dashboard)) (Role dashboards), [`lib/notifications/dispatch.ts`](https://github.com/slayer-10/kishwar/blob/main/lib/notifications/dispatch.ts) (Notification dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public experience"]
  node_public_site["Event discovery<br/>[page.tsx]"]
  node_event_catalog["Event catalog<br/>[page.tsx]"]
  node_event_detail["Event details<br/>[page.tsx]"]
  node_registration_forms["Registration forms"]
  node_registration_actions["Registration handling<br/>[actions.ts]"]
end

subgraph group_operations["Event operations"]
  node_role_dashboards["Role dashboards"]
  node_admin_ops["Admin management<br/>[actions.ts]"]
  node_ambassador_ops["Ambassador management<br/>[actions.ts]"]
  node_fdo_ops["Front desk operations"]
  node_participant_ops["Participant account"]
  node_review_actions["Registration review"]
end

subgraph group_platform["Identity and workflow"]
  node_auth_pages["Sign in / sign up<br/>[actions.ts]"]
  node_auth_lookup["Current-user lookup<br/>[auth.ts]"]
  node_review_rules["Review and seat rules"]
  node_transition_rules["Status transitions"]
  node_notification_dispatch["Notification dispatch<br/>[dispatch.ts]"]
  node_health["Health endpoint<br/>[route.ts]"]
end

subgraph group_integrations["External services"]
  node_supabase_server["Supabase session client<br/>[server.ts]"]
  node_database[("PostgreSQL via Prisma<br/>[prisma.ts]")]
  node_email_provider["Email provider<br/>[email.ts]"]
  node_whatsapp_provider["WhatsApp provider<br/>[whatsapp.ts]"]
  node_supabase_admin["Supabase admin services<br/>[admin.ts]"]
end

node_visitor(("Visitor / participant"))

node_visitor -->|"browses"| node_public_site
node_visitor -->|"finds events"| node_event_catalog
node_public_site -->|"links to events"| node_event_catalog
node_event_catalog -->|"opens event"| node_event_detail
node_event_detail -->|"reads event"| node_database
node_event_detail -->|"renders forms"| node_registration_forms
node_registration_forms -->|"submits registration"| node_registration_actions
node_registration_actions -->|"creates registration"| node_database
node_registration_actions -->|"uses admin services"| node_supabase_admin
node_registration_actions -->|"dispatches notice"| node_notification_dispatch
node_visitor -->|"authenticates"| node_auth_pages
node_auth_pages -->|"creates session"| node_supabase_server
node_auth_pages -->|"stores user profile"| node_database
node_auth_lookup -->|"gets auth user"| node_supabase_server
node_auth_lookup -->|"loads role profile"| node_database
node_visitor -->|"uses assigned dashboard"| node_role_dashboards
node_role_dashboards -->|"checks role"| node_auth_lookup
node_role_dashboards -->|"admin manages"| node_admin_ops
node_role_dashboards -->|"ambassador manages"| node_ambassador_ops
node_role_dashboards -->|"FDO handles"| node_fdo_ops
node_role_dashboards -->|"participant views"| node_participant_ops
node_admin_ops -->|"manages records"| node_database
node_ambassador_ops -->|"manages teams"| node_database
node_review_actions -->|"checks reviewer"| node_auth_lookup
node_review_actions -->|"reserves approved seat"| node_review_rules
node_review_actions -->|"updates registration"| node_database
node_review_actions -->|"signs evidence links"| node_supabase_admin
node_review_actions -->|"notifies decision"| node_notification_dispatch
node_review_actions -->|"applies status rules"| node_transition_rules
node_notification_dispatch -->|"loads notification data"| node_database
node_notification_dispatch -->|"sends email"| node_email_provider
node_notification_dispatch -->|"sends WhatsApp"| node_whatsapp_provider
node_visitor -.->|"checks service"| node_health

click node_public_site "https://github.com/slayer-10/kishwar/blob/main/app/(public)/page.tsx"
click node_event_catalog "https://github.com/slayer-10/kishwar/blob/main/app/(public)/events/page.tsx"
click node_event_detail "https://github.com/slayer-10/kishwar/blob/main/app/(public)/events/%5Bid%5D/page.tsx"
click node_registration_forms "https://github.com/slayer-10/kishwar/tree/main/components/public"
click node_registration_actions "https://github.com/slayer-10/kishwar/blob/main/app/(public)/events/%5Bid%5D/actions.ts"
click node_auth_pages "https://github.com/slayer-10/kishwar/blob/main/app/(auth)/actions.ts"
click node_auth_lookup "https://github.com/slayer-10/kishwar/blob/main/lib/auth.ts"
click node_supabase_server "https://github.com/slayer-10/kishwar/blob/main/lib/supabase/server.ts"
click node_role_dashboards "https://github.com/slayer-10/kishwar/tree/main/app/(dashboard)"
click node_admin_ops "https://github.com/slayer-10/kishwar/blob/main/app/(dashboard)/admin/actions.ts"
click node_ambassador_ops "https://github.com/slayer-10/kishwar/blob/main/app/(dashboard)/ambassador/actions.ts"
click node_fdo_ops "https://github.com/slayer-10/kishwar/tree/main/app/(dashboard)/fdo"
click node_participant_ops "https://github.com/slayer-10/kishwar/tree/main/app/(dashboard)/participant"
click node_review_actions "https://github.com/slayer-10/kishwar/blob/main/app/(dashboard)/registration-review-actions.ts"
click node_review_rules "https://github.com/slayer-10/kishwar/blob/main/lib/registration-review.ts"
click node_transition_rules "https://github.com/slayer-10/kishwar/blob/main/lib/registrations/transition-rules.ts"
click node_database "https://github.com/slayer-10/kishwar/blob/main/lib/prisma.ts"
click node_notification_dispatch "https://github.com/slayer-10/kishwar/blob/main/lib/notifications/dispatch.ts"
click node_email_provider "https://github.com/slayer-10/kishwar/blob/main/lib/notifications/providers/email.ts"
click node_whatsapp_provider "https://github.com/slayer-10/kishwar/blob/main/lib/notifications/providers/whatsapp.ts"
click node_supabase_admin "https://github.com/slayer-10/kishwar/blob/main/lib/supabase/admin.ts"
click node_health "https://github.com/slayer-10/kishwar/blob/main/app/api/health/route.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_public_site,node_event_catalog,node_event_detail,node_registration_forms,node_registration_actions toneBlue
class node_role_dashboards,node_admin_ops,node_ambassador_ops,node_fdo_ops,node_participant_ops,node_review_actions toneAmber
class node_auth_pages,node_auth_lookup,node_review_rules,node_transition_rules,node_notification_dispatch,node_health toneMint
class node_supabase_server,node_database,node_email_provider,node_whatsapp_provider,node_supabase_admin toneRose
class node_visitor toneIndigo
```

## Components

### Public experience

- [Event discovery](https://github.com/slayer-10/kishwar/blob/main/app/(public)/page.tsx): `app/(public)/page.tsx`
- [Event catalog](https://github.com/slayer-10/kishwar/blob/main/app/(public)/events/page.tsx): `app/(public)/events/page.tsx`
- [Event details](https://github.com/slayer-10/kishwar/blob/main/app/(public)/events/%5Bid%5D/page.tsx): `app/(public)/events/[id]/page.tsx`
- [Registration forms](https://github.com/slayer-10/kishwar/tree/main/components/public): `components/public`
- [Registration handling](https://github.com/slayer-10/kishwar/blob/main/app/(public)/events/%5Bid%5D/actions.ts): `app/(public)/events/[id]/actions.ts`

### Event operations

- [Role dashboards](https://github.com/slayer-10/kishwar/tree/main/app/(dashboard)): `app/(dashboard)`
- [Admin management](https://github.com/slayer-10/kishwar/blob/main/app/(dashboard)/admin/actions.ts): `app/(dashboard)/admin/actions.ts`
- [Ambassador management](https://github.com/slayer-10/kishwar/blob/main/app/(dashboard)/ambassador/actions.ts): `app/(dashboard)/ambassador/actions.ts`
- [Front desk operations](https://github.com/slayer-10/kishwar/tree/main/app/(dashboard)/fdo): `app/(dashboard)/fdo`
- [Participant account](https://github.com/slayer-10/kishwar/tree/main/app/(dashboard)/participant): `app/(dashboard)/participant`
- [Registration review](https://github.com/slayer-10/kishwar/blob/main/app/(dashboard)/registration-review-actions.ts): `app/(dashboard)/registration-review-actions.ts`

### Identity and workflow

- [Sign in / sign up](https://github.com/slayer-10/kishwar/blob/main/app/(auth)/actions.ts): `app/(auth)/actions.ts`
- [Current-user lookup](https://github.com/slayer-10/kishwar/blob/main/lib/auth.ts): `lib/auth.ts`
- [Review and seat rules](https://github.com/slayer-10/kishwar/blob/main/lib/registration-review.ts): `lib/registration-review.ts`
- [Status transitions](https://github.com/slayer-10/kishwar/blob/main/lib/registrations/transition-rules.ts): `lib/registrations/transition-rules.ts`
- [Notification dispatch](https://github.com/slayer-10/kishwar/blob/main/lib/notifications/dispatch.ts): `lib/notifications/dispatch.ts`
- [Health endpoint](https://github.com/slayer-10/kishwar/blob/main/app/api/health/route.ts): `app/api/health/route.ts`

### External services

- [Supabase session client](https://github.com/slayer-10/kishwar/blob/main/lib/supabase/server.ts): `lib/supabase/server.ts`
- [PostgreSQL via Prisma](https://github.com/slayer-10/kishwar/blob/main/lib/prisma.ts): `lib/prisma.ts`
- [Email provider](https://github.com/slayer-10/kishwar/blob/main/lib/notifications/providers/email.ts): `lib/notifications/providers/email.ts`
- [WhatsApp provider](https://github.com/slayer-10/kishwar/blob/main/lib/notifications/providers/whatsapp.ts): `lib/notifications/providers/whatsapp.ts`
- [Supabase admin services](https://github.com/slayer-10/kishwar/blob/main/lib/supabase/admin.ts): `lib/supabase/admin.ts`

### Other components

- **Visitor / participant**

## Connections

- Visitor / participant → Event discovery: browses (evidence: `app/(public)/page.tsx`)
- Visitor / participant → Event catalog: finds events
- Event discovery → Event catalog: links to events (evidence: `app/(public)/page.tsx`)
- Event catalog → Event details: opens event
- Event details → PostgreSQL via Prisma: reads event (evidence: `app/(public)/events/[id]/page.tsx`)
- Event details → Registration forms: renders forms (evidence: `app/(public)/events/[id]/page.tsx`)
- Registration forms → Registration handling: submits registration (evidence: `components/public/public-team-registration-form.tsx`)
- Registration handling → PostgreSQL via Prisma: creates registration (evidence: `app/(public)/events/[id]/actions.ts`)
- Registration handling → Supabase admin services: uses admin services (evidence: `app/(public)/events/[id]/actions.ts`)
- Registration handling → Notification dispatch: dispatches notice (evidence: `app/(public)/events/[id]/actions.ts`)
- Visitor / participant → Sign in / sign up: authenticates
- Sign in / sign up → Supabase session client: creates session (evidence: `app/(auth)/actions.ts`)
- Sign in / sign up → PostgreSQL via Prisma: stores user profile (evidence: `app/(auth)/actions.ts`)
- Current-user lookup → Supabase session client: gets auth user (evidence: `lib/auth.ts`)
- Current-user lookup → PostgreSQL via Prisma: loads role profile (evidence: `lib/auth.ts`)
- Visitor / participant → Role dashboards: uses assigned dashboard
- Role dashboards → Current-user lookup: checks role (evidence: `app/(dashboard)/registration-review-actions.ts`)
- Role dashboards → Admin management: admin manages (evidence: `app/(dashboard)/admin/payments/page.tsx`)
- Role dashboards → Ambassador management: ambassador manages (evidence: `app/(dashboard)/ambassador/payments/page.tsx`)
- Role dashboards → Front desk operations: FDO handles
- Role dashboards → Participant account: participant views
- Admin management → PostgreSQL via Prisma: manages records (evidence: `app/(dashboard)/admin/actions.ts`)
- Ambassador management → PostgreSQL via Prisma: manages teams
- Registration review → Current-user lookup: checks reviewer (evidence: `app/(dashboard)/registration-review-actions.ts`)
- Registration review → Review and seat rules: reserves approved seat (evidence: `app/(dashboard)/registration-review-actions.ts`)
- Registration review → PostgreSQL via Prisma: updates registration (evidence: `app/(dashboard)/registration-review-actions.ts`)
- Registration review → Supabase admin services: signs evidence links (evidence: `app/(dashboard)/registration-review-actions.ts`)
- Registration review → Notification dispatch: notifies decision (evidence: `app/(dashboard)/registration-review-actions.ts`)
- Registration review → Status transitions: applies status rules (evidence: `app/(dashboard)/registration-review-actions.ts`)
- Notification dispatch → PostgreSQL via Prisma: loads notification data (evidence: `lib/notifications/dispatch.ts`)
- Notification dispatch → Email provider: sends email (evidence: `lib/notifications/dispatch.ts`)
- Notification dispatch → WhatsApp provider: sends WhatsApp (evidence: `lib/notifications/dispatch.ts`)
- Visitor / participant → Health endpoint: checks service
