# jaykumargupta73/dreamxec architecture

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

- Interactive diagram: https://gitdiagram.com/jaykumargupta73/dreamxec
- Repository: https://github.com/jaykumargupta73/dreamxec

## Overview

#### Purpose and Entry Points
This is a full-stack platform for student/club innovation projects, campaign discovery, donations, memberships, mentorship, and operational administration. The browser client boots from `client/src/main.tsx` into `client/src/App.tsx`; the Node server starts from `server/server.js`. API surface is organized as domain route/controller modules under `server/src/api`.

#### Client Application Shell
The client is a Vite React/TypeScript SPA with shared authentication and loading state. `client/src/context/AuthContext.tsx` establishes identity/session state consumed by public, donor, student, president, and admin experiences. `client/src/components/Main.tsx` and `client/src/sections/Header/index.tsx` form the primary page/navigation shell; component-level screens implement route/view behavior.

#### Campaign and Project Lifecycle
Campaigns/projects are the core business objects: users can browse, view, create, edit, and manage funding-related milestones. Client workflows reside in `client/src/components/BrowseCampaigns.tsx`, `client/src/components/CampaignDetails.tsx`, and `client/src/components/CreateCampaign.tsx`. Server ownership is separated into projects and user-projects APIs at `server/src/api/projects/project.routes.js` and `server/src/api/user-projects/user-project.routes.js`, with validation at `server/src/api/projects/project.validation.js`.

#### Identity, Roles, and Organization Membership
Authentication, profile setup, OTP/email verification, club verification, and student verification define access boundaries. Client flows include `client/src/components/AuthPage.tsx`, `client/src/components/ProfileSetup.tsx`, and `client/src/components/VerifyPresident.tsx`. Backend enforcement begins with `server/src/api/auth/auth.routes.js` and `server/src/middleware/auth.middleware.js`; club and verification processes are exposed through `server/src/api/clubs/club.routes.js` and `server/src/api/club-verification/clubVerification.routes.js`.

#### Funding and Payment Processing
Donation and payment flows connect campaign participation to payment-provider processing and webhook reconciliation. The client invokes domain services from `client/src/services/donationService.ts` and presents checkout through `client/src/components/DonateModal.tsx`. Server-side payment initiation is handled by `server/src/api/payments/payment.routes.js` and `server/src/services/payment.service.js`; asynchronous provider callbacks enter through `server/src/api/webhook/razorpayWebhook.js`. Razorpay is therefore a material external payment dependency.

#### Role-Specific Operations
The application has dedicated operational surfaces for donors, club presidents, and administrators. Donor portfolio/history experiences are in `client/src/components/DonorDashboard.tsx` and `client/src/components/DonationHistoryModal.tsx`; president club/member/campaign management is rooted at `client/src/components/president/PresidentLayout.tsx`. Administrative review, financial, user, campaign, and verification workflows begin at `client/src/components/admin/AdminDashboard.tsx` and are served by `server/src/api/admin/admin.routes.js`.

#### Server Runtime, Persistence, and Integrations
The backend is a JavaScript Node HTTP API with Prisma as its persistence boundary, configured in `server/src/config/prisma.js` and modeled in `server/prisma/schema.prisma`. Controllers validate and authorize requests before database/service calls; centralized failures pass through `server/src/middleware/error.middleware.js`. Redis-backed capabilities are represented by `server/src/services/redis.service.js`, while email, WhatsApp, and object-upload integrations are isolated in `server/src/services/email.service.js`, `server/src/services/whatsapp.service.js`, and `server/src/utils/uploadToS3.js`.

#### Background and Public-Service Boundaries
Scheduled milestone reminders are decoupled from request handling in `server/src/cron/milestoneReminder.cron.js`. SEO endpoints—robots and sitemap generation—are separate from SPA rendering in `server/src/api/seo/seo.routes.js`. The client includes deployment manifests for Netlify and Vercel at `client/netlify.toml` and `client/vercel.json`, indicating deployable static frontend hosting independent of the API runtime.

