# jgec-sristi/sristi-web-application-2025 architecture

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

- Interactive diagram: https://gitdiagram.com/jgec-sristi/sristi-web-application-2025
- Repository: https://github.com/jgec-sristi/sristi-web-application-2025

## Overview

#### Purpose and Runtime
This is a Next.js App Router application for the SRISTI event platform: user authentication and registration, event discovery/registration, individual or package payments, and team-based event participation. It runs TypeScript React pages and server route handlers, with static media under `public/`. Core shell: `src/app/layout.tsx`, `src/app/page.tsx`, `src/components/common/Providers.tsx`.

#### Route and UI Layer
Browser entry points are file-based App Router pages. Major journeys include event browsing/detail/leaderboards (`src/app/events/page.tsx`, `src/app/events/[eventId]/page.tsx`, `src/app/events/[eventId]/leaderboard/page.tsx`), user profile/registration (`src/app/users/register/page.tsx`, `src/app/users/me/page.tsx`), dashboard (`src/app/dashboard/page.tsx`), and team workflows (`src/app/teams/page.tsx`, `src/app/teams/[id]/page.tsx`, `src/app/teams/create/page.tsx`).

Shared navigation, session-aware UI, cards, and footer compose these pages: `src/components/common/Navbar.tsx`, `src/components/common/ProfileMenu.tsx`, `src/components/common/Events.tsx`.

#### Authentication and Session Boundary
Authentication is handled by server endpoints plus callback UI: `src/app/api/auth/signin/route.ts`, `src/app/api/auth/session/route.ts`, `src/app/auth/callback/page.tsx`. Client-side auth/session state is exposed through `src/contexts/SessionContext.tsx` and `src/contexts/UserContext.tsx`. Authenticated users are subsequently registered as platform users through `src/app/api/users/register/route.ts` and managed from profile routes.

#### Backend API and Persistence
Route handlers under `src/app/api/` are the application’s server boundary for clients. They cover user records, event catalog/registration, participation verification, contact/email, payments, and teams. Supabase adapters separate browser, server, and privileged access: `src/lib/supabase/client.ts`, `src/lib/supabase/server.ts`, `src/lib/supabase/admin.ts`. Domain services concentrate user/team persistence behavior: `src/services/userService.ts`, `src/services/teamService.ts`, `src/lib/teams/index.ts`.

#### Event Registration Flow
Clients fetch event lists/categories/details and current registration state through event routes: `src/app/api/events/list/route.ts`, `src/app/api/events/get/route.ts`, `src/app/api/events/check-registration/route.ts`. Registration can be individual or bulk: `src/app/api/events/register/route.ts`, `src/app/api/events/register-bulk/route.ts`. Event pages render registration, payment, team-formation, and event details UI from `src/components/events/EventDetails.tsx`, `src/components/events/TeamFormation.tsx`, and `src/components/events/QuickActions.tsx`.

#### Payments and Entitlements
Razorpay is the stated payment provider. The server creates orders and verifies completed payments at `src/app/api/create-order/route.ts` and `src/app/api/verify-payment/route.ts`. Payment UI initiates checkout and individual-event purchase paths through `src/components/payment/CheckOutButton.tsx`, `src/components/payment/IndividualEventPaymentButton.tsx`, and `src/components/payment/PaymentModal.tsx`. Payment state gates event access/registration; related eligibility logic exists in `src/Utils/alreadyPaidForEvent.ts`.

#### Team Collaboration
Registered users can create, join, leave, administer, and register teams for events through team APIs: `src/app/api/teams/create/route.ts`, `src/app/api/teams/join/route.ts`, `src/app/api/teams/register-event/route.ts`. Membership management and leadership operations are separate server actions: `src/app/api/teams/invite-member/route.ts`, `src/app/api/teams/remove-member/route.ts`, `src/app/api/teams/transfer-leadership/route.ts`. The principal UI is `src/components/teams/team-dashboard.tsx`, `src/components/teams/team-member-management.tsx`, and `src/components/teams/team-event-registration.tsx`.

#### External Communication and Assets
Email/contact functionality is server-mediated via `src/app/api/contact/route.ts` and `src/app/api/send-email/route.ts`, with rendering support in `src/Utils/emailRenderer.ts`. Public visual, font, gallery, audio, and Spline 3D assets are served directly from `public/`, notably `public/3d/scene.splinecode`, `public/fonts/Melete-Regular.otf`, and `public/gallery/`.

