How sanjaytheli/gymbrochat works
GymBro AI is a fitness-coaching chat app with workout chat sessions and lightweight progress tracking. The main workflow is a user message submitted from the React app to a FastAPI endpoint, which builds a prompt and streams Cohere-generated text. The frontend also maintains session, streak, PR, and macro state in browser storage. The excerpts establish the frontend/backend request and backend model/prompt calls; frontend response handling is only partially shown, so the return stream is documented from the backend side.
Main entry points: app.py Chat endpoint · App.jsx GymBro app · main.jsx React entry · models.py Chat request schema
Components 10
Frontend
- React entry
frontend/FEgymbro/src/main.jsx - GymBro app
frontend/FEgymbro/src/App.jsx - Chat sessions
frontend/FEgymbro/src/App.jsx - Progress tracking
frontend/FEgymbro/src/App.jsx
Backend
- Chat endpoint
backend/app.py - Chat request schema
backend/schemas/models.py - Coach system prompt
backend/llm_adapters/cohere_prompts.py
AI provider
- Cohere API
Other components
- Fitness user
- Browser storage
Connections 8
- Fitness user → GymBro app: uses
frontend/FEgymbro/src/App.jsx - React entry → GymBro app: renders
frontend/FEgymbro/src/main.jsx - GymBro app → Chat endpoint: posts message
frontend/FEgymbro/src/App.jsx - GymBro app → Browser storage: persists state
frontend/FEgymbro/src/App.jsx - Chat endpoint → Chat request schema: validates payload
backend/app.py - Chat endpoint → Coach system prompt: uses prompt
backend/app.py - Chat endpoint → Cohere API: requests stream
backend/app.py - Chat endpoint → GymBro app: streams response
backend/app.py