How amanyara88/fityatraapp works
Main Components
• Mobile Application (Android):
• UI Layer: Represented by a rich set of activities (e.g., MainActivity, various activity screens for calorie statistics, meal tracking, exercise, etc.), fragments (e.g., HomeFragment, DashboardFragment, ExerciseFragment) and ViewModels (e.g., HomeViewModel, DashboardViewModel) that follow an MVVM pattern.
• Service Layer: This includes the StepTrackingService and other services that manage sensor data, Firebase ML Kit integrations (for posture detection, exercise rep counting) and background tasks.
• Data Layer: Look for local database interactions (such as SQLiteUtils) and data models (e.g., User, Exercise, DietPlan). Also include utilities for API connections in the utils folder (ApiClient, ApiServices), and any adapters that manage list displays.
• Assets & Resources: These include XML layouts, drawable resources, layouts, and configuration files (AndroidManifest, google-services.json) which provide the visual and configuration backbone of the app.
• Backend Service (Python Flask):
• Although not present in the file tree, the README indicates that a Flask backend exists. Include a component for the backend server to handle REST API calls, process personalized diet plans, and support any additional business logic or data persistence.
• External Integrations:
• Firebase ML Kit: For posture detection and counting exercise repetitions.
• Health Connect API: For integrating health data from various sources.
• Google Mobile Services (as evidenced by google-services.json).
• Chatbot Service (likely powered by Gemini or an alternative ML service) to manage health-related queries.
Relationships and Interactions
• The Mobile Application’s UI layer interacts with the Service layer (via activities, fragments, and ViewModels) to process user inputs and sensor data.
• The Service layer collects data from mobile sensors and interfaces with external services (Firebase ML Kit, Health Connect API) to perform processing tasks.
• The data layer interacts with the local SQLite database for persistent data storage, while also making network calls (using ApiClient/ApiServices) to communicate with the Python Flask backend.
• The backend processes requests related to personalized diet plans, updates, or other health-related configurations and then communicates back to the mobile client as needed.
• The chatbot component in the UI initiates queries that are routed either to a backend service or an external AI service.
Architectural Patterns and Design Principles
• Use the MVVM architecture for the Android app. Emphasize how Activities, Fragments, and ViewModels interact.
• Clearly how services act as a bridge between sensor data (mobile), local storage (SQLite), and external API integrations.
• That network clients in the utils module provide abstraction over API communications.
• Modularity and separation of concerns (UI, business logic, data, external integrations).