# shreyastaware/ai_fitness_coach architecture

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

- Interactive diagram: https://gitdiagram.com/shreyastaware/ai_fitness_coach
- Repository: https://github.com/shreyastaware/ai_fitness_coach

## Overview

This repository presents an AI fitness coach landing page and a Python backend for a phone-based coaching agent. The documented user journey is an inbound phone call, speech transcription, personalized AI response with retrieved fitness knowledge and conversation context, then spoken audio returned to the caller. The frontend advertises plans, features and a local demo; the README describes backend integrations more fully than the sampled source establishes. Backend flow edges therefore reflect documented architecture, not verified implementation details.

Main entry points: [`Frontend/src/App.tsx`](https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/App.tsx) (Page Composer), [`app/server.py`](https://github.com/shreyastaware/ai_fitness_coach/blob/main/app/server.py) (AI Agent Backend), [`app`](https://github.com/shreyastaware/ai_fitness_coach/tree/main/app) (Fitness Advice), [`Frontend/src/components/Header.tsx`](https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/Header.tsx) (Navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Product Website"]
  node_app["Page Composer<br/>[App.tsx]"]
  node_header["Navigation<br/>[Header.tsx]"]
  node_hero["Landing Hero<br/>[Hero.tsx]"]
  node_how["How It Works<br/>[HowItWorks.tsx]"]
  node_features["Feature Catalog<br/>[Features.tsx]"]
  node_demo["Interactive Demo<br/>[Demo.tsx]"]
  node_testimonials["Testimonials<br/>[Testimonials.tsx]"]
  node_pricing["Plans and Pricing<br/>[Pricing.tsx]"]
  node_contact["Trial Contact Form<br/>[Contact.tsx]"]
  node_footer["Site Footer<br/>[Footer.tsx]"]
end

subgraph group_voice["Voice Experience"]
  node_caller(("Phone Caller"))
  node_telephony["Twilio Voice"]
  node_server["AI Agent Backend<br/>[server.py]"]
  node_stt["Speech Recognition"]
  node_tts["Speech Synthesis"]
  node_callnow["Call Utility<br/>[callNow.py]"]
end

subgraph group_ai["Coaching Intelligence"]
  node_agent["Fitness Advice"]
  node_rag["Knowledge Retrieval"]
  node_session["Conversation Context"]
  node_llm["Language Model"]
  node_store[("Vector Store")]
end

node_visitor(("Prospective User"))

node_app -->|"renders"| node_header
node_app -->|"renders"| node_hero
node_app -->|"renders"| node_how
node_app -->|"renders"| node_features
node_app -->|"renders"| node_demo
node_app -->|"renders"| node_testimonials
node_app -->|"renders"| node_pricing
node_app -->|"renders"| node_contact
node_app -->|"renders"| node_footer
node_visitor -.->|"views"| node_app
node_caller -->|"places call"| node_telephony
node_telephony -->|"sends audio"| node_server
node_server -->|"transcribes speech"| node_stt
node_server -->|"requests advice"| node_agent
node_agent -->|"retrieves knowledge"| node_rag
node_rag -->|"queries"| node_store
node_agent -->|"maintains context"| node_session
node_agent -->|"generates response"| node_llm
node_server -->|"synthesizes response"| node_tts
node_tts -->|"returns audio"| node_telephony
node_telephony -->|"plays audio"| node_caller

click node_app "https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/App.tsx"
click node_header "https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/Header.tsx"
click node_hero "https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/Hero.tsx"
click node_how "https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/HowItWorks.tsx"
click node_features "https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/Features.tsx"
click node_demo "https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/Demo.tsx"
click node_testimonials "https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/Testimonials.tsx"
click node_pricing "https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/Pricing.tsx"
click node_contact "https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/Contact.tsx"
click node_footer "https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/Footer.tsx"
click node_server "https://github.com/shreyastaware/ai_fitness_coach/blob/main/app/server.py"
click node_callnow "https://github.com/shreyastaware/ai_fitness_coach/blob/main/app/callNow.py"
click node_agent "https://github.com/shreyastaware/ai_fitness_coach/tree/main/app"
click node_rag "https://github.com/shreyastaware/ai_fitness_coach/tree/main/app"
click node_session "https://github.com/shreyastaware/ai_fitness_coach/tree/main/app"

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_header,node_hero,node_how,node_features,node_demo,node_testimonials,node_pricing,node_contact,node_footer,node_visitor toneBlue
class node_caller,node_telephony,node_server,node_stt,node_tts,node_callnow toneAmber
class node_agent,node_rag,node_session,node_llm,node_store toneMint
```

## Components

### Product Website

- [Page Composer](https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/App.tsx): `Frontend/src/App.tsx`
- [Navigation](https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/Header.tsx): `Frontend/src/components/Header.tsx`
- [Landing Hero](https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/Hero.tsx): `Frontend/src/components/Hero.tsx`
- [How It Works](https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/HowItWorks.tsx): `Frontend/src/components/HowItWorks.tsx`
- [Feature Catalog](https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/Features.tsx): `Frontend/src/components/Features.tsx`
- [Interactive Demo](https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/Demo.tsx): `Frontend/src/components/Demo.tsx`
- [Testimonials](https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/Testimonials.tsx): `Frontend/src/components/Testimonials.tsx`
- [Plans and Pricing](https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/Pricing.tsx): `Frontend/src/components/Pricing.tsx`
- [Trial Contact Form](https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/Contact.tsx): `Frontend/src/components/Contact.tsx`
- [Site Footer](https://github.com/shreyastaware/ai_fitness_coach/blob/main/Frontend/src/components/Footer.tsx): `Frontend/src/components/Footer.tsx`

### Voice Experience

- **Phone Caller**
- **Twilio Voice**
- [AI Agent Backend](https://github.com/shreyastaware/ai_fitness_coach/blob/main/app/server.py): `app/server.py`
- **Speech Recognition**
- **Speech Synthesis**
- [Call Utility](https://github.com/shreyastaware/ai_fitness_coach/blob/main/app/callNow.py): `app/callNow.py`

### Coaching Intelligence

- [Fitness Advice](https://github.com/shreyastaware/ai_fitness_coach/tree/main/app): `app`
- [Knowledge Retrieval](https://github.com/shreyastaware/ai_fitness_coach/tree/main/app): `app`
- [Conversation Context](https://github.com/shreyastaware/ai_fitness_coach/tree/main/app): `app`
- **Language Model**
- **Vector Store**

### Other components

- **Prospective User**

## Connections

- Page Composer → Navigation: renders (evidence: `Frontend/src/App.tsx`)
- Page Composer → Landing Hero: renders (evidence: `Frontend/src/App.tsx`)
- Page Composer → How It Works: renders (evidence: `Frontend/src/App.tsx`)
- Page Composer → Feature Catalog: renders (evidence: `Frontend/src/App.tsx`)
- Page Composer → Interactive Demo: renders (evidence: `Frontend/src/App.tsx`)
- Page Composer → Testimonials: renders (evidence: `Frontend/src/App.tsx`)
- Page Composer → Plans and Pricing: renders (evidence: `Frontend/src/App.tsx`)
- Page Composer → Trial Contact Form: renders (evidence: `Frontend/src/App.tsx`)
- Page Composer → Site Footer: renders (evidence: `Frontend/src/App.tsx`)
- Prospective User → Page Composer: views
- Phone Caller → Twilio Voice: places call (evidence: `README.md`)
- Twilio Voice → AI Agent Backend: sends audio (evidence: `README.md`)
- AI Agent Backend → Speech Recognition: transcribes speech (evidence: `README.md`)
- AI Agent Backend → Fitness Advice: requests advice (evidence: `README.md`)
- Fitness Advice → Knowledge Retrieval: retrieves knowledge (evidence: `README.md`)
- Knowledge Retrieval → Vector Store: queries (evidence: `README.md`)
- Fitness Advice → Conversation Context: maintains context (evidence: `README.md`)
- Fitness Advice → Language Model: generates response (evidence: `README.md`)
- AI Agent Backend → Speech Synthesis: synthesizes response (evidence: `README.md`)
- Speech Synthesis → Twilio Voice: returns audio (evidence: `README.md`)
- Twilio Voice → Phone Caller: plays audio (evidence: `README.md`)