Main entry points: [`src/app/events/page.tsx`](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/events/page.tsx) (Event & account pages), [`src/contexts/SessionContext.tsx`](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/contexts/SessionContext.tsx) (Session & user state), [`src/lib/supabase/server.ts`](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/lib/supabase/server.ts) (Supabase), [`src/app/layout.tsx`](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/layout.tsx) (App shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web UI"]
  node_shell["App shell<br/>Next.js layout<br/>[layout.tsx]"]
  node_journey_pages["Event &amp; account pages<br/>App Router pages<br/>[page.tsx]"]
  node_team_pages["Team pages<br/>App Router pages<br/>[page.tsx]"]
  node_event_ui["Event registration UI<br/>React components<br/>[EventDetails.tsx]"]
  node_payment_ui["Payment UI<br/>React components<br/>[CheckOutButton.tsx]"]
  node_team_ui["Team management UI<br/>React components<br/>[team-dashboard.tsx]"]
  node_auth_callback["Auth callback<br/>App Router page<br/>[page.tsx]"]
end

subgraph group_state["Client State"]
  node_session_state["Session &amp; user state<br/>React contexts<br/>[SessionContext.tsx]"]
end

subgraph group_api["Server API"]
  node_auth_api["Authentication API<br/>Route handlers<br/>[route.ts]"]
  node_user_api["User API<br/>Route handlers<br/>[route.ts]"]
  node_event_api["Event API<br/>Route handlers<br/>[route.ts]"]
  node_payment_api["Payment API<br/>Route handlers<br/>[route.ts]"]
  node_team_api["Team API<br/>Route handlers<br/>[route.ts]"]
  node_communication_api["Communication API<br/>Route handlers<br/>[route.ts]"]
end

subgraph group_data["Data &amp; Integrations"]
  node_domain_services["User &amp; team services<br/>Domain services<br/>[userService.ts]"]
  node_supabase[("Supabase<br/>Persistence adapters<br/>[server.ts]")]
  node_razorpay{{"Razorpay<br/>Payment provider"}}
  node_email_renderer["Email renderer<br/>[emailRenderer.ts]"]
  node_public_assets["Public assets<br/>Static media<br/>[scene.splinecode]"]
end

node_shell -->|"hosts"| node_journey_pages
node_shell -->|"hosts"| node_team_pages
node_shell -->|"provides"| node_session_state
node_journey_pages -->|"renders"| node_event_ui
node_journey_pages -->|"renders"| node_payment_ui
node_team_pages -->|"renders"| node_team_ui
node_auth_callback -->|"establishes"| node_session_state
node_session_state -->|"reads session"| node_auth_api
node_session_state -->|"registers user"| node_user_api
node_event_ui -->|"queries and registers"| node_event_api
node_payment_ui -->|"checkout and verification"| node_payment_api
node_team_ui -->|"manages teams"| node_team_api
node_auth_api -->|"auth/session access"| node_supabase
node_user_api -->|"delegates"| node_domain_services
node_team_api -->|"delegates"| node_domain_services
node_event_api -->|"catalog and registrations"| node_supabase
node_domain_services -->|"persists"| node_supabase
node_payment_api -->|"creates and verifies orders"| node_razorpay
node_payment_api -->|"records entitlement"| node_supabase
node_communication_api -->|"renders messages"| node_email_renderer
node_journey_pages -->|"serves media"| node_public_assets

click node_shell "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/layout.tsx"
click node_journey_pages "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/events/page.tsx"
click node_team_pages "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/teams/page.tsx"
click node_event_ui "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/components/events/EventDetails.tsx"
click node_payment_ui "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/components/payment/CheckOutButton.tsx"
click node_team_ui "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/components/teams/team-dashboard.tsx"
click node_auth_callback "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/auth/callback/page.tsx"
click node_session_state "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/contexts/SessionContext.tsx"
click node_auth_api "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/api/auth/signin/route.ts"
click node_user_api "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/api/users/register/route.ts"
click node_event_api "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/api/events/register/route.ts"
click node_payment_api "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/api/create-order/route.ts"
click node_team_api "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/api/teams/create/route.ts"
click node_communication_api "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/api/send-email/route.ts"
click node_domain_services "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/services/userService.ts"
click node_supabase "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/lib/supabase/server.ts"
click node_email_renderer "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/Utils/emailRenderer.ts"
click node_public_assets "https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/public/3d/scene.splinecode"

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_shell,node_journey_pages,node_team_pages,node_event_ui,node_payment_ui,node_team_ui,node_auth_callback toneBlue
class node_session_state toneAmber
class node_auth_api,node_user_api,node_event_api,node_payment_api,node_team_api,node_communication_api toneMint
class node_domain_services,node_supabase,node_razorpay,node_email_renderer,node_public_assets toneRose
```

## Components

### Web UI

- [App shell](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/layout.tsx): Next.js layout · Global provider and page composition boundary. · `src/app/layout.tsx`
- [Event & account pages](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/events/page.tsx): App Router pages · Discovery, dashboard, registration, profile, and leaderboard journeys. · `src/app/events/page.tsx`
- [Team pages](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/teams/page.tsx): App Router pages · Team listing, detail, and creation journeys. · `src/app/teams/page.tsx`
- [Event registration UI](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/components/events/EventDetails.tsx): React components · Renders event details, quick actions, and team formation. · `src/components/events/EventDetails.tsx`
- [Payment UI](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/components/payment/CheckOutButton.tsx): React components · Initiates package and individual-event checkout. · `src/components/payment/CheckOutButton.tsx`
- [Team management UI](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/components/teams/team-dashboard.tsx): React components · Manages members and event registration. · `src/components/teams/team-dashboard.tsx`
- [Auth callback](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/auth/callback/page.tsx): App Router page · `src/app/auth/callback/page.tsx`

### Client State

- [Session & user state](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/contexts/SessionContext.tsx): React contexts · Exposes authenticated session and platform-user state to the client. · `src/contexts/SessionContext.tsx`

### Server API

- [Authentication API](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/api/auth/signin/route.ts): Route handlers · Signs users in and returns sessions. · `src/app/api/auth/signin/route.ts`
- [User API](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/api/users/register/route.ts): Route handlers · Registers authenticated identities as platform users. · `src/app/api/users/register/route.ts`
- [Event API](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/api/events/register/route.ts): Route handlers · Serves catalog and registration state, and creates individual or bulk registrations. · `src/app/api/events/register/route.ts`
- [Payment API](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/api/create-order/route.ts): Route handlers · Creates Razorpay orders and verifies completed payments. · `src/app/api/create-order/route.ts`
- [Team API](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/api/teams/create/route.ts): Route handlers · Handles team lifecycle, membership, leadership, and event registration. · `src/app/api/teams/create/route.ts`
- [Communication API](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/app/api/send-email/route.ts): Route handlers · Mediates contact and outbound email. · `src/app/api/send-email/route.ts`

### Data & Integrations

- [User & team services](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/services/userService.ts): Domain services · Concentrates user and team persistence behavior. · `src/services/userService.ts`
- [Supabase](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/lib/supabase/server.ts): Persistence adapters · Browser, server, and privileged database access adapters. · `src/lib/supabase/server.ts`
- **Razorpay**: Payment provider
- [Email renderer](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/src/Utils/emailRenderer.ts): Utility · Renders email content for server-mediated delivery. · `src/Utils/emailRenderer.ts`
- [Public assets](https://github.com/jgec-sristi/sristi-web-application-2025/blob/develop/public/3d/scene.splinecode): Static media · Fonts, gallery, audio, and Spline scene assets. · `public/3d/scene.splinecode`

## Connections

- App shell → Event & account pages: hosts
- App shell → Team pages: hosts
- App shell → Session & user state: provides
- Event & account pages → Event registration UI: renders
- Event & account pages → Payment UI: renders
- Team pages → Team management UI: renders
- Auth callback → Session & user state: establishes
- Session & user state → Authentication API: reads session
- Session & user state → User API: registers user
- Event registration UI → Event API: queries and registers
- Payment UI → Payment API: checkout and verification
- Team management UI → Team API: manages teams
- Authentication API → Supabase: auth/session access
- User API → User & team services: delegates
- Team API → User & team services: delegates
- Event API → Supabase: catalog and registrations
- User & team services → Supabase: persists
- Payment API → Razorpay: creates and verifies orders
- Payment API → Supabase: records entitlement
- Communication API → Email renderer: renders messages
- Event & account pages → Public assets: serves media
