# raghav26102000/saral-sewa architecture

> Architecture diagram of the GitHub repository raghav26102000/saral-sewa, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/raghav26102000/saral-sewa
- Repository: https://github.com/raghav26102000/saral-sewa

## Overview

##### Project type and purpose
- This is a Next.js 13 full-stack React application using the App Router.
- Purpose: Display a catalog of “schemes,” allow filtering/searching, view details, and apply via dynamic routes.

##### File structure
- src/app: the Next.js App Router directory containing layouts, global CSS, and page entry points.
- page.tsx: Home page
- /schemes/page.tsx: Schemes list
- /schemes/[id]/page.tsx: Scheme detail
- /apply/[schemeId]/page.tsx: Application form for a specific scheme
- src/components: domain and UI components organized by feature (home, layout, schemes) and a generic ui/ subfolder.
- src/lib: utility modules (data fetch, helper functions).
- Root configs: Tailwind, PostCSS, ESLint, TypeScript, Next config

##### README
- Confirms Next.js, create-next-app, dev server, use of next/font, and deployment on Vercel.

- Use clear labels: “App Router,” “Home Page,” “SchemeDetail Component,” “Data Module,” etc.
- Frontend routing & pages (light blue)
- UI components (teal)
- Data layer (green)
- Static assets & styling (orange)
- External services (gray)

##### Final advice
- Be detailed: include every directory of src/app, src/components, and src/lib.
- Dynamic routing logic ([id]) and provider layer.
- How CSS and fonts integrate at build time.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["Browser"]:::external
    Browser -->|"GET /, /schemes, /schemes/:id, /apply/:id"| NextServer

    subgraph "Next.js Server (App Router & Functions)"
        AppRouter["App Router"]:::frontend
        AppRouter --> Layout
        AppRouter --> Providers
        AppRouter --> PagesGroup

        Layout["Global Layout Component"]:::frontend
        Providers["Global Providers Wrapper"]:::frontend

        subgraph "Pages"
            PagesGroup((" "))
            Home["Home Page"]:::frontend
            SchemesList["Schemes List Page"]:::frontend
            SchemeDetail["Scheme Detail Page"]:::frontend
            ApplyForm["Apply Form Page"]:::frontend
            PagesGroup --> Home
            PagesGroup --> SchemesList
            PagesGroup --> SchemeDetail
            PagesGroup --> ApplyForm
        end

        subgraph "Domain & UI Components"
            HomeDomain["Home Domain Components"]:::domain
            LayoutDomain["Layout Domain Components"]:::domain
            SchemesDomain["Schemes Domain Components"]:::domain
            UILib["UI Library Components"]:::ui
        end

        subgraph "Data & Utils"
            DataModule["Data Module"]:::data
            Utils["Utility Functions"]:::data
            JSON["components.json"]:::data
            DataModule --> JSON
        end

        Layout -->|import| LayoutDomain
        LayoutDomain -->|import| UILib

        Providers -->|wrap| Home
        Providers -->|wrap| SchemesList
        Providers -->|wrap| SchemeDetail
        Providers -->|wrap| ApplyForm

        Home -->|import| HomeDomain
        HomeDomain -->|import| UILib
        SchemesList -->|import| SchemesDomain
        SchemesDomain -->|import| UILib
        SchemeDetail -->|import| SchemesDomain
        ApplyForm -->|import| SchemesDomain
        ApplyForm -->|import| UILib

        Home -->|fetch data via| DataModule
        SchemesList -->|fetch data via| DataModule
        SchemeDetail -->|fetch data via| DataModule
        ApplyForm -->|fetch data via| DataModule
    end

    NextServer -->|serve| StaticAssets
    StaticAssets["Static Assets (public/)"]:::static

    subgraph "Build & Config"
        Tailwind["Tailwind CSS Config"]:::static
        PostCSS["PostCSS Config"]:::static
        NextConfig["Next.js Config"]:::static
        ESLint["ESLint Config"]:::static
        TSConfig["TypeScript Config"]:::static
    end

    Tailwind --> NextServer
    PostCSS --> NextServer
    NextConfig --> NextServer
    ESLint --> NextServer
    TSConfig --> NextServer

    NextServer -->|fetch font CSS| FontService
    FontService["next/font (Geist)"]:::external

    click AppRouter "https://github.com/raghav26102000/saral-sewa/tree/master/src/app"
    click Layout "https://github.com/raghav26102000/saral-sewa/blob/master/src/app/layout.tsx"
    click Providers "https://github.com/raghav26102000/saral-sewa/blob/master/src/app/providers.tsx"
    click Home "https://github.com/raghav26102000/saral-sewa/blob/master/src/app/page.tsx"
    click SchemesList "https://github.com/raghav26102000/saral-sewa/blob/master/src/app/schemes/page.tsx"
    click SchemeDetail "https://github.com/raghav26102000/saral-sewa/blob/master/src/app/schemes/[id]/page.tsx"
    click ApplyForm "https://github.com/raghav26102000/saral-sewa/blob/master/src/app/apply/[schemeId]/page.tsx"
    click HomeDomain "https://github.com/raghav26102000/saral-sewa/tree/master/src/components/home"
    click LayoutDomain "https://github.com/raghav26102000/saral-sewa/tree/master/src/components/layout"
    click SchemesDomain "https://github.com/raghav26102000/saral-sewa/tree/master/src/components/schemes"
    click UILib "https://github.com/raghav26102000/saral-sewa/tree/master/src/components/ui"
    click DataModule "https://github.com/raghav26102000/saral-sewa/blob/master/src/lib/data.ts"
    click Utils "https://github.com/raghav26102000/saral-sewa/blob/master/src/lib/utils.ts"
    click StaticAssets "https://github.com/raghav26102000/saral-sewa/tree/master/public/"
    click Tailwind "https://github.com/raghav26102000/saral-sewa/blob/master/tailwind.config.ts"
    click PostCSS "https://github.com/raghav26102000/saral-sewa/blob/master/postcss.config.mjs"
    click NextConfig "https://github.com/raghav26102000/saral-sewa/blob/master/next.config.ts"
    click ESLint "https://github.com/raghav26102000/saral-sewa/blob/master/eslint.config.mjs"
    click TSConfig "https://github.com/raghav26102000/saral-sewa/blob/master/tsconfig.json"

    classDef frontend fill:#E0F7FA,stroke:#006064
    classDef domain fill:#B2DFDB,stroke:#004D40
    classDef ui fill:#E0F2F1,stroke:#004D40
    classDef data fill:#E8F5E9,stroke:#1B5E20
    classDef static fill:#FFF3E0,stroke:#E65100
    classDef external fill:#EEEEEE,stroke:#616161
```
