# aditya580/health_care architecture

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

- Interactive diagram: https://gitdiagram.com/aditya580/health_care
- Repository: https://github.com/aditya580/health_care

## Overview

##### Project type and purpose
- MindEase is a Single-Page Web Application (SPA) built in React and Vite, aimed at delivering a rich, interactive mental wellness dashboard. Users engage in activities like breathing exercises, meditation, drawing, games (Tetris), music, stories, and chat consultation via a chatbot interface. Data persistence and analytics are offloaded to Firebase.

##### File structure
- Top-level:
- index.html, vite.config.js, package.json → build & dev configuration
- public/ → static assets (audio, video, images, _redirects)
- src/ → application source code
- src/main.jsx → app bootstrap & router
- src/App.jsx → root component & layout
- src/Component/ → reusable UI components (Navbar, Hero, Activities, ChatBot, Wheel, Footer, etc.)
- src/pages/ → route-driven pages (MovieRecommender, StoriesPage, StoryDetailPage)
- src/templates/ → presentational Card components & styles
- src/hooks/ → custom React hooks (useIsVisible)
- src/firebase/firebase.js → Firebase initialization & API wrappers
- src/games/Tetris/ → standalone game module (components, hooks, styles, helper logic)
- Configuration & linting: eslint.config.js, .gitignore

##### README for additional insights
- Feature emphasis: modular activities dashboard, extensible JSON-driven data (`faqData.json`, `siteData.json`), responsive design.

Top (Client) → Middle (Application Layer) → Bottom (Data & Assets)

a. Main components (vertical layout, top to bottom):
1) Browser / Client Platform
– React app running in user’s browser
– React Router controlling page views
– Static assets fetched from CDN / public folder
2) Application Layer (React Modules)
– Routes & Pages (Movies, Stories, Activities dashboard)
– Core Components (Navbar, Hero, Wheel, ChatBot, MusicPlayer, Tetris module)
– State management via Context (UserContext), custom hooks
– Styling layers: Tailwind CSS, styled-components, custom CSS
3) External Services & Data
– Firebase (Auth, Firestore) – user data, chat logs, progress tracking
– Static Assets Store (public/) – audio, images, videos

b. Relationships & interactions

c. Architectural patterns & design principles
– Single-Page Application with client-side routing (react-router-dom)
– Component-based architecture (logical grouping: Components, Pages, Templates, Games)
– Separation of concerns: UI vs. data layer vs. styling
– JSON-driven extensibility for activities & FAQs
– Hook-based state management and side effects

