# raonedev/fitness-web-app architecture

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

- Interactive diagram: https://gitdiagram.com/raonedev/fitness-web-app
- Repository: https://github.com/raonedev/fitness-web-app

## Overview

##### Project type and purpose
- This is a single‐page application (SPA) built with React.
- Purpose: A “React Fitness Application” that lets users browse, search, and view exercise details and videos, plus an integrated chatbot powered by a “gemini” utility.

##### File structure
- Top level
- public/: static HTML, manifest, robots.txt
- src/: all application code
- .env, package.json, README.md
- src/ subfolders
- components/: reusable UI pieces (Navbar, HeroBanner, Chatbot, ExerciseCard, etc.)
- pages/: top‐level views (Home, ExercisesPage, ExerciseDetail, VideoPlayerPage)
- utils/: shared logic (fetchData.js for external API calls, gemini.js for chatbot integration)
- No dedicated backend directory—API calls are from the client side.

##### Readme insights
- Confirms it’s a React fitness UI.
- No built-in server or microservices—consumes external data sources.

##### Detail without overthinking
- Break the App into granular pieces: index.html, App.js, each page, each major component
- How data flows in and out of the App boundary
- Architectural elements—even minor ones like the static‐asset layer—to give a full picture

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Boundary
    subgraph "Frontend"
        direction TB

        %% Browser and Bootstrap
        Browser["Browser / public/index.html"]:::frontend
        ReactRoot["React Root / src/index.js"]:::frontend
        AppShell["App Shell (App.js, App.css)"]:::frontend

        Browser -->|loads HTML| ReactRoot
        ReactRoot -->|renders| AppShell

        %% UI Layer
        subgraph "UI Layer"
            direction TB
            subgraph "Pages"
                direction TB
                Home["Home Page"]:::frontend
                ExercisesPage["Exercises Listing Page"]:::frontend
                ExerciseDetail["Exercise Detail Page"]:::frontend
                VideoPlayerPage["Video Player Page"]:::frontend
            end
            AppShell -->|"routes to"| Home
            AppShell -->|"routes to"| ExercisesPage
            AppShell -->|"routes to"| ExerciseDetail
            AppShell -->|"routes to"| VideoPlayerPage

            subgraph "Reusable Components"
                direction TB
                Navbar["Navbar"]:::frontend
                HeroBanner["Hero Banner"]:::frontend
                Chatbot["Chatbot"]:::frontend
                ExerciseCard["Exercise Card"]:::frontend
                ExerciseCardYt["YouTube Exercise Card"]:::frontend
                ExerciseVideos["Exercise Videos List"]:::frontend
                SearchExercises["Search Exercises Input"]:::frontend
                SimilarExercises["Similar Exercises Section"]:::frontend
                BodyPart["Body Part Selector"]:::frontend
                HorizontalScrollbar["Horizontal Scrollbar"]:::frontend
                Loader["Loader/Spinner"]:::frontend
                Detail["Detail Layout"]:::frontend
                ExercisesLayout["Exercises Layout"]:::frontend
                Footer["Footer"]:::frontend
            end

            Home --> Navbar
            Home --> HeroBanner
            Home --> SearchExercises
            Home --> ExercisesLayout
            Home --> Footer

            ExercisesPage --> Navbar
            ExercisesPage --> SearchExercises
            ExercisesPage --> BodyPart
            ExercisesPage --> HorizontalScrollbar
            ExercisesPage --> ExercisesLayout
            ExercisesPage --> Footer

            ExerciseDetail --> Navbar
            ExerciseDetail --> Detail
            ExerciseDetail --> SimilarExercises
            ExerciseDetail --> Footer

            VideoPlayerPage --> Navbar
            VideoPlayerPage --> ExerciseVideos
            VideoPlayerPage --> ExerciseCardYt
            VideoPlayerPage --> Footer

            %% Data calls from components
            ExerciseCard --> fetchData
            ExerciseCardYt --> fetchData
            ExerciseVideos --> fetchData
            SearchExercises --> fetchData
            SimilarExercises --> fetchData
            Chatbot --> geminiUtil
        end

        %% Data Layer
        subgraph "Data Layer"
            direction TB
            fetchData["fetchData Utility"]:::util
            geminiUtil["gemini Utility"]:::util
        end

        %% Static Assets
        subgraph "Static Assets"
            direction TB
            ExerciseJSON["exercise.json"]:::static
            Icons["Icons Folder"]:::static
            Images["Images Folder"]:::static
            PublicStatic["public manifest, robots.txt"]:::static
        end

        %% External APIs
        subgraph "External APIs"
            direction TB
            YouTubeAPI["YouTube Data API"]:::external
            FitnessAPI["Fitness Info API"]:::external
            GeminiAI["Gemini AI API"]:::external
        end

        %% Data flow
        fetchData -->|HTTP GET| YouTubeAPI
        fetchData -->|HTTP GET| FitnessAPI
        geminiUtil -->|AI query/response| GeminiAI

        %% Components access static
        ExerciseJSON -->|import| ExerciseCard
        ExerciseJSON -->|import| ExercisesLayout
        Icons -->|assets| Navbar
        Icons -->|assets| Footer
        Images -->|assets| HeroBanner

    end

    %% Click Events
    click Browser "https://github.com/raonedev/fitness-web-app/blob/main/public/index.html"
    click ReactRoot "https://github.com/raonedev/fitness-web-app/blob/main/src/index.js"
    click AppShell "https://github.com/raonedev/fitness-web-app/blob/main/src/App.js"
    click AppShell "https://github.com/raonedev/fitness-web-app/blob/main/src/App.css"
    click Home "https://github.com/raonedev/fitness-web-app/blob/main/src/pages/Home.js"
    click ExercisesPage "https://github.com/raonedev/fitness-web-app/blob/main/src/pages/ExercisesPage.js"
    click ExerciseDetail "https://github.com/raonedev/fitness-web-app/blob/main/src/pages/ExerciseDetail.js"
    click VideoPlayerPage "https://github.com/raonedev/fitness-web-app/blob/main/src/pages/VideoPlayerPage.js"
    click Navbar "https://github.com/raonedev/fitness-web-app/blob/main/src/components/Navbar.js"
    click HeroBanner "https://github.com/raonedev/fitness-web-app/blob/main/src/components/HeroBanner.js"
    click Chatbot "https://github.com/raonedev/fitness-web-app/blob/main/src/components/Chatbot.js"
    click ExerciseCard "https://github.com/raonedev/fitness-web-app/blob/main/src/components/ExerciseCard.js"
    click ExerciseCardYt "https://github.com/raonedev/fitness-web-app/blob/main/src/components/ExerciseCardYt.js"
    click ExerciseVideos "https://github.com/raonedev/fitness-web-app/blob/main/src/components/ExerciseVideos.js"
    click SearchExercises "https://github.com/raonedev/fitness-web-app/blob/main/src/components/SearchExercises.js"
    click SimilarExercises "https://github.com/raonedev/fitness-web-app/blob/main/src/components/SimilarExercises.js"
    click BodyPart "https://github.com/raonedev/fitness-web-app/blob/main/src/components/BodyPart.js"
    click HorizontalScrollbar "https://github.com/raonedev/fitness-web-app/blob/main/src/components/HorizontalScrollbar.js"
    click Loader "https://github.com/raonedev/fitness-web-app/blob/main/src/components/Loader.js"
    click Detail "https://github.com/raonedev/fitness-web-app/blob/main/src/components/Detail.js"
    click ExercisesLayout "https://github.com/raonedev/fitness-web-app/blob/main/src/components/Exercises.js"
    click Footer "https://github.com/raonedev/fitness-web-app/blob/main/src/components/Footer.js"
    click fetchData "https://github.com/raonedev/fitness-web-app/blob/main/src/utils/fetchData.js"
    click geminiUtil "https://github.com/raonedev/fitness-web-app/blob/main/src/utils/gemini.js"
    click ExerciseJSON "https://github.com/raonedev/fitness-web-app/blob/main/src/assets/exercises/exercise.json"
    click Icons "https://github.com/raonedev/fitness-web-app/tree/main/src/assets/icons/"
    click Images "https://github.com/raonedev/fitness-web-app/tree/main/src/assets/images/"
    click PublicStatic "https://github.com/raonedev/fitness-web-app/blob/main/public/manifest.json"
    click PublicStatic "https://github.com/raonedev/fitness-web-app/blob/main/public/robots.txt"

    %% Styles
    classDef frontend fill:#D6EAF8,stroke:#1B4F72,stroke-width:1px
    classDef util fill:#D5F5E3,stroke:#145A32,stroke-width:1px
    classDef external fill:#FCF3CF,stroke:#B9770E,stroke-width:1px
    classDef static fill:#E5E8E8,stroke:#566573,stroke-width:1px
```
