How mohesmail143/coach-ai works
Project type and purpose
• Coach.ai is a full-stack mobile application (Flutter) with on-device ML inference and cloud backend services.
• Purpose: guide users through exercises by detecting pose and counting reps (using TensorFlow MoveNet and custom TFLite models), calculate BMI, track nutrition, and authenticate users via Firebase.
File structure
• Top-level platform folders: android/, ios/, linux/, macos/, windows/, web/ — standard Flutter multi-platform support.
• Core Dart code under lib/:
• lib/main.dart — application entry point
• lib/screens/ — UI pages (Intro, Login, Signup, Home, Camera, Exercise selection, BMI, Nutrition, Profile, etc.)
• lib/services/ — Firebase authentication wrapper
• lib/utils/camera/ — pose detector, isolate management, landmark rendering, rep counter, sample input
• lib/utils/ — domain models (exercise, nutrition, session)
• lib/widgets/ — reusable UI components (buttons, text fields)
• assets/models/: TFLite files (movenet, pushUp, pullUp, squat)
• Config files: pubspec.yaml (dependencies), platform build scripts, Firebase config in android/app/google-services.json, lib/firebase_options.dart.
README for additional insights
• Confirms ML usage (MoveNet + custom pose-classification models), Firebase for auth, BMI and nutrition modules.
Detailed breakdown of components
• Presentation Layer (lib/screens, lib/widgets)
• Screens: Login, Signup, Home, Camera, BMI, Nutrition, Profile
• Service Layer (lib/services/firebase_auth_service.dart)
• Methods: signIn(), signUp(), signOut(), getCurrentUser()
• Business Logic Layer (lib/utils)
• Exercise, NutritionPlan, WorkoutSession classes
• BMI calculation
• ML Inference Layer (lib/utils/camera)
• PoseDetector (MoveNet), PoseClassifier (custom)
• RepCounter, LandmarkRenderer, TTS (coach_tts)
• Cloud Layer (Firebase)
• Auth Service
• (Optional) Firestore for nutrition logs
• Asset Store
• TFLite models (assets/models/*.tflite)
Final advice
• Drill down into the client: separate UI, logic, ML sub-modules.
• Iterate: validate with team to ensure it matches the actual runtime interactions.