d. Key technologies & libraries
– React + React Router + Context + Hooks
– Vite (build & hot reload)
– Tailwind CSS & styled-components for styling
– Framer Motion for animations
– Firebase for backend services
– Custom game engine (Tetris) as a self-contained module

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Top Layer: Client
    Client["Client / Browser<br>(SPA Entry - index.html)"]:::ui
    ClientClick([ ]):::ui
    click Client "https://github.com/aditya580/health_care/blob/main/index.html"

    %% Bootstrap & Root
    subgraph "Application Entry"
        direction TB
        MainJS["App Bootstrap & Routing<br>src/main.jsx"]:::logic
        RootComp["Root Component & Layout<br>src/App.jsx"]:::logic
        click MainJS "https://github.com/aditya580/health_care/blob/main/src/main.jsx"
        click RootComp "https://github.com/aditya580/health_care/blob/main/src/App.jsx"
    end

    Client -->|"loads"| MainJS
    MainJS -->|"renders"| RootComp

    %% Application Layer
    subgraph "Application Layer"
        direction TB

        subgraph "Pages / Routes"
            direction TB
            MR["Movie Recommender<br>src/pages/MovieRecommender.jsx"]:::ui
            MGL["Movie Genre List<br>src/pages/MovieGenreList.jsx"]:::ui
            MM["Movie Modal<br>src/pages/MovieModal.jsx"]:::ui
            SP["Stories Page<br>src/pages/StoriesPage.jsx"]:::ui
            SDP["Story Detail Page<br>src/pages/StoryDetailPage.jsx"]:::ui

            click MR "https://github.com/aditya580/health_care/blob/main/src/pages/MovieRecommender.jsx"
            click MGL "https://github.com/aditya580/health_care/blob/main/src/pages/MovieGenreList.jsx"
            click MM "https://github.com/aditya580/health_care/blob/main/src/pages/MovieModal.jsx"
            click SP "https://github.com/aditya580/health_care/blob/main/src/pages/StoriesPage.jsx"
            click SDP "https://github.com/aditya580/health_care/blob/main/src/pages/StoryDetailPage.jsx"
        end

        subgraph "UI Components"
            direction TB
            Navbar["Navbar<br>src/Component/Navbar.jsx"]:::ui
            Hero["Hero Section<br>src/Component/Hero.jsx"]:::ui
            Activities["Activities Dashboard<br>src/Component/Activities.jsx"]:::ui
            ChatBot["ChatBot Interface<br>src/Component/ChatBot.jsx"]:::ui
            ChatBotIcon["ChatBot Icon Trigger<br>src/Component/ChatBotIcon.jsx"]:::ui
            ChatForm["Chat Form<br>src/Component/ChatForm.jsx"]:::ui
            ChatMessage["Chat Message<br>src/Component/ChatMessage.jsx"]:::ui
            Wheel["Interactive Wheel<br>src/Component/Wheel.jsx"]:::ui
            MusicPlayer["Music Player<br>src/Component/MusicPlayer.jsx"]:::ui
            Footer["Footer<br>src/Component/Footer.jsx"]:::ui
            Breathing["Breathing Exercise<br>src/Component/BreathingExercise.jsx"]:::ui
            Meditation["Meditation<br>src/Component/Meditation.jsx"]:::ui
            Draw["Drawing<br>src/Component/Draw.jsx"]:::ui
            DanceParty["Dance Party<br>src/Component/DanceParty.jsx"]:::ui
            Nap["Nap Timer<br>src/Component/Nap.jsx"]:::ui
            Tips["Tips & Tracker<br>src/Component/Tips.jsx"]:::ui
            Tracker["Tracker<br>src/Component/Tracker.jsx"]:::ui
            Card["Generic Card Template<br>src/templates/Card.jsx"]:::ui
            StoryCard["Story Card Template<br>src/templates/StoryCard.jsx"]:::ui

            click Navbar "https://github.com/aditya580/health_care/blob/main/src/Component/Navbar.jsx"
            click Hero "https://github.com/aditya580/health_care/blob/main/src/Component/Hero.jsx"
            click Activities "https://github.com/aditya580/health_care/blob/main/src/Component/Activities.jsx"
            click ChatBot "https://github.com/aditya580/health_care/blob/main/src/Component/ChatBot.jsx"
            click ChatBotIcon "https://github.com/aditya580/health_care/blob/main/src/Component/ChatBotIcon.jsx"
            click ChatForm "https://github.com/aditya580/health_care/blob/main/src/Component/ChatForm.jsx"
            click ChatMessage "https://github.com/aditya580/health_care/blob/main/src/Component/ChatMessage.jsx"
            click Wheel "https://github.com/aditya580/health_care/blob/main/src/Component/Wheel.jsx"
            click MusicPlayer "https://github.com/aditya580/health_care/blob/main/src/Component/MusicPlayer.jsx"
            click Footer "https://github.com/aditya580/health_care/blob/main/src/Component/Footer.jsx"
            click Breathing "https://github.com/aditya580/health_care/blob/main/src/Component/BreathingExercise.jsx"
            click Meditation "https://github.com/aditya580/health_care/blob/main/src/Component/Meditation.jsx"
            click Draw "https://github.com/aditya580/health_care/blob/main/src/Component/Draw.jsx"
            click DanceParty "https://github.com/aditya580/health_care/blob/main/src/Component/DanceParty.jsx"
            click Nap "https://github.com/aditya580/health_care/blob/main/src/Component/Nap.jsx"
            click Tips "https://github.com/aditya580/health_care/blob/main/src/Component/Tips.jsx"
            click Tracker "https://github.com/aditya580/health_care/blob/main/src/Component/Tracker.jsx"
            click Card "https://github.com/aditya580/health_care/blob/main/src/templates/Card.jsx"
            click StoryCard "https://github.com/aditya580/health_care/blob/main/src/templates/StoryCard.jsx"
        end

        subgraph "State Management & Hooks" 
            direction TB
            UserCtx["User Context<br>src/Component/UserContext.jsx"]:::logic
            ScrollTop["Scroll Restoration<br>src/Component/ScrollToTop.jsx"]:::logic
            VisibleHook["useIsVisible Hook<br>src/hooks/useIsVisible.jsx"]:::logic
            useGameStatus["useGameStatus Hook<br>src/games/Tetris/hooks/useGameStatus.js"]:::logic
            useInterval["useInterval Hook<br>src/games/Tetris/hooks/useInterval.js"]:::logic
            usePlayer["usePlayer Hook<br>src/games/Tetris/hooks/usePlayer.js"]:::logic
            useStage["useStage Hook<br>src/games/Tetris/hooks/useStage.js"]:::logic

            click UserCtx "https://github.com/aditya580/health_care/blob/main/src/Component/UserContext.jsx"
            click ScrollTop "https://github.com/aditya580/health_care/blob/main/src/Component/ScrollToTop.jsx"
            click VisibleHook "https://github.com/aditya580/health_care/blob/main/src/hooks/useIsVisible.jsx"
            click useGameStatus "https://github.com/aditya580/health_care/blob/main/src/games/Tetris/hooks/useGameStatus.js"
            click useInterval "https://github.com/aditya580/health_care/blob/main/src/games/Tetris/hooks/useInterval.js"
            click usePlayer "https://github.com/aditya580/health_care/blob/main/src/games/Tetris/hooks/usePlayer.js"
            click useStage "https://github.com/aditya580/health_care/blob/main/src/games/Tetris/hooks/useStage.js"
        end

        subgraph "Tetris Game Module"
            direction TB
            TetrisRoot["Tetris App<br>src/games/Tetris"]:::logic
            click TetrisRoot "https://github.com/aditya580/health_care/tree/main/src/games/Tetris/"

            GameHelper["Game Helper<br>src/games/Tetris/gameHelper.js"]:::logic
            Tetrominos["Tetrominos Defs<br>src/games/Tetris/components/tetrominos.js"]:::logic
            click GameHelper "https://github.com/aditya580/health_care/blob/main/src/games/Tetris/gameHelper.js"
            click Tetrominos "https://github.com/aditya580/health_care/blob/main/src/games/Tetris/components/tetrominos.js"
        end

        RootComp --> MR
        RootComp --> MGL
        RootComp --> SP
        RootComp --> Navbar
        RootComp --> Hero
        RootComp --> Activities
        RootComp --> UserCtx

        MR --> MM
        MR --> Card
        SP --> StoryCard
        Activities --> Breathing
        Activities --> Meditation
        Activities --> Draw
        Activities --> DanceParty
        Activities --> Nap
        Activities --> Tips
        Activities --> Tracker
        Activities --> MusicPlayer
        Activities --> Wheel
        Activities --> ChatBot
        Activities --> TetrisRoot

        ChatBot --> ChatBotIcon
        ChatBot --> ChatForm
        ChatBot --> ChatMessage

        TetrisRoot --> useGameStatus
        TetrisRoot --> useInterval
        TetrisRoot --> usePlayer
        TetrisRoot --> useStage
        TetrisRoot --> GameHelper
        TetrisRoot --> Tetrominos

    end

    %% Bottom Layer: Data & Assets
    subgraph "Backend & Storage"
        direction TB
        Firebase[(Firebase Services)]:::data
        click Firebase "https://github.com/aditya580/health_care/blob/main/src/firebase/firebase.js"
        Assets[/Static Assets Storage/]:::data
        click Assets "https://github.com/aditya580/health_care/tree/main/public/"

    end

    %% Data flows
    Activities -->|"requests assets"| Assets
    MusicPlayer -->|"fetches audio"| Assets
    Hero -->|"loads images"| Assets

    RootComp -->|"API calls"| Firebase
    ChatBot -->|"stores chat logs"| Firebase
    UserCtx -->|"reads/writes user data"| Firebase
    TetrisRoot -->|"saves progress"| Firebase

    %% Styles
    classDef ui fill:#AEDFF7,stroke:#000,color:#000;
    classDef logic fill:#C1E1C1,stroke:#000,color:#000;
    classDef data fill:#FFD59E,stroke:#000,color:#000;
```
