# optimaxin/kundli-mahayagya- architecture

> Architecture diagram of the GitHub repository optimaxin/kundli-mahayagya-, 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/optimaxin/kundli-mahayagya-
- Repository: https://github.com/optimaxin/kundli-mahayagya-

## Overview

This is a public registration and event-information site backed by a FastAPI/PostgreSQL system for family bookings, kund allocation, QR passes, and gate check-in. Visitors register, receive and retrieve passes, while volunteers authenticate and scan/check in attendees; organisers manage capacity, staff, analytics, and reports. Event-day RSVPs are a distinct flow and do not create bookings. The graph includes documented frontend and backend capabilities, but many API handlers and services were not excerpted, so uncertain internal call links are omitted.

Main entry points: [`backend/app/api/router.py`](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/router.py) (API router), [`src/App.jsx`](https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/App.jsx) (Web routes), [`src/lib/db.js`](https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/lib/db.js) (API client), [`src/pages/Staff.jsx`](https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/pages/Staff.jsx) (Staff console)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Public web"]
  node_app["Web routes<br/>[App.jsx]"]
  node_home["Public home<br/>[Home.jsx]"]
  node_eventpages["Event pages"]
  node_eventrsvp["Event RSVP<br/>[EventRsvp.jsx]"]
  node_api_client["API client<br/>[db.js]"]
  node_event_api["Event RSVP API<br/>[event_rsvps.py]"]
end

subgraph group_booking["Booking and passes"]
  node_register["Registration form<br/>[Register.jsx]"]
  node_ticket["Ticket view<br/>[Ticket.jsx]"]
  node_findpass["Find pass<br/>[Find.jsx]"]
  node_recovery["Pass recovery<br/>[PassRecovery.jsx]"]
  node_registration_api["Registration API<br/>[registrations.py]"]
  node_booking_services["Booking services"]
  node_session_api["Session API<br/>[sessions.py]"]
  node_qr_api["QR and pass APIs<br/>[qr.py]"]
  node_recovery_api["Recovery API<br/>[pass_recovery.py]"]
  node_sessions_service["Session service<br/>[session_service.py]"]
end

subgraph group_entry["Gate operations"]
  node_scannerui["Scanner UI<br/>[Scanner.jsx]"]
  node_staffui["Staff console<br/>[Staff.jsx]"]
  node_scanner_api["Scanner API<br/>[scanner.py]"]
  node_offline_api["Offline sync API<br/>[offline.py]"]
end

subgraph group_management["Operations"]
  node_adminui["Admin console<br/>[Admin.jsx]"]
  node_auth_api["Staff auth API<br/>[auth.py]"]
  node_admin_api["Admin API<br/>[admin.py]"]
  node_reports_api["Reports API<br/>[reports.py]"]
  node_auth_service["Authentication<br/>[auth_service.py]"]
  node_reporting["Reporting"]
  node_audit["Audit logging<br/>[audit_service.py]"]
end

subgraph group_platform["API and persistence"]
  node_api["API router<br/>[router.py]"]
  node_dbcore["Transaction layer<br/>[database.py]"]
  node_store[("PostgreSQL data")]
  node_main["FastAPI application<br/>[main.py]"]
end

node_visitor(("Visitor"))
node_volunteer(("Volunteer"))
node_organiser(("Organiser"))

node_visitor -->|"opens"| node_app
node_volunteer -->|"opens"| node_app
node_organiser -->|"opens"| node_app
node_app -->|"routes"| node_home
node_app -->|"routes"| node_register
node_app -->|"routes"| node_ticket
node_app -->|"routes"| node_findpass
node_app -->|"routes"| node_staffui
node_app -->|"routes"| node_adminui
node_app -->|"routes"| node_eventpages
node_eventpages -->|"renders"| node_eventrsvp
node_register -->|"requests"| node_api_client
node_ticket -.->|"requests"| node_api_client
node_findpass -.->|"requests"| node_api_client
node_recovery -->|"requests"| node_api_client
node_staffui -->|"renders"| node_scannerui
node_staffui -->|"renders"| node_recovery
node_scannerui -->|"requests"| node_api_client
node_adminui -->|"requests"| node_api_client
node_adminui -->|"renders"| node_scannerui
node_eventrsvp -->|"requests"| node_api_client
node_api_client -->|"HTTP requests"| node_api
node_api -->|"registers"| node_registration_api
node_api -->|"registers"| node_session_api
node_api -->|"registers"| node_qr_api
node_api -->|"registers"| node_recovery_api
node_api -->|"registers"| node_scanner_api
node_api -->|"registers"| node_offline_api
node_api -->|"registers"| node_auth_api
node_api -->|"registers"| node_admin_api
node_api -->|"registers"| node_reports_api
node_api -->|"registers"| node_event_api
node_registration_api -.->|"delegates"| node_booking_services
node_session_api -->|"uses"| node_sessions_service
node_auth_api -.->|"uses"| node_auth_service
node_reports_api -.->|"uses"| node_reporting
node_auth_service -->|"records"| node_audit
node_reporting -->|"records"| node_audit
node_main -->|"mounts"| node_api
node_main -->|"initializes"| node_dbcore
node_dbcore -.->|"transacts"| node_store
node_sessions_service -.->|"reads"| node_store

