# letsmakeindiagrow/investor-dashboard-awm architecture

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

- Interactive diagram: https://gitdiagram.com/letsmakeindiagrow/investor-dashboard-awm
- Repository: https://github.com/letsmakeindiagrow/investor-dashboard-awm

## Overview

##### Project Type & Purpose
- This is a front-end Single-Page Application (SPA) built with React, TypeScript, Vite, Tailwind CSS, and a small custom UI component library.
- It provides a dashboard interface with pages like Funds, Investments, Ledger, and Referral, uses client-side routing, and communicates with external APIs (not included in this codebase).

##### File-Structure Analysis
- Root configs & tooling:
– Vite (vite.config.ts), ESLint (eslint.config.js), PostCSS & Tailwind (postcss.config.js, tailwind.config.js), TS (tsconfig.*.json).
– package.json (+ lock), .env, .npmrc, vercel.json for deployment.
- Entry points:
– index.html → src/main.tsx → src/App.tsx → src/router.tsx.
- Core application:
– src/pages: top-level routed views (Funds, Investments, Ledger, Referral).
– src/components: layout and feature components (Dashboard, Sidebar, Topbar).
– src/components/ui: atomic UI primitives (buttons, inputs, dialogs, toasts, etc.).
– src/hooks (use-toast) and src/lib/utils.ts for shared logic or API wrappers.
– src/assets / public for static assets.

##### README Insights
- Emphasizes minimal React+TS setup in Vite with HMR and ESLint rules.
- Mentions official Vite plugins for React Fast Refresh.
- No built-in backend—this is purely the static/front-end layer.

1. Developer Machine & Dev Toolchain
– Node.js + npm / pnpm, Vite Dev Server (HMR).
2. CI/CD & Hosting
– Git → Vercel (or equivalent) → CDN / Static File Host.
3. Client in Production
– Browser loads index.html + bundled JS/CSS from CDN.
– Runtime: React App (main.tsx → App.tsx) with Router.
4. Application Layers
– Routing Layer (src/router.tsx) → Page Components (Funds, Investments, etc.).
– Layout Components (Sidebar, Topbar, Dashboard wrapper).
– UI Library (atomic components under src/components/ui).
5. Data & Logic
– Hooks (use-toast), Utilities (src/lib/utils.ts) calling external REST/GraphQL APIs.
6. External Dependencies
– Third-party APIs or microservices (authentication, data backends).

b. Relationships & Data Flow
- Browser → static assets (JS/CSS) fetched from CDN.
- App bootstraps → Router dispatches to a Page.
- Page renders layout + UI components → user events (click, form submit).
- Event handlers invoke Hooks/Utils → HTTP requests → external APIs.
- API responses → update component state → re-render UI → optional toasts.

c. Architectural Patterns
- Component-Based (React) with Atomic Design for UI.
- Client-Side Routing (SPA).
- Separation of Concerns: Layout vs. Pages vs. Atoms.
- Build Pipeline: Vite for bundling, Tailwind for styling, ESLint for linting.

