# shakthi-balan/evolve-fitness-feed architecture

> Architecture diagram of the GitHub repository shakthi-balan/evolve-fitness-feed, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shakthi-balan/evolve-fitness-feed
- Repository: https://github.com/shakthi-balan/evolve-fitness-feed

## Overview

##### Project type and purpose
- This is a front-end single-page application built with React (TypeScript) and Vite.
- It uses Tailwind CSS for styling and shadcn-ui as a component library.
- There is no custom backend in the repo; any data (auth, chatbot, calorie/sleep tracking, leaderboard) would be handled by external APIs or services.

##### File structure
- Root files: package.json, tsconfig.json, Vite and Tailwind configs → build and tooling configuration.
- public/ → static assets (robots.txt, index.html).
- src/
- main.tsx + index.html → application entry point.
- App.tsx + src/pages/ → page-level routing (Index, NotFound).
- src/components/ → feature components (AuthPage, ChatBot, Dashboard, CalorieTracker, SleepTracker, Leaderboard, ProgressFeed, BottomNavigation).
- src/components/ui/ → shadcn UI primitives and themed wrappers.
- src/hooks/ → custom hooks (useMobile, useToast).
- src/lib/ → shared utilities (utils.ts).

##### README for additional insights
- Confirms tech stack: Vite, TypeScript, React, shadcn-ui, Tailwind CSS.
- Deployment via “Lovable” static-hosting service.
- Suggests the app is meant to be edited and published as a static site.

##### Main components
a. Developer Environment
- Node.js + npm, Vite dev server.
b. Source Code
- React + TypeScript codebase (src/, public/, config files).
c. Build Pipeline
- Vite bundler compiles TSX, processes Tailwind CSS, outputs optimized static assets (dist/).
d. Static Hosting / CDN
- Lovable’s hosting service (or any CDN like Netlify/Vercel) serves index.html, JS/CSS, assets.
e. Client (Browser)
- Loads the SPA, hydrates React components, handles routing & UI.
f. External Services (optional)
- Auth provider (OAuth/JWT), Chat API (OpenAI or custom), Data storage or REST/GraphQL endpoints for calorie/sleep/leaderboard data.

##### Relationships and interactions
- Developer → (npm run dev) → Vite Dev Server → Browser (live reload).
- Developer → (npm run build) → Vite → Build Artifacts → Static Hosting → CDN.
- Browser ↔ Static Assets (JS/CSS).
- Browser ↔ External Services via HTTP(S) calls.

##### Architectural patterns and design principles
- Component-based architecture: feature components + UI primitives library.
- Separation of concerns: UI components (shadcn/ui), business logic (hooks/lib), pages for routing.
- Static single-page architecture with external API integration.

