# 0xniru/ajay-darpan architecture

> Architecture diagram of the GitHub repository 0xniru/ajay-darpan, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/0xniru/ajay-darpan
- Repository: https://github.com/0xniru/ajay-darpan

## Overview

##### Project Type and Purpose
- This is a frontend-only Single Page Application (SPA) built with Vite, React, TypeScript, Tailwind CSS, and the shadcn-ui component library.
- It delivers a set of user-facing pages (Dashboard, PublicDashboard, Auth, etc.) and leverages reusable UI components (adorned with Tailwind utilities and shadcn patterns).
- It is hosted and deployed via the Lovable platform as static assets (HTML, JS, CSS), with optional custom domain support.

##### File Structure
- Top-level: configuration files (.gitignore, tsconfig, vite.config.ts, tailwind.config.ts) and project metadata (package.json, README.md).
- “public/”: static assets and the index.html entry.
- “src/”: source code
- main.tsx – application entry point that hydrates App.tsx
- App.tsx & App.css – root layout and global styling
- pages/ – route-based pages (Index, Dashboard, Auth, PublicDashboard, NotFound)
- components/ – domain-specific UI widgets (HeroSection, StatsSection, plus “officer” subfolder for administrative screens)
- components/ui/ – low-level, styled primitives (buttons, dialogs, inputs, toasts, etc.) provided by shadcn-ui
- hooks/ – custom React hooks (use-mobile, use-toast)
- lib/ – shared utilities (utils.ts)

##### Key Insights from README
- Build and develop locally using Node.js + npm via Vite’s dev server.
- Deployment and hosting are fully automated by Lovable (runs npm install, npm run build, and serves static files).
- Technology stack summary confirms React + TS + Vite + shadcn-ui + Tailwind.

a. Main Components
- Developer Workstation (IDE, Git)
- Git Repository (GitHub)
- CI/CD & Hosting (Lovable)
- Build System (Vite, npm scripts)
- Static Asset Store / CDN (Lovable’s storage)
- Client Browser (runs the SPA)
- Optional External Services (e.g., analytics, API endpoints if integrated later)
b. Relationships & Interactions
- Developer → pushes code to → Git Repository
- Git Repository → triggers → Lovable CI/CD
- Lovable CI/CD → runs → npm install & npm run build (invokes Vite, TS compiler, PostCSS, Tailwind)
- Build Output (index.html, assets, JS bundles, CSS) → stored on → Static Asset Store / CDN
- End User Browser → requests → CDN-hosted assets → renders → React SPA → interacts with UI components/hooks/lib
- (Future) SPA → calls → External APIs for data (grievance management, project tracking, etc.)
c. Architectural Patterns & Principles
- Component-based UI (Atomic design with shadcn-ui primitives → composite components → pages)
- Unidirectional data flow (React props + custom hooks)
- Strict separation between dev/build (Node/Vite) and runtime (browser)
- Configuration-driven styling (Tailwind, PostCSS)
d. Key Technologies & Frameworks
- Vite for fast dev server + build
- React + TypeScript for UI & type safety
- Tailwind CSS for utility-first styling
- shadcn-ui for accessible, customizable primitives
- Lovable for CI/CD and static hosting

