# rohnroy0/summer_camp_website architecture

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

- Interactive diagram: https://gitdiagram.com/rohnroy0/summer_camp_website
- Repository: https://github.com/rohnroy0/summer_camp_website

## Overview

##### What this project is (type + purpose)
This is a **full-stack event website** for “Summer School 2026 – IEEE Student Branch” with:
- A **public marketing site + registration flow** (HTML/CSS/JS)
- **Payments via Razorpay**
- **Automated verification + email notifications** (Nodemailer/SMTP)
- An **Admin Dashboard** for participant management
- A **backend service** (Node.js + Express) and **MongoDB Atlas** per README

##### What the file tree tells you structurally
Top-level files:
- `index.html`, `style.css`, `script.js`: public landing/registration UI and client logic
- `admin-dashboard.html`, `admin-dashboard.css`: separate admin UI entry point
- `assets/images/...`: static assets (logos, speakers, etc.)
- `render.yaml`: deployment descriptor (strong hint: hosted on Render; could host static site and/or Node service)

This implies a **static frontend** that calls a **backend API**.

##### What the README adds (architecture + integrations)
The README defines core containers and integrations:
- **Backend**: Node.js + Express.js (REST endpoints)
- **DB**: MongoDB Atlas
- **Payments**: Razorpay SDK (server-side order creation, signature verification, webhooks)
- **Email**: Nodemailer via SMTP
- **Admin auth**: via `ADMIN_EMAIL` / `ADMIN_PASSWORD` env vars (suggests basic credential check; likely session/JWT)

This implies the backend is the orchestrator for:
- participant creation/update
- payment initiation and verification
- sending confirmation emails
- admin login and admin operations

##### Static Frontend (HTML/CSS/JS)
- Serves: `index.html`, `admin-dashboard.html`, CSS/JS/assets
- Runs in: Browser + static hosting (Render static site, or Render web service, etc.)

##### Backend API (Node.js/Express)
- Runs in: Render Web Service (inferred from `render.yaml`)
- Responsibilities:
- Registration endpoints
- Payment order creation + verification
- Admin authentication + admin endpoints
- Email sending orchestration

##### Database (MongoDB Atlas)
- Participants/Registrations
- Payments/Transactions
- Possibly Admin/Audit (or admin is env-based only)

##### External Services
- Razorpay (Payments)
- SMTP server (Nodemailer transport)

- Browser (Participant) → Backend: “Register”, “Create payment order”, “Verify payment”
- Browser (Admin) → Backend: “Admin login”, “List participants”, “Update status”, etc.
- Backend ↔ MongoDB Atlas: store registration + payment status
- Backend ↔ Razorpay: create order / verify signature; receive webhook callbacks
- Backend → SMTP: send confirmation/receipt/verification email

- **API Router Layer (Express routes)**
- `/api/register`
- `/api/payment/create-order`
- `/api/payment/verify` (or webhook endpoint)
- `/api/admin/login`
- `/api/admin/participants` (list/update)

- **Registration Service**
- validate inputs
- create participant record
- trigger email flow

- **Payment Service (Razorpay SDK integration)**
- create order
- verify payment signature
- update payment status in DB

- **Webhook Handler**
- receive Razorpay events
- reconcile payment state

- **Email Service (Nodemailer)**
- templates (even if inline)
- send verification/confirmation

- **Auth Component**
- admin credential check from env
- session/JWT issuance (unknown; mark as “Auth mechanism (TBD)”) if not specified

- **Data Access Layer**

This component-level view is where you “separate into as many components as possible” without claiming exact module structure.

##### Flow 3: Razorpay webhook (recommended even if optional)
- Razorpay → Backend `/api/payment/webhook`
- Backend verifies webhook signature
- Backend updates DB + triggers email if needed

