# manikanteshwarareddy/smarthealthquote architecture

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

- Interactive diagram: https://gitdiagram.com/manikanteshwarareddy/smarthealthquote
- Repository: https://github.com/manikanteshwarareddy/smarthealthquote

## Overview

##### Project type and purpose
- From the README and file tree, this is the **frontend** of a full-stack, AI-powered insurance-quote platform (“SmartHealthQuote”) implemented as a **React+Vite single-page app**.
- It serves a chat-based UI to collect user health data, fetch personalized quotes, and display provider directories. The backend (FastAPI + RAG pipeline + Faiss + Mistral 7B) lives in a separate private repo.

##### File structure
- Top‐level files:
- package.json, vite.config.js, tsconfig/jsconfig.json → build & dependency config
- index.html → SPA entry point
- public/ → static assets
- README.md, vercel.json → deployment & docs
- src/
- main.jsx → React DOM bootstrap
- App.jsx + App.css → root layout & global styles
- routes/Router.jsx → client‐side route definitions
- pages/ → route‐level components (AuthPage, chat, dashboard, providers, PrintQuote, privacy-policy, terms-of-service)
- components/ui/ → presentational UI atoms (button, input, card, header/footer, progress, ScrollToTop) built on shadcn/ui + Tailwind + Lucide
- lib/utils.js → shared utilities (e.g., Axios wrapper, auth helpers)
- index.css → Tailwind’s base imports + custom overrides

##### README for additional insights
- Confirms use of: React, Vite, Tailwind CSS, shadcn/ui, Lucide React, Axios, Vercel.
- Mentions backend: FastAPI, RAG (Retrieval-Augmented Generation with Mistral 7B + Faiss).
- Describes main pages/features (chat-based wizard, quote result, provider directory, legal pages).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Zone
    subgraph "Frontend"
        direction TB
        UserBrowser["User Browser"]:::external
        StaticHost["Vercel CDN"]:::external
        UserBrowser -->|"HTTPS GET /"| StaticHost

        subgraph "React SPA"
            direction TB
            Main["main.jsx"]:::frontend
            AppShell["App.jsx + App.css"]:::frontend
            Router["Router.jsx"]:::frontend

            subgraph "Pages"
                direction TB
                AuthPage["AuthPage"]:::frontend
                ChatPage["ChatPage"]:::frontend
                DashboardPage["DashboardPage"]:::frontend
                ProvidersPage["ProvidersPage"]:::frontend
                PrintQuotePage["PrintQuotePage"]:::frontend
                PrivacyPolicyPage["PrivacyPolicyPage"]:::frontend
                TermsOfServicePage["TermsOfServicePage"]:::frontend
            end

            subgraph "UI Components"
                direction TB
                UICompLib["UI Component Library"]:::frontend
                Button["Button"]:::frontend
                Input["Input"]:::frontend
                Card["Card"]:::frontend
                Header["Header"]:::frontend
                Footer["Footer"]:::frontend
                Progress["Progress"]:::frontend
                ScrollToTop["ScrollToTop"]:::frontend
            end

            Utils["utils.js"]:::service
            CSS["index.css"]:::service

            StaticHost -->|"serves index.html"| Main
            Main --> AppShell
            AppShell --> Router
            Router --> AuthPage
            Router --> ChatPage
            Router --> DashboardPage
            Router --> ProvidersPage
            Router --> PrintQuotePage
            Router --> PrivacyPolicyPage
            Router --> TermsOfServicePage
            AuthPage --> UICompLib
            ChatPage --> UICompLib
            DashboardPage --> UICompLib
            ProvidersPage --> UICompLib
            PrintQuotePage --> UICompLib
            PrivacyPolicyPage --> UICompLib
            TermsOfServicePage --> UICompLib
            AuthPage --> Utils
            ChatPage --> Utils
            DashboardPage --> Utils
            ProvidersPage --> Utils
            PrintQuotePage --> Utils
            Utils -->|"HTTP /chat,/quote,/providers"| BackendAPI
            CSS --> AppShell
        end
    end

    %% Backend Zone
    subgraph "Backend"
        direction TB
        BackendAPI["FastAPI API"]:::backend
        subgraph "RAG Pipeline"
            direction TB
            Faiss["Faiss Vector DB"]:::external
            Mistral["Mistral 7B LLM"]:::external
            Pydantic["Pydantic Models"]:::backend
            Postgres["PostgreSQL"]:::external
        end
        BackendAPI --> Pydantic
        BackendAPI --> Faiss
        BackendAPI --> Mistral
        BackendAPI --> Postgres
        Faiss --> BackendAPI
        Mistral --> BackendAPI
        Postgres --> BackendAPI
        BackendAPI -->|"JSON Response"| Utils
    end

    %% CI/CD Zone
    GitHub["GitHub Repo"]:::external
    GitHub -->|"CI/CD Deploy"| StaticHost

    %% Click Events
    click Main "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/main.jsx"
    click AppShell "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/App.jsx"
    click AppShell "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/App.css"
    click Router "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/routes/Router.jsx"
    click AuthPage "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/pages/AuthPage.jsx"
    click ChatPage "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/pages/chat.jsx"
    click DashboardPage "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/pages/dashboard.jsx"
    click ProvidersPage "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/pages/providers.jsx"
    click PrintQuotePage "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/pages/PrintQuote.jsx"
    click PrivacyPolicyPage "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/pages/privacy-policy.jsx"
    click TermsOfServicePage "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/pages/terms-of-service.jsx"
    click UICompLib "https://github.com/manikanteshwarareddy/smarthealthquote/tree/main/src/components/ui/"
    click Button "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/components/ui/button.jsx"
    click Input "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/components/ui/input.jsx"
    click Card "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/components/ui/card.jsx"
    click Header "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/components/ui/header.jsx"
    click Footer "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/components/ui/footer.jsx"
    click Progress "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/components/ui/progress.jsx"
    click ScrollToTop "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/components/ui/ScrollToTop.jsx"
    click Utils "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/lib/utils.js"
    click CSS "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/src/index.css"
    click StaticHost "https://github.com/manikanteshwarareddy/smarthealthquote/tree/main/public/"
    click GitHub "https://github.com/manikanteshwarareddy/smarthealthquote/blob/main/package.json"

    %% Styles
    classDef frontend fill:#a8d0e6,stroke:#333,stroke-width:1px
    classDef backend fill:#a8e6a8,stroke:#333,stroke-width:1px
    classDef service fill:#d0e6a8,stroke:#333,stroke-width:1px
    classDef external fill:#d0a8e6,stroke:#333,stroke-width:1px
```
