Skip to content

Barenya-madhab-jethy/FitLogic-Smart-Gym-Trainer-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 

Repository files navigation

FitLogic - Smart Gym Trainer System πŸ‹οΈβ€β™‚οΈπŸ’ͺ

FitLogic is an intelligent web-based fitness application that acts as your personal gym trainer. It uses an AI-driven decision engine to analyze performance, prevent overtraining, balance muscle groups, and generate adaptive workouts in real-time. Works 100% offline with browser SQLite persistence.

✨ Key Features Smart Decision Engine (js/rule-engine.js): Detects overtraining, workout imbalances, plateaus, and suggests optimal adjustments. AI Chatbot (js/chatbot.js): 24/7 fitness assistant powered by DeepSeek API (api/deepseek-chat.php). Progressive Workouts (js/workout-generator.js): Personalized plans based on sleep, stress, recovery, and goals. Recovery Tracking: Monitors fatigue patterns and recommends deloads/active recovery. SQLite Database (js/sql-db.js): Offline-first storage for workouts, history, settings with localStorage migration. Performance Analytics (js/charts.js, js/fitness-score.js): Visual progress tracking and fitness scoring. PWA Support (sw.js): Full offline capability, installable app. Responsive Design: Mobile-first UI with dark theme, animations (css/animations.css). Indian Nutrition Integration (nutrition.html). Injury Mode (injury-mode.html): Safe progression post-injury (40% β†’ 55% β†’ 70% intensity). πŸ› οΈ Tech Stack Category Technologies Frontend HTML5, Vanilla JS (ES modules), Bootstrap 5, Chart.js, Font Awesome Database sql.js (SQLite in browser), localStorage fallback Build/Tools ESLint (linting), Service Worker (PWA) Backend PHP (chat API only), fully client-side otherwise Other Responsive CSS Grid/Flexbox, CSS animations No Node.js server required - Pure static site!

πŸ“ File Structure fitlogic/ β”œβ”€β”€ index.html # Landing page & demo β”œβ”€β”€ login.html # Authentication β”œβ”€β”€ dashboard.html # Main app dashboard β”œβ”€β”€ workout.html # Workout generator β”œβ”€β”€ history.html # Workout history (SQLite) β”œβ”€β”€ nutrition.html # Nutrition tracker β”œβ”€β”€ settings.html # User settings β”œβ”€β”€ injury-mode.html # Injury recovery mode β”œβ”€β”€ api/ β”‚ └── deepseek-chat.php # AI Chatbot API β”œβ”€β”€ css/ β”‚ β”œβ”€β”€ style.css β”‚ β”œβ”€β”€ auth.css β”‚ β”œβ”€β”€ responsive.css β”‚ └── animations.css β”œβ”€β”€ js/ β”‚ β”œβ”€β”€ main.js # Core app logic β”‚ β”œβ”€β”€ rule-engine.js # Decision making core β”‚ β”œβ”€β”€ workout-generator.js β”‚ β”œβ”€β”€ sql-db.js # SQLite database β”‚ β”œβ”€β”€ sql-db-fixed.js β”‚ β”œβ”€β”€ charts.js β”‚ β”œβ”€β”€ chatbot.js β”‚ β”œβ”€β”€ fitness-score.js β”‚ β”œβ”€β”€ offline-sync.js β”‚ └── functions.js β”œβ”€β”€ assets/images/ # Screenshots & icons β”œβ”€β”€ sw.js # Service Worker β”œβ”€β”€ package.json # ESLint config β”œβ”€β”€ TODO.md # Current tasks └── TODO_SQLite.md # DB implementation notes πŸš€ Quick Start Live Demo: Open index.html in any modern browser (Chrome/Firefox recommended). Development Server (optional): npx serve . Install as PWA: Click install icon in browser address bar. Offline Mode: Fully functional without internet (except chatbot). No installation required - Zero dependencies for runtime!

πŸ§ͺ Development & Testing

Lint code

npx eslint js/

Auto-fix lint issues

npx eslint js/ --fix

Check PWA compliance

npx lighthouse . --view Current Status See TODO.md for ongoing cleanup (ESLint fixes, console.log removal). SQLite implementation complete: TODO_SQLite.md.

πŸ“± Screenshots Dashboard Decision Engine Workout Generator Dashboard Decision Engine Workout πŸ€– Smart Features Demo Real Workout Decision Logic (from js/rule-engine.js):

IF sleep < 5h β†’ reduce intensity 30%, increase rest 20% IF chest > 3 sessions β†’ lock chest 48h, suggest back/mobility IF performance drop β†’ active recovery + deload week Try the live demo on index.html#demo.

πŸ“‹ Database Schema (SQLite) Table Purpose users User profiles & goals workouts Completed sessions user_settings Equipment, preferences meal_logs Nutrition tracking fitness_scores Performance metrics Auto-migrates from localStorage on first load.

πŸ”— Pages Overview dashboard.html: Main hub with charts & fitness score workout.html: Generate & log workouts history.html: Past workouts (paginated) nutrition.html: Meal planning settings.html: Customize app feedback.html: User feedback injury-mode.html: Post-injury protocols 🀝 Contributing Fork the repo Run npx eslint js/ --fix Create feature branch Test offline functionality Submit PR πŸ“„ License MIT License - Use freely for personal/commercial projects.

πŸ™Œ Support Issues: Create GitHub issue Chatbot: Built-in AI assistant Demo: Live Preview Built with ❀️ for fitness enthusiasts. Train smart, not hard! πŸ’ͺ

Status: Production-ready β€’ Offline-first β€’ PWA-compliant

About

Rule-based fitness system with injury recovery, offline support, Indian diet tracking, and intelligent workout adaptation. Your personal decision-correction engine!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors