# sahbimlesh007/ai-powered-website-with-q-a-insurebot architecture

> Architecture diagram of the GitHub repository sahbimlesh007/ai-powered-website-with-q-a-insurebot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot
- Repository: https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot

## Overview

Devansh Insurance is an insurance information website with a React frontend and FastAPI Q&A backend. Visitors browse company and insurance-product information, contact details, and a demo login; they can also ask questions in the floating chatbot. Chat questions go to the backend, which adds company context and calls Groq; if that request fails, the frontend answers from local company data. The README documents the backend flow; the backend implementation excerpt was not included, so its internal details are limited to that evidence.

Main entry points: [`chatbot/src/App.jsx`](https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/App.jsx) (App shell and routes), [`chatbot/src/data/companyData.js`](https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/data/companyData.js) (Company and product data), [`chatbot/src/components/Chatbot.jsx`](https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/components/Chatbot.jsx) (Chat UI and fallback), [`chatbot/src/pages/Home.jsx`](https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/pages/Home.jsx) (Home page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Website experience"]
  node_app["App shell and routes<br/>[App.jsx]"]
  node_home["Home page<br/>[Home.jsx]"]
  node_about["About page<br/>[About.jsx]"]
  node_services["Services page<br/>[Services.jsx]"]
  node_contact["Contact page<br/>[Contact.jsx]"]
  node_login["Demo login<br/>[Login.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_footer["Site footer<br/>[Footer.jsx]"]
  node_companycard["Company metric card<br/>[CompanyCard.jsx]"]
end

subgraph group_content["Insurance content"]
  node_companydata["Company and product data<br/>[companyData.js]"]
end

subgraph group_chat["Chat service"]
  node_widget["Floating chat control<br/>[ChatWidget.jsx]"]
  node_chatbot["Chat UI and fallback<br/>[Chatbot.jsx]"]
  node_backend["Chat API and prompt<br/>[main.py]"]
end

node_visitor(("Visitor"))
node_groq{{"Groq API"}}
node_maps{{"Google Maps"}}

node_visitor -->|"browses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_about
node_app -->|"routes to"| node_services
node_app -->|"routes to"| node_contact
node_app -->|"routes to"| node_login
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_footer
node_app -->|"renders"| node_widget
node_home -->|"reads"| node_companydata
node_home -->|"renders"| node_companycard
node_about -->|"reads"| node_companydata
node_services -->|"reads"| node_companydata
node_contact -->|"reads"| node_companydata
node_contact -->|"embeds location"| node_maps
node_footer -->|"reads"| node_companydata
node_widget -->|"renders"| node_chatbot
node_chatbot -->|"reads"| node_companydata
node_visitor -->|"asks question"| node_chatbot
node_chatbot -->|"posts chat"| node_backend
node_backend -->|"requests answer"| node_groq
node_backend -->|"returns reply"| node_chatbot

click node_app "https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/App.jsx"
click node_home "https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/pages/Home.jsx"
click node_about "https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/pages/About.jsx"
click node_services "https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/pages/Services.jsx"
click node_contact "https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/pages/Contact.jsx"
click node_login "https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/pages/Login.jsx"
click node_navbar "https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/components/Navbar.jsx"
click node_footer "https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/components/Footer.jsx"
click node_companycard "https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/components/CompanyCard.jsx"
click node_companydata "https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/data/companyData.js"
click node_widget "https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/components/ChatWidget.jsx"
click node_chatbot "https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/components/Chatbot.jsx"
click node_backend "https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/backend/main.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_home,node_about,node_services,node_contact,node_login,node_navbar,node_footer,node_companycard toneBlue
class node_companydata toneAmber
class node_widget,node_chatbot,node_backend,node_groq toneMint
class node_visitor,node_maps toneIndigo
```

## Components

### Website experience

- [App shell and routes](https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/App.jsx): `chatbot/src/App.jsx`
- [Home page](https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/pages/Home.jsx): `chatbot/src/pages/Home.jsx`
- [About page](https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/pages/About.jsx): `chatbot/src/pages/About.jsx`
- [Services page](https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/pages/Services.jsx): `chatbot/src/pages/Services.jsx`
- [Contact page](https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/pages/Contact.jsx): `chatbot/src/pages/Contact.jsx`
- [Demo login](https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/pages/Login.jsx): `chatbot/src/pages/Login.jsx`
- [Navigation](https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/components/Navbar.jsx): `chatbot/src/components/Navbar.jsx`
- [Site footer](https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/components/Footer.jsx): `chatbot/src/components/Footer.jsx`
- [Company metric card](https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/components/CompanyCard.jsx): `chatbot/src/components/CompanyCard.jsx`

### Insurance content

- [Company and product data](https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/data/companyData.js): `chatbot/src/data/companyData.js`

### Chat service

- [Floating chat control](https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/components/ChatWidget.jsx): `chatbot/src/components/ChatWidget.jsx`
- [Chat UI and fallback](https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/chatbot/src/components/Chatbot.jsx): `chatbot/src/components/Chatbot.jsx`
- [Chat API and prompt](https://github.com/sahbimlesh007/ai-powered-website-with-q-a-insurebot/blob/main/backend/main.py): `backend/main.py`

### Other components

- **Visitor**
- **Groq API**
- **Google Maps**

## Connections

- Visitor → App shell and routes: browses (evidence: `README.md`)
- App shell and routes → Home page: routes to (evidence: `chatbot/src/App.jsx`)
- App shell and routes → About page: routes to (evidence: `chatbot/src/App.jsx`)
- App shell and routes → Services page: routes to (evidence: `chatbot/src/App.jsx`)
- App shell and routes → Contact page: routes to (evidence: `chatbot/src/App.jsx`)
- App shell and routes → Demo login: routes to (evidence: `chatbot/src/App.jsx`)
- App shell and routes → Navigation: renders (evidence: `chatbot/src/App.jsx`)
- App shell and routes → Site footer: renders (evidence: `chatbot/src/App.jsx`)
- App shell and routes → Floating chat control: renders (evidence: `chatbot/src/App.jsx`)
- Home page → Company and product data: reads (evidence: `chatbot/src/pages/Home.jsx`)
- Home page → Company metric card: renders (evidence: `chatbot/src/pages/Home.jsx`)
- About page → Company and product data: reads (evidence: `chatbot/src/pages/About.jsx`)
- Services page → Company and product data: reads (evidence: `chatbot/src/pages/Services.jsx`)
- Contact page → Company and product data: reads (evidence: `chatbot/src/pages/Contact.jsx`)
- Contact page → Google Maps: embeds location (evidence: `chatbot/src/pages/Contact.jsx`)
- Site footer → Company and product data: reads (evidence: `chatbot/src/components/Footer.jsx`)
- Floating chat control → Chat UI and fallback: renders (evidence: `chatbot/src/components/ChatWidget.jsx`)
- Chat UI and fallback → Company and product data: reads (evidence: `chatbot/src/components/Chatbot.jsx`)
- Visitor → Chat UI and fallback: asks question (evidence: `README.md`)
- Chat UI and fallback → Chat API and prompt: posts chat (evidence: `README.md`)
- Chat API and prompt → Groq API: requests answer (evidence: `README.md`)
- Chat API and prompt → Chat UI and fallback: returns reply (evidence: `README.md`)