##### Essential elements
- Labels for each component and folder group
- Notes about key technologies (React, Vite, Tailwind CSS, shadcn-ui)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Environment
    Dev["Developer Environment\n(Node.js, npm)"]:::dev

    subgraph "Tooling Configuration"
        pkg["package.json"]:::source
        vitecfg["vite.config.ts"]:::source
        tsconfig["tsconfig.json"]:::source
        tsapp["tsconfig.app.json"]:::source
        tsnode["tsconfig.node.json"]:::source
        postcss["postcss.config.js"]:::source
        tailwindcfg["tailwind.config.ts"]:::source
        eslintcfg["eslint.config.js"]:::source
    end

    %% Source Code
    subgraph "Source Code"
        subgraph Public
            pub_index["index.html"]:::source
            robots["robots.txt"]:::source
        end
        subgraph Entry
            main["src/main.tsx"]:::source
        end
        subgraph "Core App"
            app["src/App.tsx"]:::source
            appcss["src/App.css"]:::source
        end
        subgraph Pages
            page1["src/pages/Index.tsx"]:::source
            page2["src/pages/NotFound.tsx"]:::source
        end
        subgraph Components
            auth["src/components/AuthPage.tsx"]:::source
            chat["src/components/ChatBot.tsx"]:::source
            calorie["src/components/CalorieTracker.tsx"]:::source
            sleep["src/components/SleepTracker.tsx"]:::source
            dash["src/components/Dashboard.tsx"]:::source
            leader["src/components/Leaderboard.tsx"]:::source
            progress["src/components/ProgressFeed.tsx"]:::source
            bottom["src/components/BottomNavigation.tsx"]:::source
        end
        subgraph "UI Primitives"
            ui1["src/components/ui/accordion.tsx"]:::source
            ui2["src/components/ui/button.tsx"]:::source
            ui3["src/components/ui/card.tsx"]:::source
            uiMore["...other ui files"]:::source
        end
        subgraph "Hooks & Utils"
            hook1["src/hooks/use-mobile.tsx"]:::source
            hook2["src/hooks/use-toast.ts"]:::source
            util["src/lib/utils.ts"]:::source
        end
    end

    %% Build Pipeline
    subgraph "Build & Deploy"
        ViteDev["Vite Dev Server"]:::build
        ViteBuild["Vite Build (dist/)"]:::build
    end

    %% Hosting/CDN
    Hosting["Lovable CDN / Static Hosting"]:::hosting

    %% Client Runtime
    Browser["Browser (Client)"]:::client

    %% External Services
    subgraph "External Services"
        AuthAPI["Auth Provider API"]:::external
        ChatAPI["Chatbot API"]:::external
        DataAPI["Data Storage API"]:::external
    end

    %% Connections
    Dev -->|"npm run dev"| ViteDev
    ViteDev -->|"serves assets"| Browser
    Dev -->|"npm run build"| ViteBuild
    ViteBuild -->|"deploy static files"| Hosting
    Hosting -->|"serves assets"| Browser
    Browser -->|"HTTP(S) requests"| AuthAPI
    Browser -->|"HTTP(S) requests"| ChatAPI
    Browser -->|"HTTP(S) requests"| DataAPI

    %% Click Events
    click pkg "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/package.json"
    click vitecfg "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/vite.config.ts"
    click tsconfig "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/tsconfig.json"
    click tsapp "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/tsconfig.app.json"
    click tsnode "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/tsconfig.node.json"
    click postcss "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/postcss.config.js"
    click tailwindcfg "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/tailwind.config.ts"
    click eslintcfg "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/eslint.config.js"
    click pub_index "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/public/index.html"
    click robots "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/public/robots.txt"
    click main "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/main.tsx"
    click app "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/App.tsx"
    click appcss "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/App.css"
    click page1 "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/pages/Index.tsx"
    click page2 "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/pages/NotFound.tsx"
    click auth "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/components/AuthPage.tsx"
    click chat "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/components/ChatBot.tsx"
    click calorie "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/components/CalorieTracker.tsx"
    click sleep "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/components/SleepTracker.tsx"
    click dash "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/components/Dashboard.tsx"
    click leader "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/components/Leaderboard.tsx"
    click progress "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/components/ProgressFeed.tsx"
    click bottom "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/components/BottomNavigation.tsx"
    click ui1 "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/components/ui/accordion.tsx"
    click ui2 "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/components/ui/button.tsx"
    click ui3 "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/components/ui/card.tsx"
    click hook1 "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/hooks/use-mobile.tsx"
    click hook2 "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/hooks/use-toast.ts"
    click util "https://github.com/shakthi-balan/evolve-fitness-feed/blob/main/src/lib/utils.ts"

    %% Styles
    classDef dev fill:#cccccc,stroke:#333,stroke-width:1px;
    classDef source fill:#cce5ff,stroke:#1e70bf,stroke-width:1px;
    classDef build fill:#d4edda,stroke:#22863a,stroke-width:1px;
    classDef hosting fill:#fff3cd,stroke:#bf8b00,stroke-width:1px;
    classDef client fill:#e2e3e5,stroke:#6c757d,stroke-width:1px;
    classDef external fill:#f5e6ff,stroke:#8c1aff,stroke-width:1px;
```
