# bitotsav-fest/website architecture

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

- Interactive diagram: https://gitdiagram.com/bitotsav-fest/website
- Repository: https://github.com/bitotsav-fest/website

## Overview

#### Purpose and Runtime
This is a Next.js App Router site for Bitotsav, BIT Mesra’s festival. It combines a public festival/marketing experience with authenticated attendee dashboards, event registration, teams, ticket verification, scanning, chat, and administration. The runtime is React/Next.js with Tailwind-style UI components; static media and 3D assets are served from `public/`.

Key entry points: `src/app/layout.js`, `src/app/page.js`, `src/middleware.js`, `src/auth.js`.

#### Public Festival Experience
Public routes provide the landing page, event catalog/detail pages, schedules, gallery, sponsors, tickets, merch, concerts, alumni, and informational pages. The landing implementation is componentized around visual sections and 3D presentation assets.

Paths: `src/app/page.js`, `src/components/landing/Landing.js`, `src/app/events/[id]/page.js`, `src/app/events/data.js`, `public/BIT-v1.glb`.

#### Authentication and Access Boundary
NextAuth is exposed through the catch-all auth API route, with server actions for authentication and middleware as the request-level access gate. Login/logout and dashboard pages form the user-facing authentication boundary; protected APIs should rely on the same session/authorization model.

Paths: `src/auth.js`, `src/app/api/auth/[...nextauth]/route.js`, `src/app/actions/auth.js`, `src/middleware.js`.

#### Persistence and Domain Models
The repository contains both Prisma schema/client access and model files consistent with a separate document-model layer, indicating a mixed or transitional persistence architecture. Core stored domains are users, teams, events, and audit logs. Database connectivity is abstracted behind shared library modules rather than page code.

Paths: `prisma/schema.prisma`, `src/lib/prisma.js`, `src/lib/dbConnect.js`, `src/models/user.js`, `src/models/Team.js`, `src/models/Event.js`.

#### Registration, Teams, and Tickets
Event registration is an API-driven flow. Team creation, joining, retrieval/pagination, and admin team operations are independently routed. Ticket verification supports a downstream scanner workflow, while dashboard components render attendee profile, event details, and QR ticket state.

Paths: `src/app/api/events/register/route.js`, `src/app/api/teams/create/route.js`, `src/app/api/teams/join/route.js`, `src/app/actions/verify-ticket.js`, `src/app/scanner/page.js`, `src/components/dashboard/QRTicket.jsx`.

#### Attendee Dashboard and Eligibility
The dashboard is the principal authenticated portal. It supports user retrieval/deletion, BIT/day-scholar and non-BIT flows, and appears to use bundled CSV/JS allowlists for eligibility or email matching. This is a material boundary between institutional participant validation and general registration.

Paths: `src/app/dashboard/page.js`, `src/app/dashboard/day-scholar/page.js`, `src/app/dashboard/non-bit/page.js`, `src/lib/dayscholarbitmesra.js`, `src/lib/allowedK21_with_emails.js`.

#### Administration, Operations, and Observability
An admin panel provides participant data presentation/export plus administrative user search/update APIs. Scanner statistics, general stats, logs, and verification endpoints support on-site operations and monitoring. Admin authorization is a critical boundary because these routes mutate or expose user/event data.

Paths: `src/app/adminpanel/page.js`, `src/app/api/admin/search/route.js`, `src/app/api/admin/update-user/route.js`, `src/app/api/logs/route.js`, `src/app/api/stats/route.js`, `src/app/scanner/stats/page.js`.

#### External/Client Services and Delivery
Chat is exposed as a server API and rendered through a chatbot component. Email and security utilities likely integrate outbound messaging and validation/security concerns. The application includes a service worker, Workbox bundle, web manifest, and sitemap, enabling installability/caching and discoverability.

Paths: `src/app/api/chat/route.js`, `src/components/chatbot/chatbot-popup.jsx`, `src/lib/email.js`, `src/lib/security.js`, `public/sw.js`, `public/manifest.json`.

