How jaykumargupta73/dreamxec works
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: prisma.js Prisma persistence · App.tsx App shell & navigation · project.routes.js Projects & user projects · server.js HTTP server
Components 21
React SPA
- SPA bootstrap
client/src/main.tsx - App shell & navigation
client/src/App.tsx - Session & identity state
client/src/context/AuthContext.tsx - Campaign workflows · Browse, detail, and campaign creation flows.
client/src/components/BrowseCampaigns.tsx - Identity & verification · Authentication, profile setup, and president verification.
client/src/components/AuthPage.tsx - Donation checkout
client/src/components/DonateModal.tsx - Role operations · Donor, president, and administrator operational views.
client/src/components/admin/AdminDashboard.tsx
Node API
- HTTP server
server/server.js - Auth & access boundary · Authenticates requests and enforces role access.
server/src/api/auth/auth.routes.js - Projects & user projects · Validates and manages campaigns, projects, and ownership.
server/src/api/projects/project.routes.js - Clubs & verification
server/src/api/clubs/club.routes.js - Payments API · Initiates donation payment processing.
server/src/api/payments/payment.routes.js - Payment webhook · Reconciles asynchronous Razorpay events.
server/src/api/webhook/razorpayWebhook.js - Administration API
server/src/api/admin/admin.routes.js - Milestone reminders
server/src/cron/milestoneReminder.cron.js
Data & Integrations
- Prisma persistence
server/src/config/prisma.js - Database model
server/prisma/schema.prisma - Razorpay
- Redis capabilities
server/src/services/redis.service.js - Email & WhatsApp
server/src/services/email.service.js - Object uploads
server/src/utils/uploadToS3.js
Connections 27
- 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