##### Detailed Checklist
- [ ] Developer Workstation (IDE & Git)
- [ ] GitHub Repo (source control)
- [ ] CI/CD & Hosting (Lovable platform)
- [ ] Build Step: npm install → Vite build → PostCSS/Tailwind
- [ ] Static Asset Store / CDN
- [ ] User Browser (SPA runtime)
- [ ] src directory breakdown: components/ui, components/officer, pages, hooks, lib

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Development Layer
    subgraph "Development Tools" 
        direction TB
        DevWork["Developer Workstation (IDE & Git)"]:::dev
        GitRepo["GitHub Repository"]:::dev
    end

    %% CI/CD & Build Layer
    subgraph "CI/CD & Build Pipeline"
        direction TB
        CI["Lovable CI/CD"]:::build
        Build["npm install → Vite Build (TS, PostCSS, Tailwind)"]:::build
    end

    %% Deployment Layer
    subgraph "Deployment & Hosting"
        direction TB
        CDN["Static Asset Store / CDN"]:::deploy
    end

    %% Runtime Layer
    subgraph "Runtime (Browser)"
        direction TB
        Browser["End User Browser"]:::runtime
    end

    %% Codebase Structure
    subgraph "Source Code (src)" 
        direction TB
        Main["src/main.tsx"]:::code
        AppTsx["src/App.tsx"]:::code
        AppCss["src/App.css"]:::code

        subgraph "Pages" 
            direction TB
            Index["src/pages/Index.tsx"]:::code
            Dashboard["src/pages/Dashboard.tsx"]:::code
            PublicDashboard["src/pages/PublicDashboard.tsx"]:::code
            Auth["src/pages/Auth.tsx"]:::code
            NotFound["src/pages/NotFound.tsx"]:::code
        end

        subgraph "Components" 
            direction TB
            Hero["src/components/HeroSection.tsx"]:::code
            Features["src/components/FeaturesSection.tsx"]:::code
            Stats["src/components/StatsSection.tsx"]:::code
            Header["src/components/Header.tsx"]:::code
            Footer["src/components/Footer.tsx"]:::code
            FundTracker["src/components/FundTracker.tsx"]:::code
            AdarshTracker["src/components/AdarshGramTracker.tsx"]:::code

            subgraph "Officer Screens" 
                direction TB
                FundUpdate["src/components/officer/FundUpdateForm.tsx"]:::code
                Grievance["src/components/officer/GrievanceManagement.tsx"]:::code
                MediaGallery["src/components/officer/MediaGallery.tsx"]:::code
                ProfileSettings["src/components/officer/ProfileSettings.tsx"]:::code
                ProjectTracking["src/components/officer/ProjectTracking.tsx"]:::code
                ReportsAnalytics["src/components/officer/ReportsAnalytics.tsx"]:::code
                VillageManagement["src/components/officer/VillageManagement.tsx"]:::code
            end
        end

        subgraph "UI Primitives (shadcn-ui)" 
            direction TB
            UIPrimitives["src/components/ui/*.tsx"]:::code
        end

        subgraph "Hooks & Lib"
            direction TB
            HookMobile["src/hooks/use-mobile.tsx"]:::code
            HookToast["src/hooks/use-toast.ts"]:::code
            Utils["src/lib/utils.ts"]:::code
        end

    end

    %% Static Public
    PublicHTML["public/index.html"]:::code

    %% Configuration Files
    subgraph "Configs & Metadata"
        direction TB
        TailwindConfig["tailwind.config.ts"]:::config
        PostCSSConfig["postcss.config.js"]:::config
        ViteConfig["vite.config.ts"]:::config
        TSConfig["tsconfig.json & tsconfig.*.json"]:::config
        PackageJSON["package.json & lockfiles"]:::config
        ESLint["eslint.config.js"]:::config
        Readme["README.md & .gitignore"]:::config
    end

    %% Connections
    DevWork -->|push code| GitRepo
    GitRepo -->|trigger build| CI
    CI -->|run build| Build
    Build -->|deploy assets| CDN
    Browser -->|request assets| CDN
    Browser -->|renders SPA| Main
    Main --> AppTsx
    AppTsx --> Pages
    AppTsx --> Components
    AppTsx --> UIPrimitives
    AppTsx --> HookMobile
    AppTsx --> HookToast
    AppTsx --> Utils
    PublicHTML --> Main

    %% Click Events
    click Main "https://github.com/0xniru/ajay-darpan/blob/main/src/main.tsx"
    click AppTsx "https://github.com/0xniru/ajay-darpan/blob/main/src/App.tsx"
    click AppCss "https://github.com/0xniru/ajay-darpan/blob/main/src/App.css"
    click PublicHTML "https://github.com/0xniru/ajay-darpan/blob/main/public/index.html"
    click Index "https://github.com/0xniru/ajay-darpan/blob/main/src/pages/Index.tsx"
    click Dashboard "https://github.com/0xniru/ajay-darpan/blob/main/src/pages/Dashboard.tsx"
    click PublicDashboard "https://github.com/0xniru/ajay-darpan/blob/main/src/pages/PublicDashboard.tsx"
    click Auth "https://github.com/0xniru/ajay-darpan/blob/main/src/pages/Auth.tsx"
    click NotFound "https://github.com/0xniru/ajay-darpan/blob/main/src/pages/NotFound.tsx"
    click Hero "https://github.com/0xniru/ajay-darpan/blob/main/src/components/HeroSection.tsx"
    click Features "https://github.com/0xniru/ajay-darpan/blob/main/src/components/FeaturesSection.tsx"
    click Stats "https://github.com/0xniru/ajay-darpan/blob/main/src/components/StatsSection.tsx"
    click Header "https://github.com/0xniru/ajay-darpan/blob/main/src/components/Header.tsx"
    click Footer "https://github.com/0xniru/ajay-darpan/blob/main/src/components/Footer.tsx"
    click FundTracker "https://github.com/0xniru/ajay-darpan/blob/main/src/components/FundTracker.tsx"
    click AdarshTracker "https://github.com/0xniru/ajay-darpan/blob/main/src/components/AdarshGramTracker.tsx"
    click FundUpdate "https://github.com/0xniru/ajay-darpan/blob/main/src/components/officer/FundUpdateForm.tsx"
    click Grievance "https://github.com/0xniru/ajay-darpan/blob/main/src/components/officer/GrievanceManagement.tsx"
    click MediaGallery "https://github.com/0xniru/ajay-darpan/blob/main/src/components/officer/MediaGallery.tsx"
    click ProfileSettings "https://github.com/0xniru/ajay-darpan/blob/main/src/components/officer/ProfileSettings.tsx"
    click ProjectTracking "https://github.com/0xniru/ajay-darpan/blob/main/src/components/officer/ProjectTracking.tsx"
    click ReportsAnalytics "https://github.com/0xniru/ajay-darpan/blob/main/src/components/officer/ReportsAnalytics.tsx"
    click VillageManagement "https://github.com/0xniru/ajay-darpan/blob/main/src/components/officer/VillageManagement.tsx"
    click UIPrimitives "https://github.com/0xniru/ajay-darpan/tree/main/src/components/ui/"
    click HookMobile "https://github.com/0xniru/ajay-darpan/blob/main/src/hooks/use-mobile.tsx"
    click HookToast "https://github.com/0xniru/ajay-darpan/blob/main/src/hooks/use-toast.ts"
    click Utils "https://github.com/0xniru/ajay-darpan/blob/main/src/lib/utils.ts"
    click TailwindConfig "https://github.com/0xniru/ajay-darpan/blob/main/tailwind.config.ts"
    click PostCSSConfig "https://github.com/0xniru/ajay-darpan/blob/main/postcss.config.js"
    click ViteConfig "https://github.com/0xniru/ajay-darpan/blob/main/vite.config.ts"
    click TSConfig "https://github.com/0xniru/ajay-darpan/blob/main/tsconfig.json"
    click PackageJSON "https://github.com/0xniru/ajay-darpan/blob/main/package.json"
    click ESLint "https://github.com/0xniru/ajay-darpan/blob/main/eslint.config.js"
    click Readme "https://github.com/0xniru/ajay-darpan/blob/main/README.md"

    %% Styles
    classDef dev fill:#eeeeee,stroke:#999999,stroke-width:1px
    classDef build fill:#cfe2ff,stroke:#2f6fad,stroke-width:1px
    classDef deploy fill:#d1e7dd,stroke:#2d6a4f,stroke-width:1px
    classDef runtime fill:#ffe5b4,stroke:#b36b00,stroke-width:1px
    classDef code fill:#f3e5f5,stroke:#6a1b9a,stroke-width:1px
    classDef config fill:#f8f9fa,stroke:#343a40,stroke-width:1px
```
