How muhammedhashimt/dars-fest works
Project type and purpose
• This is a Next.js (v13+) web application (“college-fest”) built with TypeScript and Tailwind CSS.
• It serves as a marketing/information site for a college fest: routing users to pages for candidates, institutions, programs, judges, results, downloads, and admin.
• All data is fetched from local JSON files (no external database or API).
File structure
• Top-level config files: next.config.js, tsconfig.json, tailwind.config.ts, package.json.
• “public/” holds static assets (images, favicons, etc.).
• “src/app/” uses Next.js’ App Router: each subfolder under app/ maps to a route.
• layout.tsx – root layout and React Context provider
• page.tsx – home page
• admin/, candidates/, institutions/, judge/, programs/, profile/, result/, downloads/ each with page.tsx (and dynamic [code] or [nom] parameter routes).
• “src/components/” is a component library, organized by domain (candidates, institutions, programs, profile, result).
• “src/context/context.tsx” holds global React context for state.
• “src/data/” holds JSON files (candidates.json, institutions.json, programs.json, cp.json). These act as the data store.
README
• Minimal: “Junior College Fest Website.”
• No extra architectural notes, so rely on file structure for design.
Main components & interactions
a. Client Browser
• Sends HTTP(S) requests for pages and assets.
b. Next.js Server / Server-Side Renderer
• Handles routing, server components (app/), reads JSON from disk, renders React pages to HTML/CSS/JS.
c. React Component Library
• UI building blocks under src/components/
d. React Context (Global State)
• Provides shared state (e.g. user session, theme) across pages via layout.tsx.
e. Data Store (Local JSON files)
• src/data/*.json — low-complexity database.
f. Static Assets
• public/ folder for images, PDFs, downloads.
g. Styling Engine
• Tailwind CSS applied via globals.css and tailwind.config.ts.
Relationships & data flow
• Browser → Next.js routing layer (app/)
• Next.js reads JSON (data/) → injects data into server components or passes to client components
• Components (src/components/) render UI, may consume context (src/context/)
• Layout.tsx wraps pages in context provider and includes global CSS
• Static assets served directly from public/
• Tailwind styles applied at build time via PostCSS
Architectural patterns & design principles
• App Router pattern (Next.js 13 server & client components)
• Feature-folder structure (each route’s code under src/app/<feature>)
• Component-based design (domain-specific components under src/components/)
• Single source of truth for data in JSON files (acts as read-only “database”)
• Separation of concerns: routing, components, context, data, styling
Putting it all together
• Every directory from src/app, src/components, src/context, and src/data is represented conceptually.