How vijayanish11/yogasage works
What this project is (type + purpose)
YogaSage is a small AI-powered yoga training web app. It combines:
• A web UI (multiple .html pages for different poses/flows/days)
• A Python web backend (strongly suggests Django because of views.py, urls.py, models.py, db.sqlite3)
• A pose-accuracy ML model shipped as static artifacts (model.json, weights.bin, metadata.json) which is typical of TensorFlow.js / Teachable Machine style models used in-browser.
The README describes modules like login, user data, BMI, recommendations, and pose accuracy. The file tree indicates:
• The app is likely monolithic (single backend + static pages) rather than microservices.
• Pose inference may happen client-side (browser loads model.json + weights.bin) with the backend used for authentication, user profile/BMI, and persistence.
Backend
• models.py → data model for users / profiles / BMI / pose sessions (likely)
• views.py → request handlers: render pages, accept form posts, maybe store results
• urls.py → URL routing to views
• db.sqlite3 → persisted relational store (SQLite)
Frontend / UX pages (server-rendered templates or static)
Many .html pages: home.html, getstarted.html, details.html, plus pose pages like triangle.html, diamond.html, treePose.html, warrior.html, etc. Also “day” pages (nday1.html, oday1.html, uday1.html) and difficulty pages (easy.html).
ML model artifacts
• model.json, weights.bin, metadata.json → browser-loadable model package
This strongly suggests:
• webcam/video frames → pose/keypoints/classification → accuracy feedback in real time
• either computed in the browser (common) or served to the backend for inference (less likely with these artifacts present)
User / Browser
• interacts with the site
• grants webcam access for pose checking
Web Frontend (HTML pages + JS pose logic)
• Pages: Home/Get Started/Details; Pose pages (Triangle/Tree/Warrior/etc.); Plans (Day pages); Difficulty selection
• Pose Accuracy UI module (client-side): loads model artifacts and runs inference
• Recommendation/BMI UI: forms for user data, results display
ML Inference (Client-side TensorFlow.js model)
• Inputs: webcam frames (or pose landmarks)
• Model files: model.json, weights.bin, metadata.json
• Outputs: predicted pose class + confidence/accuracy score + feedback
Python Web Backend (Django app)
• urls.py routes requests to views.py
• views.py renders HTML / handles POSTs (login, details submission, BMI calc, storing sessions)
• models.py defines persistence entities
Database (SQLite)
• db.sqlite3
• stores users, profiles (age/height/weight), BMI, recommendations, pose session summaries (if implemented)
(Optional) External dependencies
• If TF.js is loaded from CDN, represent CDN/External JS libraries
• If using browser APIs: represent Webcam API
At minimum, show these flows:
Auth / Profile
• Browser → Django Backend: login/register requests
• Django Backend ↔ SQLite: read/write user records
• Django Backend → Browser: render home.html, details.html, etc.
User Data → BMI → Recommendation
• Browser → Django Backend: submit age/height/weight (details form)
• Django Backend: compute BMI + classification
• Django Backend ↔ SQLite: persist profile/BMI
• Django Backend → Browser: return recommended pose plan / link to pose pages
(If results are stored) Session logging
• Browser → Django Backend: send final score / completion event
• Django Backend ↔ SQLite: store session history
• Django Backend → Browser: confirmation/progress page
Architectural patterns to call out (what matters to be “accurate”)
• Monolithic Django backend: routing + controller logic (views.py) + ORM models (models.py) + SQLite persistence.
• Client-side ML inference: model artifacts strongly indicate the ML is shipped to the browser; this is important because it changes:
• latency (real-time)
• privacy (video stays on device)
• backend load (lower)
• Page-oriented UI: multiple distinct HTML pages mapped from Django routes (or served statically).
Tell the engineer to confirm these from urls.py, views.py, and the HTML pages:
• Actual routes (e.g., /login, /details, /pose/triangle, etc.)
• Whether the HTML is Django templates or static served files
• Whether pose inference truly runs client-side (look for TF.js usage in HTML/JS)
• Whether pose results are posted back to backend (session history) or kept local only
• What entities exist in models.py (UserProfile, BMIRecord, PoseSession, etc.)
“Don’t overthink it” decomposition (max components)
To follow your guideline of separating into as many components as possible, break it into:
• UI Pages: Home, Get Started, Details, Easy, Day Plans, Pose Pages (Triangle/Tree/Warrior/etc.)
• Backend Modules: Auth, User Profile/Data Collection, BMI Calc, BMI Classification, Recommendation, Session Logging
• ML Modules: Model Loader, Webcam Capture, Preprocessing, Inference, Feedback Renderer
• Data: Users, Profiles, BMI, Recommendations, Sessions