BFIT is an Android fitness and nutrition assistant focused on practical daily tracking. It combines personalized planning, barcode-based nutrition lookup, AI-assisted meal recognition, weekly progress reporting, and local-plus-cloud data storage.
The application supports a complete day-to-day user flow:
- Create a plan based on body metrics and goal.
- Track meals and nutrition using barcode scan or manual additions.
- Monitor daily calories and protein.
- Log body weight and visualize trends.
- Use AI assistance for meal recognition and chat support.
- BMI-based plan generation (bulk, lean, maintain).
- Daily meal and workout plan view.
- Day completion tracking.
- Grocery list support.
- Camera-based barcode scanning using ML Kit + CameraX.
- Product and nutrition fetch from OpenFoodFacts.
- Quick add to daily log.
- Weekly calories and protein summary.
- Completed-days indicator for adherence.
- Logged-days insight for consistency.
- Save daily weight entries.
- Interactive 7-day and 30-day trend chart.
- Latest value and delta indicators.
- Analyze meal photos via on-device image labeling.
- Estimated calories and macro split.
- Add recognized meal result to daily log.
- AI chat coach powered by Gemini.
- Supplement store flow with purchase history.
- Firebase auth (email/password and Google sign-in).
- Demo mode for local usage without authentication.
| Layer | Technology |
|---|---|
| Language | Kotlin |
| UI | XML + Material 3 |
| Architecture | Repository pattern |
| Local Data | Room |
| Cloud Data | Firebase Firestore |
| Auth | Firebase Authentication + Google Sign-In |
| Networking | Retrofit + Gson |
| Barcode Scanning | ML Kit Barcode Scanning + CameraX |
| Image Labeling | ML Kit Image Labeling |
| AI Chat | Google Generative AI SDK |
| Charts | MPAndroidChart |
BFIT-master/
app/ Android application
src/main/java/com/example/bfit/
src/main/res/
bfit-web/ Optional web prototype (Vite + TypeScript)
gradle/
build.gradle.kts
settings.gradle.kts
- Android Studio (latest stable recommended)
- JDK 17
- Android SDK (compileSdk 36 configured in project)
- Gradle wrapper included (8.13)
- Firebase project for auth/firestore features
Repository clone and local workspace initialization:
git clone https://github.com/pushpraj-core/BFIT.git
cd BFITFirebase project configuration requires:
-
A Firebase project (new or existing).
-
An Android app registration with package name:
com.example.bfit -
Placement of
google-services.jsonat:app/google-services.json -
Enablement of required Firebase providers:
- Authentication (Email/Password and Google)
- Firestore Database
The root local.properties file includes:
# OpenFoodFacts / app API key placeholder used by BuildConfig.API_KEY
apiKey=YOUR_API_KEY
# Gemini key for chat features
gemini.apiKey=YOUR_GEMINI_API_KEY
# Google Sign-In Web Client ID from Firebase project settings
google.webClientId=YOUR_WEB_CLIENT_IDWindows commands:
./gradlew.bat assembleDebug
./gradlew.bat installDebugmacOS/Linux commands:
./gradlew assembleDebug
./gradlew installDebugThe repository includes an optional bfit-web module based on Vite + TypeScript.
cd bfit-web
npm install
npm run devThis repository includes GitHub Actions workflows for quality enforcement and release automation:
-
android-ci.yml:- Runs on pushes and pull requests to
master/main - Executes
lintDebug,testDebugUnitTest, andassembleDebug - Uploads debug APK and reports as build artifacts
- Fails the pipeline on quality/build errors
- Runs on pushes and pull requests to
-
android-release.yml:- Runs on version tags such as
v1.0.0or manual dispatch - Builds release APK
- Uses signing secrets if provided
- Uploads the APK to GitHub Release and workflow artifacts
- Runs on version tags such as
Branch protection for master with required CI status checks is recommended.
Signed release builds in GitHub Actions use the following repository secrets:
API_KEYGEMINI_API_KEYGOOGLE_WEB_CLIENT_IDGOOGLE_SERVICES_JSON(base64-encodedgoogle-services.json)ANDROID_KEYSTORE_BASE64(base64-encoded keystore)ANDROID_KEYSTORE_PASSWORDANDROID_KEY_ALIASANDROID_KEY_PASSWORD
Release publishing is triggered by pushing a version tag:
git tag v1.0.0
git push origin v1.0.0GitHub Actions generates and attaches the APK artifact to the release.
- Room is used as local persistent storage for performance and offline continuity.
- Firestore stores user profile, plans, logs, chat history, supplements, and purchases.
- The app follows a repository-based approach to centralize data operations.
- Weight logs are stored in Room and surfaced in analytics UI.
- Namespace:
com.example.bfit - Min SDK: 24
- Target SDK: 34
- Compile SDK: 36
- Java/Kotlin target: 17
- Room schema migration included up to DB version 5
- ProGuard/R8: Strict data model rules (
@Keep) configured for release stability.
Before release or demo, validation typically covers:
- Login flow (email/password, Google, demo mode).
- Planner generation and daily log updates.
- Barcode scan and nutrition ingestion.
- Progress screen weekly report and chart rendering.
- Meal recognition and add-to-log flow.
- Store and purchase history screens.
-
Build fails with Java-related error: JDK 17 should be installed and configured in Android Studio with a valid
JAVA_HOME. -
Google sign-in fails:
google.webClientIdand SHA fingerprints should match Firebase configuration. -
Firestore reads/writes fail: Firestore enablement and security rules should allow the active test user context.
-
Gemini responses fail:
gemini.apiKeyshould be valid with required API access. -
Release build crashes or data is missing: Ensure
@Keepannotations are applied to any newly added Firestore or API data models to prevent ProGuard/R8 from obfuscating them.
Contribution expectations are documented in CONTRIBUTING.md.
No license file is currently included in this repository. Add a LICENSE file if you want explicit open-source licensing.