Main entry points: [`server/src/config/prisma.js`](https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/config/prisma.js) (Prisma persistence), [`client/src/App.tsx`](https://github.com/jaykumargupta73/dreamxec/blob/main/client/src/App.tsx) (App shell & navigation), [`server/src/api/projects/project.routes.js`](https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/api/projects/project.routes.js) (Projects & user projects), [`server/server.js`](https://github.com/jaykumargupta73/dreamxec/blob/main/server/server.js) (HTTP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React SPA"]
  node_client_boot["SPA bootstrap<br/>React entry<br/>[main.tsx]"]
  node_app_shell["App shell &amp; navigation<br/>React shell<br/>[App.tsx]"]
  node_auth_context["Session &amp; identity state<br/>React context<br/>[AuthContext.tsx]"]
  node_campaign_ui["Campaign workflows<br/>React screens"]
  node_identity_ui["Identity &amp; verification<br/>React screens<br/>[AuthPage.tsx]"]
  node_donation_ui["Donation checkout<br/>React modal/service<br/>[DonateModal.tsx]"]
  node_role_dashboards["Role operations<br/>React dashboards<br/>[AdminDashboard.tsx]"]
end

subgraph group_api["Node API"]
  node_server_entry{{"HTTP server<br/>Node runtime<br/>[server.js]"}}
  node_auth_api["Auth &amp; access boundary<br/>routes + middleware<br/>[auth.routes.js]"]
  node_project_api["Projects &amp; user projects<br/>domain API<br/>[project.routes.js]"]
  node_club_api["Clubs &amp; verification<br/>domain API<br/>[club.routes.js]"]
  node_payment_api["Payments API<br/>domain API<br/>[payment.routes.js]"]
  node_webhook_api["Payment webhook<br/>callback endpoint<br/>[razorpayWebhook.js]"]
  node_admin_api["Administration API<br/>domain API<br/>[admin.routes.js]"]
  node_background_jobs["Milestone reminders<br/>scheduled job"]
end

subgraph group_integrations["Data &amp; Integrations"]
  node_prisma[("Prisma persistence<br/>data access<br/>[prisma.js]")]
  node_database_schema[("Database model<br/>Prisma schema<br/>[schema.prisma]")]
  node_razorpay(("Razorpay<br/>payment provider"))
  node_redis[("Redis capabilities<br/>cache/service<br/>[redis.service.js]")]
  node_notifications["Email &amp; WhatsApp<br/>messaging integrations<br/>[email.service.js]"]
  node_object_uploads["Object uploads<br/>S3 integration<br/>[uploadToS3.js]"]
end

node_client_boot -->|"mounts"| node_app_shell
node_app_shell -->|"uses"| node_auth_context
node_app_shell -->|"routes to"| node_campaign_ui
node_app_shell -->|"routes to"| node_identity_ui
node_app_shell -->|"opens"| node_donation_ui
node_app_shell -->|"routes to"| node_role_dashboards
node_campaign_ui -->|"campaign requests"| node_project_api
node_identity_ui -->|"identity requests"| node_auth_api
node_identity_ui -->|"verification requests"| node_club_api
node_donation_ui -->|"starts payment"| node_payment_api
node_role_dashboards -->|"admin operations"| node_admin_api
node_server_entry -->|"serves"| node_auth_api
node_server_entry -->|"serves"| node_project_api
node_server_entry -->|"serves"| node_payment_api
node_server_entry -->|"receives callbacks"| node_webhook_api
node_auth_api -->|"reads/writes"| node_prisma
node_project_api -->|"reads/writes"| node_prisma
node_club_api -->|"reads/writes"| node_prisma
node_payment_api -->|"creates payment"| node_razorpay
node_razorpay -.->|"payment events"| node_webhook_api
node_webhook_api -->|"reconciles donations"| node_prisma
node_admin_api -->|"reviews data"| node_prisma
node_background_jobs -->|"finds milestones"| node_prisma
node_background_jobs -->|"sends reminders"| node_notifications
node_prisma -->|"models"| node_database_schema
node_project_api -.->|"uses"| node_redis
node_project_api -->|"uploads assets"| node_object_uploads

click node_client_boot "https://github.com/jaykumargupta73/dreamxec/blob/main/client/src/main.tsx"
click node_app_shell "https://github.com/jaykumargupta73/dreamxec/blob/main/client/src/App.tsx"
click node_auth_context "https://github.com/jaykumargupta73/dreamxec/blob/main/client/src/context/AuthContext.tsx"
click node_campaign_ui "https://github.com/jaykumargupta73/dreamxec/blob/main/client/src/components/BrowseCampaigns.tsx"
click node_identity_ui "https://github.com/jaykumargupta73/dreamxec/blob/main/client/src/components/AuthPage.tsx"
click node_donation_ui "https://github.com/jaykumargupta73/dreamxec/blob/main/client/src/components/DonateModal.tsx"
click node_role_dashboards "https://github.com/jaykumargupta73/dreamxec/blob/main/client/src/components/admin/AdminDashboard.tsx"
click node_server_entry "https://github.com/jaykumargupta73/dreamxec/blob/main/server/server.js"
click node_auth_api "https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/api/auth/auth.routes.js"
click node_project_api "https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/api/projects/project.routes.js"
click node_club_api "https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/api/clubs/club.routes.js"
click node_payment_api "https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/api/payments/payment.routes.js"
click node_webhook_api "https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/api/webhook/razorpayWebhook.js"
click node_admin_api "https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/api/admin/admin.routes.js"
click node_background_jobs "https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/cron/milestoneReminder.cron.js"
click node_prisma "https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/config/prisma.js"
click node_database_schema "https://github.com/jaykumargupta73/dreamxec/blob/main/server/prisma/schema.prisma"
click node_redis "https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/services/redis.service.js"
click node_notifications "https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/services/email.service.js"
click node_object_uploads "https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/utils/uploadToS3.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_client_boot,node_app_shell,node_auth_context,node_campaign_ui,node_identity_ui,node_donation_ui,node_role_dashboards toneBlue
class node_server_entry,node_auth_api,node_project_api,node_club_api,node_payment_api,node_webhook_api,node_admin_api,node_background_jobs toneAmber
class node_prisma,node_database_schema,node_razorpay,node_redis,node_notifications,node_object_uploads toneMint
```

## Components

### React SPA

- [SPA bootstrap](https://github.com/jaykumargupta73/dreamxec/blob/main/client/src/main.tsx): React entry · `client/src/main.tsx`
- [App shell & navigation](https://github.com/jaykumargupta73/dreamxec/blob/main/client/src/App.tsx): React shell · `client/src/App.tsx`
- [Session & identity state](https://github.com/jaykumargupta73/dreamxec/blob/main/client/src/context/AuthContext.tsx): React context · `client/src/context/AuthContext.tsx`
- [Campaign workflows](https://github.com/jaykumargupta73/dreamxec/blob/main/client/src/components/BrowseCampaigns.tsx): React screens · Browse, detail, and campaign creation flows. · `client/src/components/BrowseCampaigns.tsx`
- [Identity & verification](https://github.com/jaykumargupta73/dreamxec/blob/main/client/src/components/AuthPage.tsx): React screens · Authentication, profile setup, and president verification. · `client/src/components/AuthPage.tsx`
- [Donation checkout](https://github.com/jaykumargupta73/dreamxec/blob/main/client/src/components/DonateModal.tsx): React modal/service · `client/src/components/DonateModal.tsx`
- [Role operations](https://github.com/jaykumargupta73/dreamxec/blob/main/client/src/components/admin/AdminDashboard.tsx): React dashboards · Donor, president, and administrator operational views. · `client/src/components/admin/AdminDashboard.tsx`

### Node API

- [HTTP server](https://github.com/jaykumargupta73/dreamxec/blob/main/server/server.js): Node runtime · `server/server.js`
- [Auth & access boundary](https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/api/auth/auth.routes.js): routes + middleware · Authenticates requests and enforces role access. · `server/src/api/auth/auth.routes.js`
- [Projects & user projects](https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/api/projects/project.routes.js): domain API · Validates and manages campaigns, projects, and ownership. · `server/src/api/projects/project.routes.js`
- [Clubs & verification](https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/api/clubs/club.routes.js): domain API · `server/src/api/clubs/club.routes.js`
- [Payments API](https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/api/payments/payment.routes.js): domain API · Initiates donation payment processing. · `server/src/api/payments/payment.routes.js`
- [Payment webhook](https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/api/webhook/razorpayWebhook.js): callback endpoint · Reconciles asynchronous Razorpay events. · `server/src/api/webhook/razorpayWebhook.js`
- [Administration API](https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/api/admin/admin.routes.js): domain API · `server/src/api/admin/admin.routes.js`
- [Milestone reminders](https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/cron/milestoneReminder.cron.js): scheduled job · `server/src/cron/milestoneReminder.cron.js`

### Data & Integrations

- [Prisma persistence](https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/config/prisma.js): data access · `server/src/config/prisma.js`
- [Database model](https://github.com/jaykumargupta73/dreamxec/blob/main/server/prisma/schema.prisma): Prisma schema · `server/prisma/schema.prisma`
- **Razorpay**: payment provider
- [Redis capabilities](https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/services/redis.service.js): cache/service · `server/src/services/redis.service.js`
- [Email & WhatsApp](https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/services/email.service.js): messaging integrations · `server/src/services/email.service.js`
- [Object uploads](https://github.com/jaykumargupta73/dreamxec/blob/main/server/src/utils/uploadToS3.js): S3 integration · `server/src/utils/uploadToS3.js`

## Connections

- SPA bootstrap → App shell & navigation: mounts
- App shell & navigation → Session & identity state: uses
- App shell & navigation → Campaign workflows: routes to
- App shell & navigation → Identity & verification: routes to
- App shell & navigation → Donation checkout: opens
- App shell & navigation → Role operations: routes to
- Campaign workflows → Projects & user projects: campaign requests
- Identity & verification → Auth & access boundary: identity requests
- Identity & verification → Clubs & verification: verification requests
- Donation checkout → Payments API: starts payment
- Role operations → Administration API: admin operations
- HTTP server → Auth & access boundary: serves
- HTTP server → Projects & user projects: serves
- HTTP server → Payments API: serves
- HTTP server → Payment webhook: receives callbacks
- Auth & access boundary → Prisma persistence: reads/writes
- Projects & user projects → Prisma persistence: reads/writes
- Clubs & verification → Prisma persistence: reads/writes
- Payments API → Razorpay: creates payment
- Razorpay → Payment webhook: payment events
- Payment webhook → Prisma persistence: reconciles donations
- Administration API → Prisma persistence: reviews data
- Milestone reminders → Prisma persistence: finds milestones
- Milestone reminders → Email & WhatsApp: sends reminders
- Prisma persistence → Database model: models
- Projects & user projects → Redis capabilities: uses
- Projects & user projects → Object uploads: uploads assets
