# aaryan-sharmaa/pranapulse architecture

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

- Interactive diagram: https://gitdiagram.com/aaryan-sharmaa/pranapulse
- Repository: https://github.com/aaryan-sharmaa/pranapulse

## Overview

This repository is a yoga-focused web app with an AI chat assistant. Users browse the home/about pages or open a chat, send health-related questions, and receive personalized yoga guidance generated by Groq. The frontend offers two chat interfaces that use the same backend endpoint. The sampled sources show the request handling and model call; database configuration is present, but no sampled runtime code uses it, so it is omitted.

Main entry points: [`Client/src/App.jsx`](https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/App.jsx) (App router), [`Server/utils/server.js`](https://github.com/aaryan-sharmaa/pranapulse/blob/main/Server/utils/server.js) (HTTP server), [`Client/src/components/ai/Ai.jsx`](https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/components/ai/Ai.jsx) (Ask Prana), [`Server/routes/chatRoute.js`](https://github.com/aaryan-sharmaa/pranapulse/blob/main/Server/routes/chatRoute.js) (Chat API route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["App router<br/>[App.jsx]"]
  node_navbar["Navigation<br/>[NavBar.jsx]"]
  node_home["Home page<br/>[Front.jsx]"]
  node_about["About page<br/>[About.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
  node_error["Not found<br/>[Error.jsx]"]
end

subgraph group_chat["Chat experience"]
  node_ai_chat["Ask Prana<br/>[Ai.jsx]"]
  node_yoga_chat["Yoga Assistant<br/>[YogaChatbot.jsx]"]
  node_loader["Loading indicator<br/>[Loader.jsx]"]
end

subgraph group_backend["Chat backend"]
  node_api["Chat API route<br/>[chatRoute.js]"]
  node_server["HTTP server<br/>[server.js]"]
  node_controller["Chat controller<br/>[chatController.js]"]
end

node_visitor(("Visitor"))
node_groq["Groq model service"]

node_visitor -->|"opens"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_footer
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_about
node_app -->|"routes to"| node_ai_chat
node_app -->|"routes to"| node_yoga_chat
node_app -->|"handles route errors"| node_error
node_visitor -->|"selects page"| node_navbar
node_visitor -->|"asks questions"| node_ai_chat
node_visitor -->|"asks questions"| node_yoga_chat
node_ai_chat -->|"shows while waiting"| node_loader
node_ai_chat -->|"posts chat"| node_server
node_yoga_chat -->|"posts chat"| node_server
node_server -->|"mounts route"| node_api
node_api -->|"dispatches"| node_controller
node_controller -->|"requests completion"| node_groq
node_groq -->|"returns completion"| node_controller
node_controller -->|"returns response"| node_api
node_api -->|"sends JSON"| node_server
node_server -->|"returns chat response"| node_ai_chat
node_server -->|"returns chat response"| node_yoga_chat

click node_app "https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/App.jsx"
click node_navbar "https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/components/common/header/NavBar.jsx"
click node_home "https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/components/Body/Front.jsx"
click node_about "https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/components/about/About.jsx"
click node_footer "https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/components/common/footer/Footer.jsx"
click node_error "https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/components/common/errorPage/Error.jsx"
click node_ai_chat "https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/components/ai/Ai.jsx"
click node_yoga_chat "https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/components/yogaChatbot/YogaChatbot.jsx"
click node_loader "https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/components/constants/Loader.jsx"
click node_api "https://github.com/aaryan-sharmaa/pranapulse/blob/main/Server/routes/chatRoute.js"
click node_server "https://github.com/aaryan-sharmaa/pranapulse/blob/main/Server/utils/server.js"
click node_controller "https://github.com/aaryan-sharmaa/pranapulse/blob/main/Server/controllers/chatController.js"

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_navbar,node_home,node_about,node_footer,node_error toneBlue
class node_ai_chat,node_yoga_chat,node_loader toneAmber
class node_api,node_server,node_controller toneMint
class node_visitor,node_groq toneIndigo
```

## Components

### Web experience

- [App router](https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/App.jsx): `Client/src/App.jsx`
- [Navigation](https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/components/common/header/NavBar.jsx): `Client/src/components/common/header/NavBar.jsx`
- [Home page](https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/components/Body/Front.jsx): `Client/src/components/Body/Front.jsx`
- [About page](https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/components/about/About.jsx): `Client/src/components/about/About.jsx`
- [Footer](https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/components/common/footer/Footer.jsx): `Client/src/components/common/footer/Footer.jsx`
- [Not found](https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/components/common/errorPage/Error.jsx): `Client/src/components/common/errorPage/Error.jsx`

### Chat experience

- [Ask Prana](https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/components/ai/Ai.jsx): `Client/src/components/ai/Ai.jsx`
- [Yoga Assistant](https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/components/yogaChatbot/YogaChatbot.jsx): `Client/src/components/yogaChatbot/YogaChatbot.jsx`
- [Loading indicator](https://github.com/aaryan-sharmaa/pranapulse/blob/main/Client/src/components/constants/Loader.jsx): `Client/src/components/constants/Loader.jsx`

### Chat backend

- [Chat API route](https://github.com/aaryan-sharmaa/pranapulse/blob/main/Server/routes/chatRoute.js): `Server/routes/chatRoute.js`
- [HTTP server](https://github.com/aaryan-sharmaa/pranapulse/blob/main/Server/utils/server.js): `Server/utils/server.js`
- [Chat controller](https://github.com/aaryan-sharmaa/pranapulse/blob/main/Server/controllers/chatController.js): `Server/controllers/chatController.js`

### Other components

- **Visitor**
- **Groq model service**

## Connections

- Visitor → App router: opens
- App router → Navigation: renders
- App router → Footer: renders
- App router → Home page: routes to
- App router → About page: routes to
- App router → Ask Prana: routes to
- App router → Yoga Assistant: routes to
- App router → Not found: handles route errors
- Visitor → Navigation: selects page
- Visitor → Ask Prana: asks questions
- Visitor → Yoga Assistant: asks questions
- Ask Prana → Loading indicator: shows while waiting
- Ask Prana → HTTP server: posts chat
- Yoga Assistant → HTTP server: posts chat
- HTTP server → Chat API route: mounts route
- Chat API route → Chat controller: dispatches
- Chat controller → Groq model service: requests completion
- Groq model service → Chat controller: returns completion
- Chat controller → Chat API route: returns response
- Chat API route → HTTP server: sends JSON
- HTTP server → Ask Prana: returns chat response
- HTTP server → Yoga Assistant: returns chat response