Main entry points: [`src/app/dashboard/page.js`](https://github.com/bitotsav-fest/website/blob/main/src/app/dashboard/page.js) (Attendee dashboard), [`src/app/layout.js`](https://github.com/bitotsav-fest/website/blob/main/src/app/layout.js) (Next.js app shell), [`prisma/schema.prisma`](https://github.com/bitotsav-fest/website/blob/main/prisma/schema.prisma) (Mixed persistence layer), [`src/middleware.js`](https://github.com/bitotsav-fest/website/blob/main/src/middleware.js) (Request access gate)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public experience"]
  node_landing["Festival landing<br/>public page<br/>[page.js]"]
  node_landing_ui["Landing sections<br/>React components<br/>[Landing.js]"]
  node_event_catalog["Event catalog<br/>public event pages<br/>[page.js]"]
  node_event_data["Event data<br/>catalog data<br/>[data.js]"]
  node_festival_assets["Festival 3D assets<br/>static media<br/>[BIT-v1.glb]"]
end

subgraph group_access["Access &amp; attendee"]
  node_middleware{{"Request access gate<br/>Next middleware<br/>[middleware.js]"}}
  node_auth{{"Auth &amp; session<br/>NextAuth<br/>[auth.js]"}}
  node_auth_api["Auth API<br/>API route<br/>[route.js]"]
  node_dashboard["Attendee dashboard<br/>protected portal<br/>[page.js]"]
  node_eligibility["Participant eligibility<br/>allowlists"]
  node_registration["Event registration<br/>API route<br/>[route.js]"]
  node_teams["Team operations<br/>team APIs<br/>[route.js]"]
  node_tickets["QR ticket<br/>dashboard component<br/>[QRTicket.jsx]"]
end

subgraph group_operations["Operations"]
  node_scanner["Ticket scanner<br/>operations page<br/>[page.js]"]
  node_admin["Admin panel<br/>protected operations portal<br/>[page.js]"]
  node_admin_api["Admin user API<br/>admin APIs<br/>[route.js]"]
  node_ops_metrics["Logs &amp; statistics<br/>operations APIs<br/>[route.js]"]
end

subgraph group_data["Data &amp; services"]
  node_persistence[("Mixed persistence layer<br/>Prisma and document models<br/>[schema.prisma]")]
  node_chat["Festival chat<br/>chat API<br/>[route.js]"]
  node_pwa["Offline delivery<br/>service worker<br/>[sw.js]"]
end

node_next_app["Next.js app shell<br/>App Router<br/>[layout.js]"]

node_next_app -->|"serves"| node_landing
node_landing -->|"composes"| node_landing_ui
node_landing_ui -->|"uses"| node_festival_assets
node_next_app -->|"routes to"| node_event_catalog
node_event_catalog -->|"reads"| node_event_data
node_middleware -->|"checks session"| node_auth
node_auth_api -->|"exposes"| node_auth
node_middleware -->|"protects"| node_dashboard
node_dashboard -->|"validates participant type"| node_eligibility
node_dashboard -->|"registers for events"| node_registration
node_dashboard -->|"manages teams"| node_teams
node_dashboard -->|"displays"| node_tickets
node_registration -->|"stores registration"| node_persistence
node_teams -->|"stores teams"| node_persistence
node_tickets -->|"presents for verification"| node_scanner
node_middleware -->|"protects"| node_admin
node_admin -->|"administers users"| node_admin_api
node_admin_api -->|"updates records"| node_persistence
node_scanner -->|"reports activity"| node_ops_metrics
node_ops_metrics -->|"reads logs and records"| node_persistence
node_next_app -->|"serves chat client"| node_chat
node_next_app -.->|"delivers"| node_pwa

click node_next_app "https://github.com/bitotsav-fest/website/blob/main/src/app/layout.js"
click node_landing "https://github.com/bitotsav-fest/website/blob/main/src/app/page.js"
click node_landing_ui "https://github.com/bitotsav-fest/website/blob/main/src/components/landing/Landing.js"
click node_event_catalog "https://github.com/bitotsav-fest/website/blob/main/src/app/events/%5Bid%5D/page.js"
click node_event_data "https://github.com/bitotsav-fest/website/blob/main/src/app/events/data.js"
click node_festival_assets "https://github.com/bitotsav-fest/website/blob/main/public/BIT-v1.glb"
click node_middleware "https://github.com/bitotsav-fest/website/blob/main/src/middleware.js"
click node_auth "https://github.com/bitotsav-fest/website/blob/main/src/auth.js"
click node_auth_api "https://github.com/bitotsav-fest/website/blob/main/src/app/api/auth/%5B...nextauth%5D/route.js"
click node_dashboard "https://github.com/bitotsav-fest/website/blob/main/src/app/dashboard/page.js"
click node_eligibility "https://github.com/bitotsav-fest/website/blob/main/src/lib/dayscholarbitmesra.js"
click node_registration "https://github.com/bitotsav-fest/website/blob/main/src/app/api/events/register/route.js"
click node_teams "https://github.com/bitotsav-fest/website/blob/main/src/app/api/teams/create/route.js"
click node_tickets "https://github.com/bitotsav-fest/website/blob/main/src/components/dashboard/QRTicket.jsx"
click node_scanner "https://github.com/bitotsav-fest/website/blob/main/src/app/scanner/page.js"
click node_admin "https://github.com/bitotsav-fest/website/blob/main/src/app/adminpanel/page.js"
click node_admin_api "https://github.com/bitotsav-fest/website/blob/main/src/app/api/admin/update-user/route.js"
click node_ops_metrics "https://github.com/bitotsav-fest/website/blob/main/src/app/api/stats/route.js"
click node_persistence "https://github.com/bitotsav-fest/website/blob/main/prisma/schema.prisma"
click node_chat "https://github.com/bitotsav-fest/website/blob/main/src/app/api/chat/route.js"
click node_pwa "https://github.com/bitotsav-fest/website/blob/main/public/sw.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_landing,node_landing_ui,node_event_catalog,node_event_data,node_festival_assets toneBlue
class node_middleware,node_auth,node_auth_api,node_dashboard,node_eligibility,node_registration,node_teams,node_tickets toneAmber
class node_scanner,node_admin,node_admin_api,node_ops_metrics toneMint
class node_persistence,node_chat,node_pwa toneRose
class node_next_app toneNeutral
```

## Components

### Public experience

- [Festival landing](https://github.com/bitotsav-fest/website/blob/main/src/app/page.js): public page · Visual festival entry experience. · `src/app/page.js`
- [Landing sections](https://github.com/bitotsav-fest/website/blob/main/src/components/landing/Landing.js): React components · `src/components/landing/Landing.js`
- [Event catalog](https://github.com/bitotsav-fest/website/blob/main/src/app/events/%5Bid%5D/page.js): public event pages · Event detail is driven by bundled event data. · `src/app/events/[id]/page.js`
- [Event data](https://github.com/bitotsav-fest/website/blob/main/src/app/events/data.js): catalog data · `src/app/events/data.js`
- [Festival 3D assets](https://github.com/bitotsav-fest/website/blob/main/public/BIT-v1.glb): static media · `public/BIT-v1.glb`

### Access & attendee

- [Request access gate](https://github.com/bitotsav-fest/website/blob/main/src/middleware.js): Next middleware · Applies route-level access control. · `src/middleware.js`
- [Auth & session](https://github.com/bitotsav-fest/website/blob/main/src/auth.js): NextAuth · Shared authentication and authorization model. · `src/auth.js`
- [Auth API](https://github.com/bitotsav-fest/website/blob/main/src/app/api/auth/%5B...nextauth%5D/route.js): API route · `src/app/api/auth/[...nextauth]/route.js`
- [Attendee dashboard](https://github.com/bitotsav-fest/website/blob/main/src/app/dashboard/page.js): protected portal · `src/app/dashboard/page.js`
- [Participant eligibility](https://github.com/bitotsav-fest/website/blob/main/src/lib/dayscholarbitmesra.js): allowlists · Institutional and day-scholar eligibility data. · `src/lib/dayscholarbitmesra.js`
- [Event registration](https://github.com/bitotsav-fest/website/blob/main/src/app/api/events/register/route.js): API route · `src/app/api/events/register/route.js`
- [Team operations](https://github.com/bitotsav-fest/website/blob/main/src/app/api/teams/create/route.js): team APIs · Creation and joining are independent API flows. · `src/app/api/teams/create/route.js`
- [QR ticket](https://github.com/bitotsav-fest/website/blob/main/src/components/dashboard/QRTicket.jsx): dashboard component · Renders attendee ticket state. · `src/components/dashboard/QRTicket.jsx`

### Operations

- [Ticket scanner](https://github.com/bitotsav-fest/website/blob/main/src/app/scanner/page.js): operations page · On-site ticket verification workflow. · `src/app/scanner/page.js`
- [Admin panel](https://github.com/bitotsav-fest/website/blob/main/src/app/adminpanel/page.js): protected operations portal · Participant administration and export. · `src/app/adminpanel/page.js`
- [Admin user API](https://github.com/bitotsav-fest/website/blob/main/src/app/api/admin/update-user/route.js): admin APIs · Searches and mutates participant records. · `src/app/api/admin/update-user/route.js`
- [Logs & statistics](https://github.com/bitotsav-fest/website/blob/main/src/app/api/stats/route.js): operations APIs · Operational monitoring and scanner statistics. · `src/app/api/stats/route.js`

### Data & services

- [Mixed persistence layer](https://github.com/bitotsav-fest/website/blob/main/prisma/schema.prisma): Prisma and document models · Repository retains relational schema/client and document-model access. · `prisma/schema.prisma`
- [Festival chat](https://github.com/bitotsav-fest/website/blob/main/src/app/api/chat/route.js): chat API · Server chat endpoint used by the chatbot UI. · `src/app/api/chat/route.js`
- [Offline delivery](https://github.com/bitotsav-fest/website/blob/main/public/sw.js): service worker · Enables installability and cached delivery. · `public/sw.js`

### Other components

- [Next.js app shell](https://github.com/bitotsav-fest/website/blob/main/src/app/layout.js): App Router · Application layout and route host. · `src/app/layout.js`

## Connections

- Next.js app shell → Festival landing: serves
- Festival landing → Landing sections: composes
- Landing sections → Festival 3D assets: uses
- Next.js app shell → Event catalog: routes to
- Event catalog → Event data: reads
- Request access gate → Auth & session: checks session
- Auth API → Auth & session: exposes
- Request access gate → Attendee dashboard: protects
- Attendee dashboard → Participant eligibility: validates participant type
- Attendee dashboard → Event registration: registers for events
- Attendee dashboard → Team operations: manages teams
- Attendee dashboard → QR ticket: displays
- Event registration → Mixed persistence layer: stores registration
- Team operations → Mixed persistence layer: stores teams
- QR ticket → Ticket scanner: presents for verification
- Request access gate → Admin panel: protects
- Admin panel → Admin user API: administers users
- Admin user API → Mixed persistence layer: updates records
- Ticket scanner → Logs & statistics: reports activity
- Logs & statistics → Mixed persistence layer: reads logs and records
- Next.js app shell → Festival chat: serves chat client
- Next.js app shell → Offline delivery: delivers
