# brajeshkumar87096/gurukul-maths-classes-hub architecture

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

- Interactive diagram: https://gitdiagram.com/brajeshkumar87096/gurukul-maths-classes-hub
- Repository: https://github.com/brajeshkumar87096/gurukul-maths-classes-hub

## Overview

##### Project type and purpose
- This is a front-end SPA (single-page application) scaffolded with Vite and TypeScript, using React and Tailwind CSS (via shadcn-ui).
- There is no custom back-end code here; API calls (e.g., auth, data fetching) would go to external services (not shown in this repo).

##### Main components
a. Developer Environment
- IDE / GitHub / Codespaces
- Node.js & npm/Yarn
- Vite Dev Server
b. Source Code Modules
- Pages layer (src/pages)
- Feature components (src/components/home, src/components/auth, src/components/layout, src/components/shared)
- UI primitives library (src/components/ui)
- Hooks (src/hooks) and Utilities (src/lib)
- Static assets (public/ and standalone/)
c. Build & Deployment
- Vite bundler → dist/
- Tailwind CSS processing (tailwind.config.ts)
- Deployment via Lovable platform (publishes to CDN)
d. Runtime Environment
- Browser executing the static bundle
- Optional: external APIs (authentication, data services)

##### Relationships & Interactions
- Developer pushes code to GitHub → Lovable detects push → runs build (npm run build) → deploys bundled static assets to CDN.
- In development: IDE → npm run dev → Vite serves code on localhost → browser hot-reloads.
- At runtime: Browser requests index.html from CDN → loads JS/CSS bundles → React Router loads pages → components render → hooks/utilities handle UI logic → (when needed) API calls go to external endpoints.

##### Architectural patterns & design principles
- Component-based decomposition:
- “UI primitives” (buttons, inputs, dialogs) are abstracted under src/components/ui.
- “Feature modules” (Auth, Home, Shared, Layout) assemble primitives into pages.
- Separation of concerns between routing (src/main.tsx → React Router), styling (Tailwind + PostCSS), and business logic (hooks + lib/utils).
- Code-split pages automatically via Vite/Rollup for optimized bundle sizes.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Environment
    subgraph "Developer Environment"
        IDE["IDE / Codespaces"]:::devTools
        GitHub["GitHub"]:::devTools
        Node["Node.js & npm/Yarn"]:::devTools
    end

    IDE -->|"edit & commit"| GitHub
    IDE -->|"run"| Node

    %% Source Code
    subgraph "Source Code" 
        direction TB
        Config["Project Configuration"]:::code
        subgraph "Pages Layer" 
            direction TB
            Pages["src/pages"]:::code
        end
        subgraph "Feature Components"
            direction TB
            Auth["src/components/auth"]:::code
            Home["src/components/home"]:::code
            Layout["src/components/layout"]:::code
            Shared["src/components/shared"]:::code
        end
        UI["src/components/ui"]:::code
        Hooks["src/hooks"]:::code
        Utils["src/lib/utils.ts"]:::code
        subgraph "Static Assets"
            direction TB
            Public["public/"]:::code
            Standalone["standalone/assets"]:::code
        end
        Entry["src/main.tsx"]:::code
        AppRoot["src/App.tsx"]:::code
        IndexCSS["src/index.css"]:::code
        EnvDefs["src/vite-env.d.ts"]:::code
        HTML["index.html"]:::code
    end

    GitHub -->|"clone/pull"| Config
    GitHub --> Pages
    GitHub --> Auth
    GitHub --> Home
    GitHub --> Layout
    GitHub --> Shared
    GitHub --> UI
    GitHub --> Hooks
    GitHub --> Utils
    GitHub --> Public
    GitHub --> Standalone
    GitHub --> Entry
    GitHub --> AppRoot
    GitHub --> IndexCSS
    GitHub --> EnvDefs
    GitHub --> HTML

    %% Build & Development Flow
    Node -->|"npm run dev"| ViteDev
    Node -->|"npm run build"| ViteBuild

    subgraph "Build System"
        direction TB
        ViteDev["Vite Dev Server"]:::build
        ViteBuild["Vite Bundler (vite.config.ts)"]:::build
        Tailwind["Tailwind Processor (tailwind.config.ts)"]:::build
        PostCSS["PostCSS Config (postcss.config.js)"]:::build
        Dist["dist/"]:::build
    end

    Config --> ViteDev
    Entry --> ViteDev
    AppRoot --> ViteDev
    IndexCSS --> Tailwind
    Tailwind --> ViteBuild
    PostCSS --> ViteBuild
    ViteBuild --> Dist

    %% Deployment
    Dist -->|"deploy"| Lovable
    subgraph "Deployment"
        Lovable["Lovable Platform"]:::external
        CDN["Lovable CDN"]:::external
    end
    Lovable --> CDN

    %% Runtime Environment
    subgraph "Runtime Environment"
        Browser["Browser"]:::runtime
        Router["React Router"]:::runtime
    end

    Browser -->|"HTTP GET index.html"| CDN
    Browser -->|"load bundles"| CDN
    CDN --> Router
    Router --> Pages
    Router --> Auth
    Router --> Home
    Router --> Layout
    Router --> Shared

    Router --> UI
    UI --> Hooks
    Hooks --> Utils

    Browser -->|"fetch /auth, /data"| APIAuth
    Browser -->|"fetch /data"| APIData

    subgraph "External Services"
        APIAuth["Auth API"]:::external
        APIData["Data API"]:::external
    end

    %% Click Events
    click Pages "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/tree/main/src/pages"
    click Auth "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/tree/main/src/components/auth"
    click Home "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/tree/main/src/components/home"
    click Layout "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/tree/main/src/components/layout"
    click Shared "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/tree/main/src/components/shared"
    click UI "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/tree/main/src/components/ui"
    click Hooks "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/tree/main/src/hooks"
    click Utils "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/blob/main/src/lib/utils.ts"
    click Public "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/tree/main/public/"
    click Standalone "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/tree/main/standalone/assets"
    click ViteBuild "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/blob/main/vite.config.ts"
    click Tailwind "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/blob/main/tailwind.config.ts"
    click PostCSS "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/blob/main/postcss.config.js"
    click Entry "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/blob/main/src/main.tsx"
    click HTML "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/blob/main/index.html"
    click AppRoot "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/blob/main/src/App.tsx"
    click IndexCSS "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/blob/main/src/index.css"
    click EnvDefs "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/blob/main/src/vite-env.d.ts"
    click Config "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/blob/main/package.json"
    click Config "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/blob/main/package-lock.json"
    click Config "https://github.com/brajeshkumar87096/gurukul-maths-classes-hub/blob/main/bun.lockb"

    %% Styles
    classDef devTools fill:#BBEFFF,stroke:#3182CE,color:#1A202C
    classDef code fill:#FEEBC8,stroke:#DD6B20,color:#1A202C
    classDef build fill:#C6F6D5,stroke:#38A169,color:#1A202C
    classDef runtime fill:#FED7D7,stroke:#E53E3E,color:#1A202C
    classDef external fill:#E2E8F0,stroke:#718096,color:#1A202C
```
