# gokulsathish2016-debug/odisha-helth-saathi architecture

> Architecture diagram of the GitHub repository gokulsathish2016-debug/odisha-helth-saathi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gokulsathish2016-debug/odisha-helth-saathi
- Repository: https://github.com/gokulsathish2016-debug/odisha-helth-saathi

## Overview

##### Project type and purpose
- From the README and file tree, this is a React + TypeScript single‐page application (SPA) built with Vite, Tailwind CSS, and shadcn-ui.
- It provides a conversational “Lovable” health assistant interface (“ChatInterface”, “VoiceInterface”) with district selection, health alerts/patterns, emergency contacts, language selection, and memory of past health queries.

##### File structure
- Top-level:
- public/ – static assets (robots.txt, index.html)
- src/ – main source folder
· components/ – all UI components
· ui/ – shadcn-ui primitives (buttons, dialogs, tables, etc.)
· feature components (ChatInterface.tsx, VoiceInterface.tsx, DistrictSelector.tsx, etc.)
· hooks/ – custom React hooks (use-mobile, use-toast)
· services/ – business logic & API wrappers (geminiService, healthMemoryService, voiceService)
· lib/ – shared utility code (utils.ts)
· pages/ – route targets (Index.tsx, NotFound.tsx)
· main.tsx, App.tsx – top-level bootstrap & routing
- Config files: vite.config.ts, tsconfig*.json, tailwind.config.ts, eslint.config.js.

##### README for additional insights
- No backend is present; all logic runs in-browser or calls external services.
- Deployment is handled by Lovable (static site hosting).
- External dependencies: Node.js, npm, Vite, and Lovable’s publish pipeline.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User Interaction
    User["User"]:::external
    User -->|"interacts via clicks/voice"| Browser["Browser / React SPA"]:::browser

    subgraph "Browser / React SPA"
        direction TB
        subgraph "UI Layer"
            direction TB
            Home["Home Page<br/>(Index.tsx)"]:::ui
            NotFound["404 Page<br/>(NotFound.tsx)"]:::ui
            Chat["Chat Interface"]:::ui
            Voice["Voice Interface"]:::ui
            District["District Selector"]:::ui
            Alerts["Health Alerts"]:::ui
            Patterns["Health Patterns"]:::ui
            Emergency["Emergency Contacts"]:::ui
            Language["Language Selector"]:::ui
            UIPrimitives["shadcn-ui Primitives"]:::ui
        end

        subgraph "Hooks & Services"
            direction TB
            UseMobile["use-mobile Hook"]:::service
            UseToast["use-toast Hook"]:::service
            GeminiService["Gemini AI Service"]:::service
            VoiceService["Voice Service"]:::service
            MemoryService["Health Memory Service"]:::service
            Utils["Shared Utilities"]:::service
            Storage[(localStorage / IndexedDB)]:::storage
        end

        subgraph "Styling & Config"
            direction TB
            GlobalCSS["Global CSS"]:::config
            Tailwind["Tailwind Config"]:::config
            TSDecl["TS Declarations"]:::config
            ViteConfig["Vite Config"]:::config
        end

        %% Internal flows
        Browser -->|"renders"| Home
        Browser -->|"renders"| NotFound
        Home --> Chat
        Home --> Voice
        Home --> District
        Home --> Alerts
        Home --> Patterns
        Home --> Emergency
        Home --> Language
        Home --> UIPrimitives

        Chat -->|uses| UseToast
        Voice -->|uses| UseMobile
        District -->|uses| UseMobile
        Alerts -->|uses| UseToast
        Patterns -->|uses| UseToast
        Emergency -->|uses| UseToast
        Language -->|uses| UseToast

        Chat -->|calls| GeminiService
        Chat -->|calls| MemoryService
        Voice -->|calls| VoiceService
        MemoryService -->|reads/writes| Storage

        UseMobile --> Utils
        UseToast --> Utils
    end

    subgraph "External Services"
        direction TB
        GeminiAPI["Gemini AI API"]:::external
        SpeechAPI["Web Speech / Voice API"]:::external
    end

    subgraph "Hosting & Build"
        direction TB
        Vite["Vite Dev/Build Server"]:::build
        Lovable["Lovable CDN Hosting"]:::build
    end

    %% External flows
    GeminiService -->|"HTTP request"| GeminiAPI
    VoiceService -->|"Speech stream"| SpeechAPI
    Vite -->|"bundles assets"| Lovable

    %% Click Events
    click Browser "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/main.tsx"
    click Browser "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/App.tsx"
    click Home "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/pages/Index.tsx"
    click NotFound "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/pages/NotFound.tsx"
    click Chat "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/components/ChatInterface.tsx"
    click Voice "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/components/VoiceInterface.tsx"
    click District "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/components/DistrictSelector.tsx"
    click Alerts "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/components/HealthAlerts.tsx"
    click Patterns "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/components/HealthPatterns.tsx"
    click Emergency "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/components/EmergencyContacts.tsx"
    click Language "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/components/LanguageSelector.tsx"
    click UIPrimitives "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/tree/main/src/components/ui/"
    click UseMobile "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/hooks/use-mobile.tsx"
    click UseToast "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/hooks/use-toast.ts"
    click GeminiService "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/services/geminiService.ts"
    click VoiceService "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/services/voiceService.ts"
    click MemoryService "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/services/healthMemoryService.ts"
    click Utils "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/lib/utils.ts"
    click Storage "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/public/robots.txt"
    click GlobalCSS "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/index.css"
    click Tailwind "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/tailwind.config.ts"
    click ViteConfig "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/vite.config.ts"
    click TSDecl "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/src/vite-env.d.ts"
    click Browser "https://github.com/gokulsathish2016-debug/odisha-helth-saathi/blob/main/index.html"

    %% Styles
    classDef ui fill:#D0E8FF,stroke:#0366d6,color:#000
    classDef service fill:#E6F4EA,stroke:#22863a,color:#000
    classDef external fill:#FFEFD5,stroke:#d73a49,color:#000
    classDef build fill:#F6F8FA,stroke:#6a737d,color:#000
    classDef browser fill:#FFF5E6,stroke:#DBAB09,color:#000
    classDef config fill:#F0F0F0,stroke:#999,color:#000
    classDef storage fill:#FFF0F5,stroke:#c61a1a,color:#000
```
