# muhammedhashimt/dars-fest architecture

> Architecture diagram of the GitHub repository muhammedhashimt/dars-fest, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/muhammedhashimt/dars-fest
- Repository: https://github.com/muhammedhashimt/dars-fest

## Overview

##### 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.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client
    Browser["Client Browser"]:::client

    %% Static Assets
    StaticAssets["Static Assets (public/)"]:::static

    %% Hosting
    Hosting["Hosting Platform"]:::hosting

    %% Styling Engine
    StylingEngine["Styling Engine"]:::styling

    %% Data Store
    subgraph "Data Store (JSON Files)"
        direction TB
        DS1["candidates.json"]:::datastore
        DS2["institutions.json"]:::datastore
        DS3["programs.json"]:::datastore
        DS4["cp.json"]:::datastore
    end

    %% Component Library & Context
    subgraph "React Components & Context"
        direction TB
        Context["Context Provider"]:::components
        subgraph "Candidates Components"
            direction TB
            Candidate["Candidate"]:::components
            ViewCandidate["ViewCandidate"]:::components
        end
        subgraph "Institutions Components"
            direction TB
            Institution["Institution"]:::components
            ViewInstitution["ViewInstitution"]:::components
        end
        subgraph "Programs Components"
            direction TB
            ProgramsComp["Programs"]:::components
            PrgList["PrgList"]:::components
            JdgList["JdgList"]:::components
            JudgeComp["Judge"]:::components
            ViewProgram["ViewProgram"]:::components
        end
        subgraph "Profile Components"
            direction TB
            ProfileComp["Profile"]:::components
            Check["Check"]:::components
            ProgramResult["ProgramResult"]:::components
        end
        subgraph "Result Components"
            direction TB
            ResultsComp["Results"]:::components
            ProgramsList["ProgramsList"]:::components
            TeamsList["TeamsList"]:::components
            ViewResult["ViewResult"]:::components
        end
    end

    %% Next.js Server
    subgraph "Next.js Server" 
        direction TB
        subgraph "Routing (App Router)"
            direction TB
            Layout["layout.tsx"]:::server
            HomePage["page.tsx (home)"]:::server
            AdminPage["admin/page.tsx"]:::server
            CandidatesPage["candidates/page.tsx"]:::server
            InstitutionsPage["institutions/page.tsx"]:::server
            JudgePage["judge/page.tsx"]:::server
            JudgeDetail["judge/[code]/page.tsx"]:::server
            ProgramsPage["programs/page.tsx"]:::server
            ProgramsDetail["programs/[code]/page.tsx"]:::server
            ProfilePage["profile/page.tsx"]:::server
            ProfileDetail["profile/[nom]/page.tsx"]:::server
            ResultPage["result/page.tsx"]:::server
            DownloadsPage["downloads/page.tsx"]:::server
        end
        subgraph "Layout & Context"
            direction TB
            Layout
            Context
        end
        subgraph "Server Components"
            direction TB
            HomePage
            AdminPage
            CandidatesPage
            InstitutionsPage
            JudgePage
            JudgeDetail
            ProgramsPage
            ProgramsDetail
            ProfilePage
            ProfileDetail
            ResultPage
            DownloadsPage
        end
        subgraph "Client Components"
            direction TB
            Candidate
            ViewCandidate
            Institution
            ViewInstitution
            ProgramsComp
            PrgList
            JdgList
            JudgeComp
            ViewProgram
            ProfileComp
            Check
            ProgramResult
            ResultsComp
            ProgramsList
            TeamsList
            ViewResult
        end
    end

    %% Connections
    Browser -->|"HTTP Request"| Layout
    Browser -->|"Fetch Asset"| StaticAssets
    Layout -->|"Read JSON"| DS1
    Layout -->|"Read JSON"| DS2
    Layout -->|"Read JSON"| DS3
    Layout -->|"Read JSON"| DS4
    Layout -->|"Render HTML"| HomePage
    HomePage -->|"Inject Data"| Candidate
    HomePage -->|"Inject Data"| Institution
    HomePage -->|"Inject Data"| ProgramsComp
    HomePage -->|"Inject Data"| ResultsComp
    Candidate -->|"Hydrate"| Browser
    Institution -->|"Hydrate"| Browser
    ProgramsComp -->|"Hydrate"| Browser
    ResultsComp -->|"Hydrate"| Browser
    Browser -->|"Hydrate"| Context
    Browser -->|"Hydrate"| Candidate
    StylingEngine -->|"Apply Styles"| HomePage
    Hosting -->|"Deploy"| Layout

    %% Click Events - Routing
    click Layout "https://github.com/muhammedhashimt/dars-fest/blob/main/src/app/layout.tsx"
    click HomePage "https://github.com/muhammedhashimt/dars-fest/blob/main/src/app/page.tsx"
    click AdminPage "https://github.com/muhammedhashimt/dars-fest/blob/main/src/app/admin/page.tsx"
    click CandidatesPage "https://github.com/muhammedhashimt/dars-fest/blob/main/src/app/candidates/page.tsx"
    click InstitutionsPage "https://github.com/muhammedhashimt/dars-fest/blob/main/src/app/institutions/page.tsx"
    click JudgePage "https://github.com/muhammedhashimt/dars-fest/blob/main/src/app/judge/page.tsx"
    click JudgeDetail "https://github.com/muhammedhashimt/dars-fest/blob/main/src/app/judge/[code]/page.tsx"
    click ProgramsPage "https://github.com/muhammedhashimt/dars-fest/blob/main/src/app/programs/page.tsx"
    click ProgramsDetail "https://github.com/muhammedhashimt/dars-fest/blob/main/src/app/programs/[code]/page.tsx"
    click ProfilePage "https://github.com/muhammedhashimt/dars-fest/blob/main/src/app/profile/page.tsx"
    click ProfileDetail "https://github.com/muhammedhashimt/dars-fest/blob/main/src/app/profile/[nom]/page.tsx"
    click ResultPage "https://github.com/muhammedhashimt/dars-fest/blob/main/src/app/result/page.tsx"
    click DownloadsPage "https://github.com/muhammedhashimt/dars-fest/blob/main/src/app/downloads/page.tsx"

    %% Click Events - Context
    click Context "https://github.com/muhammedhashimt/dars-fest/blob/main/src/context/context.tsx"

    %% Click Events - Components
    click Candidate "https://github.com/muhammedhashimt/dars-fest/blob/main/src/components/candidates/Candidate.tsx"
    click ViewCandidate "https://github.com/muhammedhashimt/dars-fest/blob/main/src/components/candidates/ViewCandidate.tsx"
    click Institution "https://github.com/muhammedhashimt/dars-fest/blob/main/src/components/institutions/Institution.tsx"
    click ViewInstitution "https://github.com/muhammedhashimt/dars-fest/blob/main/src/components/institutions/ViewInstitution.tsx"
    click ProgramsComp "https://github.com/muhammedhashimt/dars-fest/blob/main/src/components/programs/Programs.tsx"
    click PrgList "https://github.com/muhammedhashimt/dars-fest/blob/main/src/components/programs/PrgList.tsx"
    click JdgList "https://github.com/muhammedhashimt/dars-fest/blob/main/src/components/programs/JdgList.tsx"
    click JudgeComp "https://github.com/muhammedhashimt/dars-fest/blob/main/src/components/programs/Judge.tsx"
    click ViewProgram "https://github.com/muhammedhashimt/dars-fest/blob/main/src/components/programs/ViewProgram.tsx"
    click ProfileComp "https://github.com/muhammedhashimt/dars-fest/blob/main/src/components/profile/Profile.tsx"
    click Check "https://github.com/muhammedhashimt/dars-fest/blob/main/src/components/profile/Check.tsx"
    click ProgramResult "https://github.com/muhammedhashimt/dars-fest/blob/main/src/components/profile/ProgramResult.tsx"
    click ResultsComp "https://github.com/muhammedhashimt/dars-fest/blob/main/src/components/result/Results.tsx"
    click ProgramsList "https://github.com/muhammedhashimt/dars-fest/blob/main/src/components/result/ProgramsList.tsx"
    click TeamsList "https://github.com/muhammedhashimt/dars-fest/blob/main/src/components/result/TeamsList.tsx"
    click ViewResult "https://github.com/muhammedhashimt/dars-fest/blob/main/src/components/result/ViewResult.tsx"

    %% Click Events - Data Store
    click DS1 "https://github.com/muhammedhashimt/dars-fest/blob/main/src/data/candidates.json"
    click DS2 "https://github.com/muhammedhashimt/dars-fest/blob/main/src/data/institutions.json"
    click DS3 "https://github.com/muhammedhashimt/dars-fest/blob/main/src/data/programs.json"
    click DS4 "https://github.com/muhammedhashimt/dars-fest/blob/main/src/data/cp.json"

    %% Click Events - Styling Engine
    click StylingEngine "https://github.com/muhammedhashimt/dars-fest/blob/main/tailwind.config.ts"
    click StylingEngine "https://github.com/muhammedhashimt/dars-fest/blob/main/postcss.config.js"
    click StylingEngine "https://github.com/muhammedhashimt/dars-fest/blob/main/src/app/globals.css"

    %% Styles
    classDef client fill:#d0e7ff,stroke:#024b7c,stroke-width:1px
    classDef server fill:#d0f0d0,stroke:#2d662d,stroke-width:1px
    classDef datastore fill:#fff4c1,stroke:#a68a00,stroke-width:1px
    classDef components fill:#ffe0b2,stroke:#c77614,stroke-width:1px
    classDef static fill:#e0e0e0,stroke:#8a8a8a,stroke-width:1px
    classDef styling fill:#e2dbff,stroke:#5d4b8a,stroke-width:1px
    classDef hosting fill:#f0f0ff,stroke:#6a6a9d,stroke-width:1px
```