- [ ] Every external dependency is shown: Razorpay, SMTP, MongoDB Atlas
- [ ] Admin is a distinct actor and has a distinct UI page
- [ ] Payment verification and/or webhook path is shown (signature verification boundary)
- [ ] Data store shows what it stores (participants + payment status)
- [ ] Render (or hosting) boundary is explicit if `render.yaml` is used

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% =========================
    %% Actors (System Context)
    %% =========================
    Participant["Participant<br/>(Browser)"]:::actor
    Admin["Admin<br/>(Browser)"]:::actor

    %% =========================
    %% Deployment / Hosting
    %% =========================
    subgraph "Render Hosting (inferred from render.yaml)"
        direction TB

        StaticHost["Static Site Hosting<br/>(Serves HTML/CSS/JS/assets)"]:::platform

        subgraph "Static Frontend (Repo root)"
            direction TB
            Landing["Public Marketing + Registration Page<br/>(index.html)"]:::frontend
            PublicCSS["Public Styling<br/>(style.css)"]:::frontend
            PublicJS["Public Client Logic<br/>(script.js)"]:::frontend

            AdminUI["Admin Dashboard Page<br/>(admin-dashboard.html)"]:::frontend
            AdminCSS["Admin Dashboard Styling<br/>(admin-dashboard.css)"]:::frontend

            Assets["Static Assets<br/>(images, logos, speakers)"]:::frontend
        end

        BackendAPI["Backend API Service<br/>(Node.js + Express)<br/>(Described in README; code not in tree)"]:::backend

        subgraph "Backend (Logical Components)"
            direction TB
            Routes["API Router Layer<br/>(Express routes)"]:::backend
            RegSvc["Registration Service<br/>(validate + create participant)"]:::backend
            PaySvc["Payment Service<br/>(Razorpay SDK: order + verify)"]:::backend
            Webhook["Webhook Handler<br/>(verify signature + idempotency)"]:::backend
            EmailSvc["Email Service<br/>(Nodemailer via SMTP)"]:::backend
            Auth["Admin Auth Component<br/>(env credentials; token/session TBD)"]:::backend
            DAL["Data Access Layer<br/>(MongoDB driver/Mongoose TBD)"]:::backend
        end
    end

    %% =========================
    %% External / Managed Services
    %% =========================
    Mongo["MongoDB Atlas<br/>(Participants/Registrations, Payments/Transactions)"]:::datastore
    Razorpay["Razorpay<br/>(Orders API + Checkout + Webhooks)"]:::external
    SMTP["SMTP Provider<br/>(Gmail/SendGrid/etc.)"]:::external

    %% =========================
    %% Notes / Callouts
    %% =========================
    Notes["Notes:<br/>• Frontend assets at repo root (index/admin-dashboard/assets).<br/>• Backend (Node/Express) described in README; backend code not present in this tree snapshot.<br/>• Deployment likely on Render (render.yaml).<br/>• Secrets via env: Mongo URI, Razorpay keys, SMTP creds, Admin creds."]:::note

    %% =========================
    %% Context Connections
    %% =========================
    Participant -->|"HTTPS (GET static files)"| StaticHost
    Admin -->|"HTTPS (GET static files)"| StaticHost

    StaticHost -->|"serves"| Landing
    StaticHost -->|"serves"| AdminUI
    Landing -->|"loads"| PublicCSS
    Landing -->|"loads"| PublicJS
    AdminUI -->|"loads"| AdminCSS
    Landing -->|"loads"| Assets
    AdminUI -->|"loads"| Assets

    Participant -->|"HTTPS (REST/JSON)"| BackendAPI
    Admin -->|"HTTPS (REST/JSON)"| BackendAPI

    BackendAPI -->|"uses"| Routes
    Routes -->|"calls"| RegSvc
    Routes -->|"calls"| PaySvc
    Routes -->|"calls"| Webhook
    Routes -->|"calls"| Auth

    RegSvc -->|"CRUD (store pending/registration)"| DAL
    PaySvc -->|"CRUD (update payment status)"| DAL
    Webhook -->|"CRUD (reconcile payment)"| DAL
    DAL -->|"MongoDB driver (CRUD)"| Mongo

    PaySvc -->|"Razorpay Orders API"| Razorpay
    Webhook <-->|"Razorpay Webhook (HTTPS)"| Razorpay

    RegSvc -->|"send confirmation/verification"| EmailSvc
    PaySvc -->|"send receipt/paid confirmation"| EmailSvc
    Webhook -->|"send post-webhook notifications (if needed)"| EmailSvc
    EmailSvc -->|"SMTP (Nodemailer)"| SMTP

    Auth -->|"validate admin creds (env) + authorize"| DAL

    Notes -.->|"documentation"| BackendAPI
    Notes -.->|"documentation"| StaticHost

    %% =========================
    %% Critical Flows (Numbered)
    %% =========================
    subgraph "Critical Flows (Summary)"
        direction TB

        F1["Flow 1: Registration + Payment<br/>1) /api/register -> DB: Pending<br/>2) /api/payment/create-order -> Razorpay order_id<br/>3) Razorpay Checkout -> success payload<br/>4) /api/payment/verify or webhook -> DB: Paid/Verified<br/>5) Email confirmation via SMTP"]:::flow

        F2["Flow 2: Admin Management<br/>1) /api/admin/login -> auth (env)<br/>2) /api/admin/participants -> list/update<br/>3) DB read/write -> dashboard"]:::flow

        F3["Flow 3: Razorpay Webhook (recommended)<br/>1) Razorpay -> /api/payment/webhook<br/>2) Verify signature + idempotency<br/>3) Update DB + optional email"]:::flow
    end

    F1 -.-> Routes
    F2 -.-> Routes
    F3 -.-> Webhook

    %% =========================
    %% Click Events (from component mapping)
    %% =========================
    click Landing "https://github.com/rohnroy0/summer_camp_website/blob/main/index.html"
    click PublicCSS "https://github.com/rohnroy0/summer_camp_website/blob/main/style.css"
    click PublicJS "https://github.com/rohnroy0/summer_camp_website/blob/main/script.js"
    click AdminUI "https://github.com/rohnroy0/summer_camp_website/blob/main/admin-dashboard.html"
    click AdminCSS "https://github.com/rohnroy0/summer_camp_website/blob/main/admin-dashboard.css"
    click Assets "https://github.com/rohnroy0/summer_camp_website/tree/main/assets/images/"
    click StaticHost "https://github.com/rohnroy0/summer_camp_website/blob/main/render.yaml"
    click Notes "https://github.com/rohnroy0/summer_camp_website/blob/main/README.md"

    %% =========================
    %% Styles
    %% =========================
    classDef actor fill:#f2f2f2,stroke:#666,stroke-width:1px,color:#111
    classDef platform fill:#e6e6e6,stroke:#444,stroke-width:1px,color:#111
    classDef frontend fill:#d7ebff,stroke:#2b6cb0,stroke-width:1px,color:#0b2545
    classDef backend fill:#cfe9ff,stroke:#1f5aa6,stroke-width:1.2px,color:#0b2545
    classDef datastore fill:#d9f7d9,stroke:#2f855a,stroke-width:1.2px,color:#123
    classDef external fill:#ffe3c4,stroke:#c05621,stroke-width:1.2px,color:#3b1d0f
    classDef note fill:#fff7cc,stroke:#b08900,stroke-width:1px,color:#3a2c00
    classDef flow fill:#f3e8ff,stroke:#6b46c1,stroke-width:1px,color:#1a1033
```
