# vishnujaisri123/temple-ticket-manager architecture

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

- Interactive diagram: https://gitdiagram.com/vishnujaisri123/temple-ticket-manager
- Repository: https://github.com/vishnujaisri123/temple-ticket-manager

## Overview

Temple Ticket Manager is an admin web app for recording temple bookings, attaching and matching ticket PDFs, tracking payment/completion and sending ticket or reminder messages. The principal flow is admin login, booking management through the dashboard, then history and ticket delivery; background scheduling handles past-visit cleanup. The graph includes documented capabilities whose implementation was not fully sampled, but omits uncertain links. Evidence is limited to the README, excerpts, and SOURCE INDEX references; unsampled internals are not assumed.

Main entry points: [`backend/controllers/bookingController.js`](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/controllers/bookingController.js) (Booking workflows), [`frontend/src/services/api.js`](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/services/api.js) (API client), [`frontend/src/App.jsx`](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/App.jsx) (App shell), [`frontend/src/pages/Dashboard.jsx`](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/pages/Dashboard.jsx) (Booking dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Admin web app"]
  node_app["App shell<br/>[App.jsx]"]
  node_authctx["Auth state<br/>[AuthContext.jsx]"]
  node_login["Login page<br/>[Login.jsx]"]
  node_dashboard["Booking dashboard<br/>[Dashboard.jsx]"]
  node_bookingform["Booking form<br/>[AddBookingForm.jsx]"]
  node_bookingtable["Booking table<br/>[BookingTable.jsx]"]
  node_gothram["Gothram search<br/>[GothramInput.jsx]"]
  node_history["History page<br/>[History.jsx]"]
  node_toast["Toast notifications<br/>[Toast.jsx]"]
  node_apiclient["API client<br/>[api.js]"]
end

subgraph group_api["API and workflows"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_authcontroller["Admin authentication<br/>[authController.js]"]
  node_bookingroutes["Booking routes<br/>[bookingRoutes.js]"]
  node_bookingcontroller["Booking workflows"]
  node_authmiddleware["JWT protection<br/>[auth.js]"]
end

subgraph group_data["Booking data"]
  node_booking[("Booking records<br/>[Booking.js]")]
  node_adminmodel[("Admin records<br/>[Admin.js]")]
  node_unassigned[("Unassigned PDFs<br/>[UnassignedPDF.js]")]
  node_deleted[("Deleted ticket log")]
  node_deletedticket[("Deleted ticket records<br/>[DeletedTicket.js]")]
end

subgraph group_ops["Files and automation"]
  node_pdfextract["PDF extraction and matching"]
  node_cloudinary["Cloudinary file storage<br/>[cloudinary.js]"]
  node_scheduler["Cleanup scheduler<br/>[scheduler.js]"]
  node_weekly["Weekly statistics"]
end

node_admin(("Temple admin"))
node_mongodb[("MongoDB")]
node_whatsapp["WhatsApp delivery"]
node_localfiles[("Local PDF files")]

node_admin -->|"uses"| node_app
node_app -->|"provides auth"| node_authctx
node_app -->|"renders when authenticated"| node_dashboard
node_app -->|"renders when signed out"| node_login
node_app -->|"renders notifications"| node_toast
node_authctx -->|"calls login"| node_apiclient
node_login -->|"uses auth"| node_authctx
node_dashboard -->|"requests booking data"| node_apiclient
node_dashboard -->|"renders"| node_bookingtable
node_dashboard -->|"renders"| node_bookingform
node_dashboard -->|"renders history"| node_history
node_bookingform -->|"creates bookings"| node_apiclient
node_bookingform -->|"uses autocomplete"| node_gothram
node_bookingtable -->|"updates bookings"| node_apiclient
node_bookingtable -->|"reports outcomes"| node_toast
node_history -->|"loads history"| node_apiclient
node_apiclient -->|"requests auth API"| node_authroutes
node_apiclient -->|"requests booking API"| node_bookingroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_authcontroller -->|"reads and creates"| node_adminmodel
node_bookingroutes -->|"protects routes"| node_authmiddleware
node_bookingroutes -->|"dispatches"| node_bookingcontroller
node_bookingcontroller -->|"reads and writes"| node_booking
node_bookingcontroller -->|"reads and updates"| node_adminmodel
node_bookingcontroller -->|"reads and assigns PDFs"| node_unassigned
node_bookingcontroller -->|"records history"| node_deleted
node_bookingcontroller -->|"extracts and matches"| node_pdfextract
node_bookingcontroller -->|"uploads files"| node_cloudinary
node_bookingcontroller -->|"gets week ranges"| node_weekly
node_pdfextract -->|"searches matches"| node_booking
node_bookingcontroller -->|"sends messages"| node_whatsapp
node_bookingcontroller -->|"stores fallback PDFs"| node_localfiles
node_bookingcontroller -.->|"uses optional storage"| node_cloudinary
node_scheduler -->|"cleans past visits"| node_booking
node_scheduler -->|"records deletions"| node_deletedticket
node_scheduler -->|"logs deletions"| node_deleted
node_scheduler -->|"cleans stored files"| node_cloudinary
node_booking -.->|"persists records"| node_mongodb
node_adminmodel -.->|"persists accounts"| node_mongodb

click node_app "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/App.jsx"
click node_authctx "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/context/AuthContext.jsx"
click node_login "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/pages/Login.jsx"
click node_dashboard "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/pages/Dashboard.jsx"
click node_bookingform "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/components/AddBookingForm.jsx"
click node_bookingtable "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/components/BookingTable.jsx"
click node_gothram "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/components/GothramInput.jsx"
click node_history "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/pages/History.jsx"
click node_toast "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/components/Toast.jsx"
click node_apiclient "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/services/api.js"
click node_authroutes "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/routes/authRoutes.js"
click node_authcontroller "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/controllers/authController.js"
click node_bookingroutes "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/routes/bookingRoutes.js"
click node_bookingcontroller "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/controllers/bookingController.js"
click node_authmiddleware "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/middleware/auth.js"
click node_booking "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/models/Booking.js"
click node_adminmodel "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/models/Admin.js"
click node_unassigned "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/models/UnassignedPDF.js"
click node_deleted "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/models/DeletedTicketsLog.js"
click node_deletedticket "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/models/DeletedTicket.js"
click node_pdfextract "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/services/pdfExtractionService.js"
click node_cloudinary "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/config/cloudinary.js"
click node_scheduler "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/services/scheduler.js"
click node_weekly "https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/services/weeklyStatsService.js"

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_authctx,node_login,node_dashboard,node_bookingform,node_bookingtable,node_gothram,node_history,node_toast,node_apiclient toneBlue
class node_authroutes,node_authcontroller,node_bookingroutes,node_bookingcontroller,node_authmiddleware,node_mongodb,node_localfiles toneAmber
class node_booking,node_adminmodel,node_unassigned,node_deleted,node_deletedticket toneMint
class node_pdfextract,node_cloudinary,node_scheduler,node_weekly toneRose
class node_admin,node_whatsapp toneIndigo
```

## Components

### Admin web app

- [App shell](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Auth state](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Login page](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Booking dashboard](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Booking form](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/components/AddBookingForm.jsx): `frontend/src/components/AddBookingForm.jsx`
- [Booking table](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/components/BookingTable.jsx): `frontend/src/components/BookingTable.jsx`
- [Gothram search](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/components/GothramInput.jsx): `frontend/src/components/GothramInput.jsx`
- [History page](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/pages/History.jsx): `frontend/src/pages/History.jsx`
- [Toast notifications](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/components/Toast.jsx): `frontend/src/components/Toast.jsx`
- [API client](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### API and workflows

- [Auth routes](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Admin authentication](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [Booking routes](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/routes/bookingRoutes.js): `backend/routes/bookingRoutes.js`
- [Booking workflows](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/controllers/bookingController.js): `backend/controllers/bookingController.js`
- [JWT protection](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`

### Booking data

- [Booking records](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/models/Booking.js): `backend/models/Booking.js`
- [Admin records](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/models/Admin.js): `backend/models/Admin.js`
- [Unassigned PDFs](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/models/UnassignedPDF.js): `backend/models/UnassignedPDF.js`
- [Deleted ticket log](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/models/DeletedTicketsLog.js): `backend/models/DeletedTicketsLog.js`
- [Deleted ticket records](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/models/DeletedTicket.js): `backend/models/DeletedTicket.js`

### Files and automation

- [PDF extraction and matching](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/services/pdfExtractionService.js): `backend/services/pdfExtractionService.js`
- [Cloudinary file storage](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/config/cloudinary.js): `backend/config/cloudinary.js`
- [Cleanup scheduler](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/services/scheduler.js): `backend/services/scheduler.js`
- [Weekly statistics](https://github.com/vishnujaisri123/temple-ticket-manager/blob/main/backend/services/weeklyStatsService.js): `backend/services/weeklyStatsService.js`

### Other components

- **Temple admin**
- **MongoDB**
- **WhatsApp delivery**
- **Local PDF files**

## Connections

- Temple admin → App shell: uses (evidence: `README.md`)
- App shell → Auth state: provides auth (evidence: `frontend/src/App.jsx`)
- App shell → Booking dashboard: renders when authenticated (evidence: `frontend/src/App.jsx`)
- App shell → Login page: renders when signed out (evidence: `frontend/src/App.jsx`)
- App shell → Toast notifications: renders notifications (evidence: `frontend/src/App.jsx`)
- Auth state → API client: calls login (evidence: `frontend/src/context/AuthContext.jsx`)
- Login page → Auth state: uses auth (evidence: `frontend/src/pages/Login.jsx`)
- Booking dashboard → API client: requests booking data (evidence: `frontend/src/pages/Dashboard.jsx`)
- Booking dashboard → Booking table: renders (evidence: `frontend/src/pages/Dashboard.jsx`)
- Booking dashboard → Booking form: renders (evidence: `frontend/src/pages/Dashboard.jsx`)
- Booking dashboard → History page: renders history (evidence: `frontend/src/pages/Dashboard.jsx`)
- Booking form → API client: creates bookings (evidence: `frontend/src/components/AddBookingForm.jsx`)
- Booking form → Gothram search: uses autocomplete (evidence: `frontend/src/components/AddBookingForm.jsx`)
- Booking table → API client: updates bookings (evidence: `frontend/src/components/BookingTable.jsx`)
- Booking table → Toast notifications: reports outcomes (evidence: `frontend/src/components/BookingTable.jsx`)
- History page → API client: loads history (evidence: `frontend/src/pages/History.jsx`)
- API client → Auth routes: requests auth API (evidence: `README.md`)
- API client → Booking routes: requests booking API (evidence: `README.md`)
- Auth routes → Admin authentication: dispatches (evidence: `backend/routes/authRoutes.js`)
- Admin authentication → Admin records: reads and creates (evidence: `backend/controllers/authController.js`)
- Booking routes → JWT protection: protects routes (evidence: `backend/routes/bookingRoutes.js`)
- Booking routes → Booking workflows: dispatches (evidence: `backend/routes/bookingRoutes.js`)
- Booking workflows → Booking records: reads and writes (evidence: `backend/controllers/bookingController.js`)
- Booking workflows → Admin records: reads and updates (evidence: `backend/controllers/bookingController.js`)
- Booking workflows → Unassigned PDFs: reads and assigns PDFs (evidence: `backend/controllers/bookingController.js`)
- Booking workflows → Deleted ticket log: records history (evidence: `backend/controllers/bookingController.js`)
- Booking workflows → PDF extraction and matching: extracts and matches (evidence: `backend/controllers/bookingController.js`)
- Booking workflows → Cloudinary file storage: uploads files (evidence: `backend/controllers/bookingController.js`)
- Booking workflows → Weekly statistics: gets week ranges (evidence: `backend/controllers/bookingController.js`)
- PDF extraction and matching → Booking records: searches matches (evidence: `backend/services/pdfExtractionService.js`)
- Booking workflows → WhatsApp delivery: sends messages (evidence: `backend/controllers/bookingController.js`)
- Booking workflows → Local PDF files: stores fallback PDFs (evidence: `README.md`)
- Booking workflows → Cloudinary file storage: uses optional storage (evidence: `README.md`)
- Cleanup scheduler → Booking records: cleans past visits (evidence: `backend/services/scheduler.js`)
- Cleanup scheduler → Deleted ticket records: records deletions (evidence: `backend/services/scheduler.js`)
- Cleanup scheduler → Deleted ticket log: logs deletions (evidence: `backend/services/scheduler.js`)
- Cleanup scheduler → Cloudinary file storage: cleans stored files (evidence: `backend/services/scheduler.js`)
- Booking records → MongoDB: persists records
- Admin records → MongoDB: persists accounts
