How hardeepsingh980/sikhsoorme works
Project Type and Purpose
• This is a full-stack Next.js web application bootstrapped with create-next-app.
• It renders a content-driven site (pages under app/ such as “about,” “categories,” “soorme/[category]/[slug]”) and includes search, timeline, and data-driven pages based on JSON files and a Supabase backend.
• Build scripts generate static JSON (in public/generated/) and optionally push data to Supabase.
File Structure Analysis
• app/ – Next.js App Router directory: static and dynamic routes, global layout (layout.tsx), global CSS (globals.css), and route-specific logic (e.g., search/actions.ts).
• components/ – Reusable UI atoms (ui/), molecules (cards, badges, forms), and higher-level layouts (Header, Footer, QuickStats).
• data/ – Raw content JSON for “personalities.”
• public/generated/ – Build-time artifacts: categories.json, homepageData.json, timeline.json.
• lib/ – Shared utilities: Supabase client (supabase.ts), helper functions (utils.ts).
• scripts/ – Node scripts that read data/, generate JSON in public/generated/, and optionally push data to Supabase.
• .github/workflows/ – CI/CD (e.g., deploy.yml).
• tailwind.config.ts, postcss.config.mjs – Tailwind CSS setup.
• next.config.ts – Next.js config for SSG/SSR, font optimization, etc.
Key Architectural Patterns
• Static-Site Generation (SSG) for most content pages using JSON under public/generated/.
• Server-Side Rendering (SSR) / Server Actions for dynamic features (e.g., search) that call the Supabase API via lib/supabase.ts.
• App Router (Next.js 13+), dynamic routes (app/soorme/[category]/[slug]).
• Build Pipeline – Custom scripts generate and transform data at build time, integrated into CI/CD.
• Component-Driven UI leveraging Tailwind CSS and headless UI primitives.
Components
a. Client (Web Browser)
b. CDN / Edge Network (Vercel Hosting)
c. Next.js Serverless Functions (App Router, SSR, Server Actions)
d. Static Assets (public/generated JSON, CSS, JS bundles)
e. Supabase Database (external service)
f. Build System
• GitHub Actions → runs scripts/ → produces JSON → deploys to Vercel
g. Developer Workstation (Git push, CI trigger)
Interaction Flows
• Build Time
1. Developer commits → GitHub Actions triggers → build scripts (scripts/generate*) read data/, write to public/generated/.
2. Next.js build compiles pages/components, incorporates generated JSON into static pages.
3. Deploy to Vercel.
• Runtime
1. Browser requests a page → served from CDN (static or SSR).
2. For dynamic routes (search), Next.js Server Action calls Supabase via lib/supabase.ts → returns results → page renders.
3. User navigation uses Next.js client router to fetch JSON or hit SSR endpoints.