# yashksaini-coder/investo-glow architecture

> Architecture diagram of the GitHub repository yashksaini-coder/investo-glow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yashksaini-coder/investo-glow
- Repository: https://github.com/yashksaini-coder/investo-glow

## Overview

##### Main Components
- User Interface: Represented by the frontend layers. This includes high-level pages (like Dashboard, About, Market, Profile, Authentication pages), layout components (Navbar, Footer, Layout), and modular UI elements (button, accordion, dialog, etc.).
- Context Providers and Hooks: These centralize state and behavior (e.g., AuthContext, WatchlistContext, custom hooks for theme and mobile responsiveness).
- Integration Layer: The folder “src/integrations/supabase” shows how the app connects to Supabase (which hosts the PostgreSQL database) — this is your external database/backend service.
- Data and Business Logic: Components in “src/lib” and “src/data” handle application logic and data management.
- Deployment and Configuration: Files like vercel.json, vite.config.ts, postcss.config.js, and environment configurations (.env.example) that set the application environment up.

##### Establish Architectural Relationships and User Flow
- UI & Pages: This includes components, layout, and page routing.
- Context Layer: Which provides global state (auth, watchlist, etc.) to all UI elements.
- Integration Services: A dedicated section for API calls/interfacing with Supabase.
- For strict user flow:
- From “User” to “Authentication & Profile Management”: Indicate login and registration flow (pages under src/pages/auth).
- Next, from Authentication to the “Dashboard/Stock/Market Pages” representing main investment insights. Indicate flows to portfolio and watchlist management which rely on data from Supabase.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Entities
    User["User / Client"]:::user

    %% Frontend Application Subgraph
    subgraph "Frontend Application"
        %% UI & Pages Subgraph
        subgraph "UI & Pages"
            AuthPages["Authentication Pages\n(src/pages/auth)"]:::ui
            MainPages["Main Pages (Dashboard,About,Market,Profile)\n(src/pages)"]:::ui
            Layout["Layout Components\n(src/components/layout)"]:::ui
            UIComponents["Modular UI Elements\n(src/components/ui)"]:::ui
        end
        %% Context Layer Subgraph
        subgraph "Context Layer"
            Context["Auth & Watchlist Context\n(src/contexts)"]:::context
            Hooks["Custom Hooks\n(src/hooks)"]:::context
        end
        %% Integration Services Subgraph
        subgraph "Integration Services"
            Supabase["Supabase Integration\n(src/integrations/supabase)"]:::integration
        end
    end

    %% External Database Service
    SupabaseDB["Supabase (PostgreSQL)"]:::external

    %% Data & Business Logic Subgraph
    subgraph "Data & Business Logic"
        DataTypes["Data & Types\n(src/lib)"]:::data
        DataMgmt["Data Management\n(src/data)"]:::data
    end

    %% Deployment & Configuration Subgraph
    subgraph "Deployment & Configuration"
        Vercel["Vercel Config (vercel.json)"]:::deploy
        Vite["Vite Config (vite.config.ts)"]:::deploy
        PostCSS["PostCSS Config (postcss.config.js)"]:::deploy
        EnvExample[".env Example (.env.example)"]:::deploy
    end

    %% User Flow Connections
    User -->|"initiates"| AuthPages
    AuthPages -->|"login success"| MainPages
    MainPages -->|"renders via"| Layout
    MainPages -->|"renders via"| UIComponents
    MainPages -->|"utilizes"| Context
    MainPages -->|"fetches data"| Supabase
    Context -->|"manages state with"| Hooks
    Supabase -->|"calls"| SupabaseDB
    Context -->|"leverages"| DataTypes
    Supabase -->|"processes data using"| DataMgmt

    %% Additional Utility Flow
    UIComponents -->|"triggers events via"| Hooks
    Layout -->|"reads state from"| Context

    %% Deployment connection (supporting overall system)
    MainPages ---|"deployed using"| Vercel
    MainPages ---|"built with"| Vite
    MainPages ---|"styled via"| PostCSS
    MainPages ---|"env config"| EnvExample

    %% Click Events for Component Mapping
    click AuthPages "https://github.com/yashksaini-coder/investo-glow/tree/main/src/pages/auth"
    click MainPages "https://github.com/yashksaini-coder/investo-glow/tree/main/src/pages"
    click Layout "https://github.com/yashksaini-coder/investo-glow/tree/main/src/components/layout"
    click UIComponents "https://github.com/yashksaini-coder/investo-glow/tree/main/src/components/ui"
    click Context "https://github.com/yashksaini-coder/investo-glow/tree/main/src/contexts"
    click Hooks "https://github.com/yashksaini-coder/investo-glow/tree/main/src/hooks"
    click Supabase "https://github.com/yashksaini-coder/investo-glow/tree/main/src/integrations/supabase"
    click DataTypes "https://github.com/yashksaini-coder/investo-glow/tree/main/src/lib"
    click DataMgmt "https://github.com/yashksaini-coder/investo-glow/tree/main/src/data"
    click Vercel "https://github.com/yashksaini-coder/investo-glow/blob/main/vercel.json"
    click Vite "https://github.com/yashksaini-coder/investo-glow/blob/main/vite.config.ts"
    click PostCSS "https://github.com/yashksaini-coder/investo-glow/blob/main/postcss.config.js"
    click EnvExample "https://github.com/yashksaini-coder/investo-glow/blob/main/.env.example"

    %% Class Definitions for Colors and Styles
    classDef user fill:#d1f7c4,stroke:#333,stroke-width:2px;
    classDef ui fill:#f7d794,stroke:#333,stroke-width:2px;
    classDef context fill:#a2d5f2,stroke:#333,stroke-width:2px;
    classDef integration fill:#f99,stroke:#333,stroke-width:2px;
    classDef external fill:#c2f0c2,stroke:#333,stroke-width:2px;
    classDef data fill:#f4a1d6,stroke:#333,stroke-width:2px;
    classDef deploy fill:#d1c4e9,stroke:#333,stroke-width:2px;
```
