# smjmun/smjmun-website architecture

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

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

## Overview

SMJMUN is a public MUN platform combining event and program discovery with conference registration, email OTP verification, HDFC payments, editorial content, and an interactive chatbot. The central user journey is conference discovery → registration submission → OTP verification → payment → verified confirmation. The graph includes the major README capabilities and principal internal layers; several content-page and payment implementation links are not shown in the excerpts, so those relationships are omitted rather than inferred.

Main entry points: [`app/api/register/route.ts`](https://github.com/smjmun/smjmun-website/blob/main/app/api/register/route.ts) (Conference API), [`app/api/register/verify-otp/route.ts`](https://github.com/smjmun/smjmun-website/blob/main/app/api/register/verify-otp/route.ts) (OTP Verification API), [`lib/db.ts`](https://github.com/smjmun/smjmun-website/blob/main/lib/db.ts) (Registration Store), [`app/api/payment/verify/route.ts`](https://github.com/smjmun/smjmun-website/blob/main/app/api/payment/verify/route.ts) (Payment Verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Public Experience"]
  node_conference_browse["Conference Discovery<br/>[page.tsx]"]
  node_conference_detail["Conference Details<br/>[page.tsx]"]
  node_programs["Program Pages<br/>[page.tsx]"]
  node_register_form["Registration Form<br/>[page.tsx]"]
end

subgraph group_content["Content Platform"]
  node_blog["Blog<br/>[BlogPageClient.tsx]"]
  node_gallery["Gallery<br/>[page.tsx]"]
  node_sanity[("Sanity CMS<br/>[client.ts]")]
end

subgraph group_registration["Registration and Payments"]
  node_conference_api["Conference API<br/>[route.ts]"]
  node_otp_api["OTP Verification API<br/>[route.ts]"]
  node_registration_db[("Registration Store<br/>[db.ts]")]
  node_draft_logic["Draft Creation<br/>[create-draft.ts]"]
  node_otp_logic["OTP Verification<br/>[verify-otp.ts]"]
  node_payment_page["Payment Checkout<br/>[page.tsx]"]
  node_payment_api["Payment API<br/>[route.ts]"]
  node_payment_verify["Payment Verification<br/>[route.ts]"]
end

subgraph group_engagement["User Engagement"]
  node_email["Email Delivery<br/>[send-otp-email.ts]"]
  node_contact["Contact Inquiries<br/>[route.ts]"]
  node_partnership["Partnership Inquiries<br/>[route.ts]"]
  node_newsletter["Newsletter Signup<br/>[route.ts]"]
end

subgraph group_assistant["Chat Assistant"]
  node_chat_ui["Chat Widget<br/>[ChatWidget.tsx]"]
  node_chat_api["Chat Endpoint<br/>[route.ts]"]
  node_chat_engine["Chat Engine<br/>[engine.ts]"]
  node_chat_conference["Conference Retrieval<br/>[conference.ts]"]
end

node_visitor(("Visitor"))
node_hdfc{{"HDFC Gateway"}}

node_visitor -->|"browses"| node_conference_browse
node_visitor -->|"submits registration"| node_register_form
node_register_form -.->|"posts registration"| node_conference_api
node_conference_api -->|"creates draft"| node_draft_logic
node_conference_api -->|"sends OTP"| node_email
node_conference_api -->|"stores draft and OTP"| node_registration_db
node_visitor -->|"submits OTP"| node_otp_api
node_otp_api -->|"verifies code"| node_otp_logic
node_otp_api -->|"creates registration"| node_registration_db
node_visitor -->|"starts checkout"| node_payment_page
node_payment_page -.->|"creates order"| node_payment_api
node_payment_api -->|"creates gateway order"| node_hdfc
node_payment_verify -->|"checks order status"| node_hdfc
node_payment_verify -->|"updates payment status"| node_registration_db
node_visitor -->|"reads articles"| node_blog
node_blog -->|"loads editorial content"| node_sanity
node_visitor -->|"views media"| node_gallery
node_gallery -->|"loads gallery content"| node_sanity
node_visitor -->|"sends inquiry"| node_contact
node_visitor -->|"requests partnership"| node_partnership
node_visitor -.->|"subscribes"| node_newsletter
node_visitor -->|"asks question"| node_chat_ui
node_chat_ui -.->|"sends question"| node_chat_api
node_chat_api -->|"dispatches query"| node_chat_engine
node_chat_engine -->|"retrieves conferences"| node_chat_conference
node_visitor -.->|"explores event"| node_conference_detail
node_visitor -.->|"explores programs"| node_programs

click node_conference_browse "https://github.com/smjmun/smjmun-website/blob/main/app/conferences/page.tsx"
click node_conference_detail "https://github.com/smjmun/smjmun-website/blob/main/app/conferences/%5Bslug%5D/page.tsx"
click node_programs "https://github.com/smjmun/smjmun-website/blob/main/app/programs/%5Bslug%5D/page.tsx"
click node_register_form "https://github.com/smjmun/smjmun-website/blob/main/app/register/%5Bslug%5D/page.tsx"
click node_blog "https://github.com/smjmun/smjmun-website/blob/main/app/blogs/components/BlogPageClient.tsx"
click node_gallery "https://github.com/smjmun/smjmun-website/blob/main/app/gallery/page.tsx"
click node_sanity "https://github.com/smjmun/smjmun-website/blob/main/lib/sanity/client.ts"
click node_conference_api "https://github.com/smjmun/smjmun-website/blob/main/app/api/register/route.ts"
click node_otp_api "https://github.com/smjmun/smjmun-website/blob/main/app/api/register/verify-otp/route.ts"
click node_registration_db "https://github.com/smjmun/smjmun-website/blob/main/lib/db.ts"
click node_draft_logic "https://github.com/smjmun/smjmun-website/blob/main/lib/registration/create-draft.ts"
click node_otp_logic "https://github.com/smjmun/smjmun-website/blob/main/lib/otp/verify-otp.ts"
click node_email "https://github.com/smjmun/smjmun-website/blob/main/lib/email/send-otp-email.ts"
click node_payment_page "https://github.com/smjmun/smjmun-website/blob/main/app/payment/%5BregistrationId%5D/page.tsx"
click node_payment_api "https://github.com/smjmun/smjmun-website/blob/main/app/api/payment/create-order/route.ts"
click node_payment_verify "https://github.com/smjmun/smjmun-website/blob/main/app/api/payment/verify/route.ts"
click node_contact "https://github.com/smjmun/smjmun-website/blob/main/app/api/contact/route.ts"
click node_partnership "https://github.com/smjmun/smjmun-website/blob/main/app/api/partnerships/route.ts"
click node_newsletter "https://github.com/smjmun/smjmun-website/blob/main/app/api/newsletter/subscribe/route.ts"
click node_chat_ui "https://github.com/smjmun/smjmun-website/blob/main/app/components/chat/ChatWidget.tsx"
click node_chat_api "https://github.com/smjmun/smjmun-website/blob/main/app/api/chat/route.ts"
click node_chat_engine "https://github.com/smjmun/smjmun-website/blob/main/lib/chatbot/v2/engine.ts"
click node_chat_conference "https://github.com/smjmun/smjmun-website/blob/main/lib/chatbot/v2/services/conference.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_conference_browse,node_conference_detail,node_programs,node_register_form toneBlue
class node_blog,node_gallery,node_sanity toneAmber
class node_conference_api,node_otp_api,node_registration_db,node_draft_logic,node_otp_logic,node_payment_page,node_payment_api,node_payment_verify toneMint
class node_email,node_contact,node_partnership,node_newsletter toneRose
class node_chat_ui,node_chat_api,node_chat_engine,node_chat_conference,node_visitor,node_hdfc toneIndigo
```

## Components

### Public Experience

- [Conference Discovery](https://github.com/smjmun/smjmun-website/blob/main/app/conferences/page.tsx): `app/conferences/page.tsx`
- [Conference Details](https://github.com/smjmun/smjmun-website/blob/main/app/conferences/%5Bslug%5D/page.tsx): `app/conferences/[slug]/page.tsx`
- [Program Pages](https://github.com/smjmun/smjmun-website/blob/main/app/programs/%5Bslug%5D/page.tsx): `app/programs/[slug]/page.tsx`
- [Registration Form](https://github.com/smjmun/smjmun-website/blob/main/app/register/%5Bslug%5D/page.tsx): `app/register/[slug]/page.tsx`

### Content Platform

- [Blog](https://github.com/smjmun/smjmun-website/blob/main/app/blogs/components/BlogPageClient.tsx): `app/blogs/components/BlogPageClient.tsx`
- [Gallery](https://github.com/smjmun/smjmun-website/blob/main/app/gallery/page.tsx): `app/gallery/page.tsx`
- [Sanity CMS](https://github.com/smjmun/smjmun-website/blob/main/lib/sanity/client.ts): `lib/sanity/client.ts`

### Registration and Payments

- [Conference API](https://github.com/smjmun/smjmun-website/blob/main/app/api/register/route.ts): `app/api/register/route.ts`
- [OTP Verification API](https://github.com/smjmun/smjmun-website/blob/main/app/api/register/verify-otp/route.ts): `app/api/register/verify-otp/route.ts`
- [Registration Store](https://github.com/smjmun/smjmun-website/blob/main/lib/db.ts): `lib/db.ts`
- [Draft Creation](https://github.com/smjmun/smjmun-website/blob/main/lib/registration/create-draft.ts): `lib/registration/create-draft.ts`
- [OTP Verification](https://github.com/smjmun/smjmun-website/blob/main/lib/otp/verify-otp.ts): `lib/otp/verify-otp.ts`
- [Payment Checkout](https://github.com/smjmun/smjmun-website/blob/main/app/payment/%5BregistrationId%5D/page.tsx): `app/payment/[registrationId]/page.tsx`
- [Payment API](https://github.com/smjmun/smjmun-website/blob/main/app/api/payment/create-order/route.ts): `app/api/payment/create-order/route.ts`
- [Payment Verification](https://github.com/smjmun/smjmun-website/blob/main/app/api/payment/verify/route.ts): `app/api/payment/verify/route.ts`

### User Engagement

- [Email Delivery](https://github.com/smjmun/smjmun-website/blob/main/lib/email/send-otp-email.ts): `lib/email/send-otp-email.ts`
- [Contact Inquiries](https://github.com/smjmun/smjmun-website/blob/main/app/api/contact/route.ts): `app/api/contact/route.ts`
- [Partnership Inquiries](https://github.com/smjmun/smjmun-website/blob/main/app/api/partnerships/route.ts): `app/api/partnerships/route.ts`
- [Newsletter Signup](https://github.com/smjmun/smjmun-website/blob/main/app/api/newsletter/subscribe/route.ts): `app/api/newsletter/subscribe/route.ts`

### Chat Assistant

- [Chat Widget](https://github.com/smjmun/smjmun-website/blob/main/app/components/chat/ChatWidget.tsx): `app/components/chat/ChatWidget.tsx`
- [Chat Endpoint](https://github.com/smjmun/smjmun-website/blob/main/app/api/chat/route.ts): `app/api/chat/route.ts`
- [Chat Engine](https://github.com/smjmun/smjmun-website/blob/main/lib/chatbot/v2/engine.ts): `lib/chatbot/v2/engine.ts`
- [Conference Retrieval](https://github.com/smjmun/smjmun-website/blob/main/lib/chatbot/v2/services/conference.ts): `lib/chatbot/v2/services/conference.ts`

### Other components

- **Visitor**
- **HDFC Gateway**

## Connections

- Visitor → Conference Discovery: browses
- Visitor → Registration Form: submits registration
- Registration Form → Conference API: posts registration
- Conference API → Draft Creation: creates draft (evidence: `app/api/register/route.ts`)
- Conference API → Email Delivery: sends OTP (evidence: `app/api/register/route.ts`)
- Conference API → Registration Store: stores draft and OTP (evidence: `app/api/register/route.ts`)
- Visitor → OTP Verification API: submits OTP
- OTP Verification API → OTP Verification: verifies code (evidence: `app/api/register/verify-otp/route.ts`)
- OTP Verification API → Registration Store: creates registration (evidence: `app/api/register/verify-otp/route.ts`)
- Visitor → Payment Checkout: starts checkout
- Payment Checkout → Payment API: creates order
- Payment API → HDFC Gateway: creates gateway order
- Payment Verification → HDFC Gateway: checks order status
- Payment Verification → Registration Store: updates payment status
- Visitor → Blog: reads articles
- Blog → Sanity CMS: loads editorial content
- Visitor → Gallery: views media
- Gallery → Sanity CMS: loads gallery content
- Visitor → Contact Inquiries: sends inquiry (evidence: `app/api/contact/route.ts`)
- Visitor → Partnership Inquiries: requests partnership (evidence: `app/api/partnerships/route.ts`)
- Visitor → Newsletter Signup: subscribes
- Visitor → Chat Widget: asks question
- Chat Widget → Chat Endpoint: sends question
- Chat Endpoint → Chat Engine: dispatches query (evidence: `app/api/chat/route.ts`)
- Chat Engine → Conference Retrieval: retrieves conferences (evidence: `lib/chatbot/v2/engine.ts`)
- Visitor → Conference Details: explores event
- Visitor → Program Pages: explores programs