d. Key Technologies to annotate
- Vite (+ @vitejs/plugin-react)
- React 18 + TypeScript
- Tailwind CSS & PostCSS
- ESLint + prettier (if configured)
- Vercel (deployment) / CDN

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Development Environment
    subgraph "Development Environment" 
        direction TB
        DevMachine["Developer Machine"]:::dev
        NodeNpm["Node.js + npm/pnpm"]:::dev
        DevMachine --> NodeNpm
        NodeNpm --> ViteDev["Vite Dev Server (HMR)"]:::dev
        subgraph "Configurations"
            direction TB
            ViteConfig["vite.config.ts"]:::config
            ESLintConfig["eslint.config.js"]:::config
            TailwindConfig["tailwind.config.js"]:::config
            PostCSSConfig["postcss.config.js"]:::config
            TSConfig["tsconfig.json / tsconfig.app.json / tsconfig.node.json"]:::config
            NPMEnv["package.json / package-lock.json / .npmrc / .env"]:::config
            DeployConfig["vercel.json"]:::config
        end
        ViteConfig --> ViteDev
        ESLintConfig --> DevMachine
        TailwindConfig --> ViteDev
        PostCSSConfig --> ViteDev
        TSConfig --> ViteDev
        NPMEnv --> NodeNpm
        DeployConfig --> NodeNpm
    end

    %% CI/CD & Hosting
    subgraph "CI/CD & Hosting"
        direction TB
        Git["Git Repo"]:::ci
        Vercel["Vercel Deployment"]:::ci
        CDN["CDN / Static File Host"]:::ci
        Git --> Vercel
        Vercel --> CDN
    end

    %% Production Client
    subgraph "Production Client"
        direction TB
        Browser["Browser"]:::run
        CDN --> Browser
    end

    %% App Bootstrap
    subgraph "App Bootstrap"
        direction TB
        HTML["index.html"]:::app
        MainTS["src/main.tsx"]:::app
        AppComp["src/App.tsx"]:::app
        HTML --> MainTS
        MainTS --> AppComp
    end
    Browser --> HTML

    %% Routing Layer
    subgraph "Routing Layer"
        direction TB
        Router["src/router.tsx"]:::app
        Router --> FundsPage["src/pages/Funds.tsx"]:::pages
        Router --> InvestmentsPage["src/pages/Investments.tsx"]:::pages
        Router --> LedgerPage["src/pages/Ledger.tsx"]:::pages
        Router --> ReferralPage["src/pages/Referral.tsx"]:::pages
        AppComp --> Router
    end

    %% Layout & UI Components
    subgraph "Layout & UI"
        direction TB
        LayoutWrapper["src/components/Dashboard.tsx"]:::layout
        Sidebar["src/components/Sidebar.tsx"]:::layout
        Topbar["src/components/Topbar.tsx"]:::layout
        UILib["src/components/ui/*.tsx"]:::ui
        LayoutWrapper --> Sidebar
        LayoutWrapper --> Topbar
        LayoutWrapper --> UILib
        FundsPage --> LayoutWrapper
        InvestmentsPage --> LayoutWrapper
        LedgerPage --> LayoutWrapper
        ReferralPage --> LayoutWrapper
    end

    %% Logic & Data
    subgraph "Logic & Data"
        direction TB
        ToastHook["src/hooks/use-toast.ts"]:::logic
        Utils["src/lib/utils.ts"]:::logic
        ToastHook --> Utils
        UILib --> ToastHook
        Utils --> ExternalAPI
    end

    %% Assets & Styles
    subgraph "Assets & Styles"
        direction TB
        Styles["src/index.css"]:::assets
        AssetsDir["src/assets/"]:::assets
        HTML --> Styles
        HTML --> AssetsDir
    end

    %% External Services
    ExternalAPI["External APIs (Auth, Data)"]:::external

    %% Data Flow
    Browser --> AppComp
    AppComp --> Router
    UIEvents["User Events (click, submit)"]:::run
    UIEvents --> UILib
    UILib --> ToastHook
    ToastHook --> Utils
    Utils -->|HTTP Requests| ExternalAPI
    ExternalAPI -->|Responses| UILib

    %% Click Events
    click ViteConfig "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/vite.config.ts"
    click ESLintConfig "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/eslint.config.js"
    click TailwindConfig "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/tailwind.config.js"
    click PostCSSConfig "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/postcss.config.js"
    click TSConfig "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/tsconfig.json"
    click TSConfig "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/tsconfig.app.json"
    click TSConfig "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/tsconfig.node.json"
    click NPMEnv "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/package.json"
    click NPMEnv "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/package-lock.json"
    click NPMEnv "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/.npmrc"
    click NPMEnv "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/.env"
    click DeployConfig "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/vercel.json"
    click HTML "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/index.html"
    click MainTS "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/src/main.tsx"
    click AppComp "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/src/App.tsx"
    click Router "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/src/router.tsx"
    click FundsPage "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/src/pages/Funds.tsx"
    click InvestmentsPage "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/src/pages/Investments.tsx"
    click LedgerPage "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/src/pages/Ledger.tsx"
    click ReferralPage "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/src/pages/Referral.tsx"
    click LayoutWrapper "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/src/components/Dashboard.tsx"
    click Sidebar "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/src/components/Sidebar.tsx"
    click Topbar "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/src/components/Topbar.tsx"
    click UILib "https://github.com/letsmakeindiagrow/investor-dashboard-awm/tree/main/src/components/ui/"
    click ToastHook "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/src/hooks/use-toast.ts"
    click Utils "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/src/lib/utils.ts"
    click Styles "https://github.com/letsmakeindiagrow/investor-dashboard-awm/blob/main/src/index.css"
    click AssetsDir "https://github.com/letsmakeindiagrow/investor-dashboard-awm/tree/main/src/assets/"

    %% Styles
    classDef dev fill:#ffe4e1,stroke:#333,stroke-width:1px
    classDef config fill:#fff0f5,stroke:#333,stroke-width:1px
    classDef ci fill:#e6e6fa,stroke:#333,stroke-width:1px
    classDef run fill:#e0ffff,stroke:#333,stroke-width:1px
    classDef app fill:#fafad2,stroke:#333,stroke-width:1px
    classDef pages fill:#f0fff0,stroke:#333,stroke-width:1px
    classDef layout fill:#ffe4b5,stroke:#333,stroke-width:1px
    classDef ui fill:#d3ffce,stroke:#333,stroke-width:1px
    classDef logic fill:#f5deb3,stroke:#333,stroke-width:1px
    classDef assets fill:#f0f8ff,stroke:#333,stroke-width:1px
    classDef external fill:#fffacd,stroke:#333,stroke-width:1px
```