click node_app "https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/App.jsx"
click node_home "https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/pages/Home.jsx"
click node_eventpages "https://github.com/optimaxin/kundli-mahayagya-/tree/main/src/pages/events"
click node_eventrsvp "https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/components/EventRsvp.jsx"
click node_register "https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/pages/Register.jsx"
click node_ticket "https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/pages/Ticket.jsx"
click node_findpass "https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/pages/Find.jsx"
click node_recovery "https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/components/PassRecovery.jsx"
click node_scannerui "https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/components/Scanner.jsx"
click node_staffui "https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/pages/Staff.jsx"
click node_adminui "https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/pages/Admin.jsx"
click node_api_client "https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/lib/db.js"
click node_api "https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/router.py"
click node_registration_api "https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/registrations.py"
click node_booking_services "https://github.com/optimaxin/kundli-mahayagya-/tree/main/backend/app/services"
click node_session_api "https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/sessions.py"
click node_qr_api "https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/qr.py"
click node_recovery_api "https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/pass_recovery.py"
click node_scanner_api "https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/scanner.py"
click node_offline_api "https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/offline.py"
click node_auth_api "https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/auth.py"
click node_admin_api "https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/admin.py"
click node_reports_api "https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/reports.py"
click node_event_api "https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/event_rsvps.py"
click node_auth_service "https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/services/auth_service.py"
click node_reporting "https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/services/reporting_service.py"
click node_audit "https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/services/audit_service.py"
click node_dbcore "https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/core/database.py"
click node_store "https://github.com/optimaxin/kundli-mahayagya-/tree/main/backend/app/models"
click node_main "https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/main.py"
click node_sessions_service "https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/services/session_service.py"

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_home,node_eventpages,node_eventrsvp,node_api_client,node_event_api toneBlue
class node_register,node_ticket,node_findpass,node_recovery,node_registration_api,node_booking_services,node_session_api,node_qr_api,node_recovery_api,node_sessions_service toneAmber
class node_scannerui,node_staffui,node_scanner_api,node_offline_api toneMint
class node_adminui,node_auth_api,node_admin_api,node_reports_api,node_auth_service,node_reporting,node_audit toneRose
class node_api,node_dbcore,node_store,node_main,node_visitor,node_volunteer,node_organiser toneIndigo
```

## Components

### Public web

- [Web routes](https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/App.jsx): `src/App.jsx`
- [Public home](https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Event pages](https://github.com/optimaxin/kundli-mahayagya-/tree/main/src/pages/events): `src/pages/events`
- [Event RSVP](https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/components/EventRsvp.jsx): `src/components/EventRsvp.jsx`
- [API client](https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/lib/db.js): `src/lib/db.js`
- [Event RSVP API](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/event_rsvps.py): `backend/app/api/v1/event_rsvps.py`

### Booking and passes

- [Registration form](https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/pages/Register.jsx): `src/pages/Register.jsx`
- [Ticket view](https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/pages/Ticket.jsx): `src/pages/Ticket.jsx`
- [Find pass](https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/pages/Find.jsx): `src/pages/Find.jsx`
- [Pass recovery](https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/components/PassRecovery.jsx): `src/components/PassRecovery.jsx`
- [Registration API](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/registrations.py): `backend/app/api/v1/registrations.py`
- [Booking services](https://github.com/optimaxin/kundli-mahayagya-/tree/main/backend/app/services): `backend/app/services`
- [Session API](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/sessions.py): `backend/app/api/v1/sessions.py`
- [QR and pass APIs](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/qr.py): `backend/app/api/v1/qr.py`
- [Recovery API](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/pass_recovery.py): `backend/app/api/v1/pass_recovery.py`
- [Session service](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/services/session_service.py): `backend/app/services/session_service.py`

### Gate operations

- [Scanner UI](https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/components/Scanner.jsx): `src/components/Scanner.jsx`
- [Staff console](https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/pages/Staff.jsx): `src/pages/Staff.jsx`
- [Scanner API](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/scanner.py): `backend/app/api/v1/scanner.py`
- [Offline sync API](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/offline.py): `backend/app/api/v1/offline.py`

### Operations

- [Admin console](https://github.com/optimaxin/kundli-mahayagya-/blob/main/src/pages/Admin.jsx): `src/pages/Admin.jsx`
- [Staff auth API](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/auth.py): `backend/app/api/v1/auth.py`
- [Admin API](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/admin.py): `backend/app/api/v1/admin.py`
- [Reports API](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/v1/reports.py): `backend/app/api/v1/reports.py`
- [Authentication](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/services/auth_service.py): `backend/app/services/auth_service.py`
- [Reporting](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/services/reporting_service.py): `backend/app/services/reporting_service.py`
- [Audit logging](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/services/audit_service.py): `backend/app/services/audit_service.py`

### API and persistence

- [API router](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/api/router.py): `backend/app/api/router.py`
- [Transaction layer](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/core/database.py): `backend/app/core/database.py`
- [PostgreSQL data](https://github.com/optimaxin/kundli-mahayagya-/tree/main/backend/app/models): `backend/app/models`
- [FastAPI application](https://github.com/optimaxin/kundli-mahayagya-/blob/main/backend/app/main.py): `backend/app/main.py`

### Other components

- **Visitor**
- **Volunteer**
- **Organiser**

## Connections

- Visitor → Web routes: opens (evidence: `README.md`)
- Volunteer → Web routes: opens (evidence: `README.md`)
- Organiser → Web routes: opens (evidence: `README.md`)
- Web routes → Public home: routes (evidence: `src/App.jsx`)
- Web routes → Registration form: routes (evidence: `src/App.jsx`)
- Web routes → Ticket view: routes (evidence: `src/App.jsx`)
- Web routes → Find pass: routes (evidence: `src/App.jsx`)
- Web routes → Staff console: routes (evidence: `src/App.jsx`)
- Web routes → Admin console: routes (evidence: `src/App.jsx`)
- Web routes → Event pages: routes (evidence: `src/App.jsx`)
- Event pages → Event RSVP: renders (evidence: `src/pages/events/Event13.jsx`)
- Registration form → API client: requests (evidence: `src/pages/Register.jsx`)
- Ticket view → API client: requests
- Find pass → API client: requests
- Pass recovery → API client: requests (evidence: `src/components/PassRecovery.jsx`)
- Staff console → Scanner UI: renders (evidence: `src/pages/Staff.jsx`)
- Staff console → Pass recovery: renders (evidence: `src/pages/Staff.jsx`)
- Scanner UI → API client: requests (evidence: `src/components/Scanner.jsx`)
- Admin console → API client: requests (evidence: `src/pages/Admin.jsx`)
- Admin console → Scanner UI: renders (evidence: `src/pages/Admin.jsx`)
- Event RSVP → API client: requests (evidence: `src/components/EventRsvp.jsx`)
- API client → API router: HTTP requests (evidence: `README.md`)
- API router → Registration API: registers (evidence: `backend/app/api/router.py`)
- API router → Session API: registers (evidence: `backend/app/api/router.py`)
- API router → QR and pass APIs: registers (evidence: `backend/app/api/router.py`)
- API router → Recovery API: registers (evidence: `backend/app/api/router.py`)
- API router → Scanner API: registers (evidence: `backend/app/api/router.py`)
- API router → Offline sync API: registers (evidence: `backend/app/api/router.py`)
- API router → Staff auth API: registers (evidence: `backend/app/api/router.py`)
- API router → Admin API: registers (evidence: `backend/app/api/router.py`)
- API router → Reports API: registers (evidence: `backend/app/api/router.py`)
- API router → Event RSVP API: registers (evidence: `backend/app/api/router.py`)
- Registration API → Booking services: delegates
- Session API → Session service: uses (evidence: `backend/app/api/v1/sessions.py`)
- Staff auth API → Authentication: uses
- Reports API → Reporting: uses
- Authentication → Audit logging: records (evidence: `backend/app/services/auth_service.py`)
- Reporting → Audit logging: records (evidence: `backend/app/services/reporting_service.py`)
- FastAPI application → API router: mounts (evidence: `backend/app/main.py`)
- FastAPI application → Transaction layer: initializes (evidence: `backend/app/main.py`)
- Transaction layer → PostgreSQL data: transacts
- Session service → PostgreSQL data: reads (evidence: `backend/app/services/session_service.py`)
