How sumitsinghraghuwanshi1245/demigod works
Project Type and Purpose
• This is a full-stack web application built with Next.js (App Router) that delivers multiple event-driven landing pages (e.g., wedding, corporate, media & marketing, checkout, thank-you pages). It uses SSR/SSG and client-side React components (AOS, React-Slick, Leaflet maps, etc.) to render dynamic UIs, and is intended to be deployed on Vercel (or any Node server) with CDN caching static assets.
File Structure Analysis
• Root Level
• Configuration: .env, next.config.js, ecosystem.config.js (PM2)
• Package management: package.json, package-lock.json, bun.lockb
• CI/CD/Deployment: .gitignore, README.md
• public/
• Static assets served directly: images, videos, PDFs, AVIFs
• src/app/
• App router layout (layout.js, globals.css)
• Route directories for each page: about-us/, checkout/, contact-us/, landingpage/, media&marketing/, wedding-planners/, etc.
• src/app/component/
• Reusable React components organized by domain (homepage, events, corporate, weddingpage, mnm, onboarding, common header/footer, utils, context)
• src/context/
• Global React Context (AppContext.js) for state management
• Build/Dev tools
• jsconfig.json / tsconfig.json (path aliases, TS support)
• .eslintrc.json (linting)
Architectural Patterns & Key Technologies
• Next.js App Router: File-system routing, SSR/SSG at route-level
• Client-side hydration: React components, dynamic imports (AOSInit, Leaflet map, sliders)
• Global State: React Context (AppContext)
• Static Asset Delivery: public/ directory + Vercel CDN
• External Services & Libraries: Leaflet for maps, React-Slick for carousels, AOS for animations
• Deployment: Vercel Serverless Functions or Node/PM2 via ecosystem.config.js
Main System Components
A. End User Browser – sends HTTP requests, executes client-side React
B. CDN (e.g., Vercel Edge) – caches static assets under public/ and pre-rendered HTML
C. Next.js Serverless/Node Server –
1. App Router handles route requests
2. SSR/SSG pipelines render HTML and JSON payloads
3. API routes (if any) or other server logic
D. React Runtime – hydrates components, uses Context for state
E. External Libraries/Services – Leaflet map tile servers, analytics, third-party scripts
Relationships & Data Flow
1. Browser → CDN
• Requests page URL → CDN returns cached HTML/static if available
2. Browser → Next.js Server
• On cache miss or dynamic route → Serverless function executes, SSR/SSG renders HTML + initial state JSON
3. Browser ←→ React Client
• Hydration: React mounts components in client
• Dynamic loads: fetch additional data via fetch() calls (to API routes or external services)
4. React Context
• Provides global state across components
5. Static Assets
• public/ served via CDN (images, videos)
Important Architectural Patterns
• SSR vs SSG: indicate which routes are pre-rendered at build (e.g., landing pages) vs those rendered per-request
• State Management: highlight Context usage for cross-page state (e.g., checkout steps)
Elements to Enforce Detail
• Clear labels (component names, file paths for key modules: layout.js, AppContext.js)