How sathish-create/fitcoach_ai_web works
Purpose and entry points
This repository is a fitness/coaching application with a static browser frontend and a Python backend for pose-based exercise analysis. Primary entry points are backend/main.py for the service and frontend/index.html for the client. Deployment configuration is in render.yaml.
Backend analysis service
backend/main.py hosts the backend API/runtime and delegates exercise-form analysis into the engine. The packaged pose model backend/pose_landmarker.task is a material runtime asset, indicating local pose-landmark inference rather than a remote vision API. Python dependencies are defined in backend/requirements.txt.
Pose processing boundary
backend/utils/pose_utils.py is the boundary between raw pose-landmarker output and normalized/derived pose data consumed by analysis rules. backend/engine/analyzer.py coordinates analysis: it likely selects applicable exercise/body-region rules, evaluates landmarks, and returns coaching or validation results to the API layer.
Rule-based form evaluation
The engine is organized as modular rule groups under backend/engine/rules/. backend/engine/rules/base.py and backend/engine/rules/abs.py establish shared and abdominal-specific evaluation behavior; other groups encode body-region or exercise-form logic, including backend/engine/rules/arms.py, backend/engine/rules/back.py, backend/engine/rules/chest.py, backend/engine/rules/full_body.py, backend/engine/rules/legs.py, backend/engine/rules/shoulders.py, and backend/engine/rules/triceps.py. This keeps pose inference separate from domain-specific coaching criteria.
Frontend application surfaces
The frontend is a multi-page static application. Workout and coaching flows are represented by frontend/workout.html and frontend/coach.html; discovery and content pages include frontend/exercises.html, frontend/library.html, and frontend/gyms.html. Shared client behavior is concentrated in frontend/js/app.js, with gym-specific behavior in frontend/js/gyms.js and visual landing behavior in frontend/js/landing-effects.js.
Content, identity, and persistence
Exercise content is locally represented in frontend/exercises.json. Authentication and client-side Supabase integration are isolated in frontend/js/supabase-auth.js and frontend/js/supabase-config.js. The database contract is captured in supabase_schema.sql, making Supabase the primary external backend service for account and application persistence rather than the Python pose-analysis service.
Operational boundaries
The frontend is browser-hosted HTML/CSS/JavaScript, while the backend requires a Python runtime plus the local pose model. render.yaml is the deployment/infrastructure boundary. backend/error_log.txt and backend/verify_logic.py suggest local operational diagnostics and rule-validation support, but the production architecture centers on browser UI → Supabase for app data/auth and browser/UI → Python service for pose/form analysis.
Main entry points: analyzer.py Form analyzer · app.js Shared app behavior · workout.html Workout & coaching pages · main.py Analysis API runtime
Components 18
Browser frontend
Static multi-page fitness application.
- Browser user
- Workout & coaching pages · Interactive exercise and coaching surfaces.
frontend/workout.html - Discovery pages · Exercises, library, and gyms pages.
frontend/exercises.html - Shared app behavior
frontend/js/app.js - Gym behavior
frontend/js/gyms.js - Landing effects
frontend/js/landing-effects.js - Exercise catalog
frontend/exercises.json - Supabase client
frontend/js/supabase-auth.js
Pose analysis service
Python runtime for local pose-based coaching.
- Analysis API runtime · Receives pose/form analysis requests.
backend/main.py - Pose landmarker model
backend/pose_landmarker.task - Pose normalization · Converts model output into analysis-ready pose data.
backend/utils/pose_utils.py - Form analyzer · Selects and evaluates exercise-form rules.
backend/engine/analyzer.py - Base & abs rules
backend/engine/rules/base.py - Upper-body rules · Arms, back, chest, shoulders, and triceps criteria.
backend/engine/rules/arms.py - Lower & full-body rules · Leg and full-body criteria.
backend/engine/rules/legs.py
Supabase
External identity and application persistence.
- Auth service
- Application database · Schema contract defines account and application data.
supabase_schema.sql
Other components
- Deployment config · Defines hosting/deployment boundary.
render.yaml
Connections 20
- Browser user → Workout & coaching pages: uses
- Browser user → Discovery pages: browses
- Workout & coaching pages → Shared app behavior: loads
- Discovery pages → Shared app behavior: loads
- Discovery pages → Gym behavior: uses for gyms
- Shared app behavior → Landing effects: supports landing UI
- Shared app behavior → Exercise catalog: reads
- Shared app behavior → Supabase client: uses
- Supabase client → Auth service: authenticates with
- Supabase client → Application database: reads and writes
- Workout & coaching pages → Analysis API runtime: submits pose/form analysis
- Analysis API runtime → Pose landmarker model: runs local inference
- Pose landmarker model → Pose normalization: produces landmarks
- Pose normalization → Form analyzer: normalizes pose data
- Form analyzer → Base & abs rules: evaluates
- Form analyzer → Upper-body rules: evaluates
- Form analyzer → Lower & full-body rules: evaluates
- Form analyzer → Analysis API runtime: returns coaching result
- Deployment config → Workout & coaching pages: deploys static frontend
- Deployment config → Analysis API runtime: deploys service