NutriSense is an AI-powered mobile application that helps users make informed decisions about nutrition, fitness, hydration, and daily wellbeing. The application combines personalized nutrition guidance, AI-assisted food image analysis, culturally aware meal recommendations, health tracking, reminders, and offline support in one mobile experience.
NutriSense uses a Python-based AI food-analysis service to process food images and provide estimated nutritional information, including calories, carbohydrates, protein, fats, and other relevant nutrients where supported.
Project status: NutriSense is a final-year academic project under active development. It is intended for educational and wellness-support purposes and is not a substitute for professional medical advice.
- Overview
- Why NutriSense
- How Food Analysis Works
- Features
- User Journey
- Technology Stack
- Application Modules
- Architecture
- Project Structure
- Getting Started
- Environment Configuration
- Development Commands
- Data and Privacy
- Testing
- Roadmap
- Limitations
- Academic Context
- Contributing
- License
- Contact
NutriSense is designed to support healthier daily habits through practical, personalized, and accessible digital tools. Rather than providing one-size-fits-all nutrition information, the application considers a userβs personal goals, dietary preferences, regional food habits, cultural context, religious requirements, activity, and connectivity conditions.
The application is built around four principles:
- Personalization: recommendations should reflect each userβs goals and preferences.
- Cultural awareness: meal suggestions should support regional, cultural, and religious dietary needs.
- AI-assisted analysis: food images can be processed through a Python-based AI/ML service to estimate food and nutrient information.
- Accessibility: selected information should remain available when internet connectivity is limited.
Many nutrition applications provide generic calorie information without considering local food choices, cultural context, or intermittent internet access. NutriSense aims to provide a more relevant experience by combining AI/ML-based food image analysis, user preferences, local storage, and a modular mobile architecture.
The application provides a foundation for personalized nutrition guidance while keeping the user experience simple, practical, and accessible.
NutriSense uses a mobile-to-Python workflow for food image analysis:
User captures food image
β
βΌ
React Native mobile application
β
βΌ
Python AI/ML food-analysis service
β
βΌ
Food recognition and nutrition estimation
β
βΌ
Nutrition result returned to the mobile app
β
βΌ
Calories, carbohydrates, protein, fats, and other available nutrients
The Python service receives a food image, applies AI/ML-based analysis, and returns an estimated result to the mobile application. The mobile app then presents the detected food and nutritional information in a user-friendly format.
Depending on the configured service and available data, the response may include:
- Detected food name.
- Estimated calories.
- Carbohydrates.
- Protein.
- Fat.
- Other available nutrition information.
- Recognition or result confidence where supported.
Food recognition and nutrition values are estimates. Users should verify important dietary information, particularly when allergies or medical conditions are involved.
- Collect user profile information and wellness goals.
- Support goals such as weight management, healthy eating, fitness improvement, and habit building.
- Store dietary preferences and restrictions to support more relevant recommendations.
- Capture or select a food image from the mobile application.
- Send the image to a Python-based AI/ML analysis service.
- Identify food items from the submitted image.
- Return estimated calories, carbohydrates, protein, fats, and other available nutrients.
- Display nutrition results in a clear and accessible format.
- Support future improvements to recognition accuracy and nutrition estimation.
- Search food information through text using CalorieNinjas as a fallback.
- Present available nutrition information when image analysis is unavailable or uncertain.
- Support a flexible food-logging experience.
- Recommend meals according to personal preferences.
- Support regional food choices and culturally familiar meals.
- Consider religious requirements such as halal preferences.
- Provide a foundation for customized calorie and nutrient targets.
- Track meals and estimated calorie intake.
- Record water and hydration progress.
- Monitor sleep and daily activity.
- Support step count, heart rate, and workout information where data is available.
- Display progress through a centralized dashboard.
- Display guided workout routines.
- Use Lottie animations to make exercise instructions more engaging.
- Organize routines by activity type, duration, or fitness goal.
- Support progress tracking for completed workouts.
- Hydration reminders.
- Meal and nutrition reminders.
- Sleep schedule reminders.
- Workout notifications.
- Configurable notification preferences and schedules.
- Cache selected content locally with AsyncStorage.
- Make key information available during temporary connectivity loss.
- Store selected data locally for continued access.
- Provide a foundation for future synchronization improvements.
- Prepare for synchronization with health and fitness devices.
- Support a future connection with devices such as Fitbit or Mi Band.
- Provide a modular structure for importing steps, heart rate, sleep, and workout data.
- The user creates an account and completes the onboarding process.
- NutriSense collects goals, dietary preferences, region, and relevant restrictions.
- The user captures a food image or searches for a meal manually.
- The image is sent to the Python AI/ML analysis service.
- The service returns an estimated food and nutrition result.
- The user reviews calories, carbohydrates, protein, fats, and other available information.
- The user receives meal, hydration, and workout suggestions.
- Daily activity is displayed on the progress dashboard.
- Selected information remains available when the device is offline.
| Layer | Technologies |
|---|---|
| Mobile application | React Native, Expo, TypeScript |
| Navigation and UI | React Navigation, reusable React Native components |
| AI/ML service | Python-based food image analysis and nutrition estimation |
| Food image analysis | Python AI/ML processing service |
| Animations | Lottie |
| Authentication | Firebase Authentication |
| Cloud database | Cloud Firestore |
| Local persistence | AsyncStorage, local JSON data |
| Food and nutrition APIs | LogMeal, CalorieNinjas, Spoonacular |
| Development tools | Visual Studio Code, Expo Go, Android Emulator |
| Testing and debugging | Expo development tools, Firebase Console, browser debugging tools |
- Authentication and onboarding: account creation, sign-in, profile setup, and preferences.
- Nutrition: food image scanning, AI/ML analysis, food search, nutrition results, meal history, and meal planning.
- Python AI/ML service: image processing, food recognition, and estimated nutrition analysis.
- Health dashboard: calories, carbohydrates, protein, hydration, sleep, activity, and progress summaries.
- Workout: routines, exercise animations, completion tracking, and goals.
- Notifications: reminder creation, scheduling, and preference management.
- Offline storage: local cache, offline data access, and synchronization preparation.
- Profile and settings: user preferences, privacy controls, dietary requirements, and account management.
- Expert support foundation: planned communication and professional guidance features.
NutriSense follows a modular client-cloud architecture with a Python AI/ML service for food image analysis:
βββββββββββββββββββββββββββββββββββββββββββββββ
β NutriSense Mobile App β
β React Native + Expo + TypeScript β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β UI Screens β’ Navigation β’ State β’ Validationβ
β Nutrition β’ Health β’ Workout β’ Notificationsβ
βββββββββββββββββ¬ββββββββββββββββ¬ββββββββββββββ
β β
β β
βββββββββββΌββββββββββ βββββΌβββββββββββββββββ
β Firebase Services β β Python AI/ML β
β Auth + Firestore β β Food Image Service β
βββββββββββ¬ββββββββββ βββββ¬βββββββββββββββββ
β β
β βββββββββΌββββββββββββββββ
β β Food Recognition and β
β β Nutrition Estimation β
β βββββββββ¬ββββββββββββββββ
β β
βββββββββ¬ββββββββ
β
ββββββββββΌβββββββββ
β Local Data Layerβ
β AsyncStorage β
β Offline JSON β
βββββββββββββββββββ
The mobile application communicates with Firebase for authentication and cloud data, sends food images to the Python AI/ML service for analysis, uses external nutrition services where configured, and stores selected information locally for offline access.
The exact folders may change during development. The project is organized around the following structure:
NutriSence/
βββ assets/ # Images, icons, fonts, and animations
βββ components/ # Reusable UI components
βββ constants/ # Theme, colors, configuration, and static values
βββ data/ # Local JSON and offline content
βββ hooks/ # Reusable React hooks
βββ navigation/ # Navigation configuration
βββ screens/ # Application screens
βββ services/ # Firebase, API, notification, and storage services
βββ types/ # Shared TypeScript types and interfaces
βββ utils/ # Validation, formatting, and helper functions
βββ app.json # Expo configuration
βββ package.json # Project dependencies and scripts
βββ README.md # Project documentation
If the Python AI/ML service is maintained in the same repository, it can be organized in a separate backend directory, for example:
backend/
βββ app/ # Python service source code
βββ models/ # AI/ML model files or loading logic
βββ services/ # Image processing and nutrition services
βββ requirements.txt # Python dependencies
βββ README.md # Backend-specific instructions
Use this backend structure only if it matches the actual repository.
Before running the project, install or configure the following:
- Node.js LTS.
- npm or another compatible package manager.
- Python 3.x for the AI/ML service.
- Expo development tools.
- Expo Go on a compatible mobile device, or an Android emulator/iOS simulator.
- A Firebase project for authentication and Firestore features.
- API credentials for the external services used by your local configuration.
Clone the repository:
git clone https://github.com/izharahmaad/NutriSence.git
cd NutriSenceInstall JavaScript dependencies:
npm installStart the Expo development server:
npx expo startYou can then:
- Scan the QR code with Expo Go.
- Press
ato open an Android emulator. - Press
ito open an iOS simulator on macOS. - Press
wto open a web development build if web support is configured.
If the Python service is included in the repository, open its directory and create a virtual environment:
cd backend
python -m venv .venvActivate the virtual environment on Windows PowerShell:
.venv\Scripts\Activate.ps1Activate it on macOS or Linux:
source .venv/bin/activateInstall Python dependencies:
pip install -r requirements.txtStart the Python service using the command configured by the project. For a FastAPI-based service, the command may be:
uvicorn app.main:app --reloadUse the actual module path and startup command defined in your Python project.
Do not commit API keys, private credentials, service-account files, model secrets, or other sensitive information to GitHub. Create local environment files according to the configuration used by the mobile application and Python service.
Example mobile configuration:
EXPO_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key
EXPO_PUBLIC_FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain
EXPO_PUBLIC_FIREBASE_PROJECT_ID=your_firebase_project_id
EXPO_PUBLIC_FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucket
EXPO_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_firebase_sender_id
EXPO_PUBLIC_FIREBASE_APP_ID=your_firebase_app_id
EXPO_PUBLIC_LOGMEAL_API_KEY=your_logmeal_api_key
EXPO_PUBLIC_CALORIENINJAS_API_KEY=your_calorieninjas_api_key
EXPO_PUBLIC_SPOONACULAR_API_KEY=your_spoonacular_api_key
EXPO_PUBLIC_AI_SERVICE_URL=http://your-python-service-urlExample Python service configuration:
MODEL_PATH=path_to_your_model
LOGMEAL_API_KEY=your_logmeal_api_key
CALORIENINJAS_API_KEY=your_calorieninjas_api_keyUse only the variables that the application actually reads. Add environment files to .gitignore:
.env
.env.*
!.env.example
.venv/
__pycache__/Values exposed through a mobile application should not be treated as server-side secrets. Sensitive operations should be moved to a secure backend or protected server function.
# Start the development server
npx expo start
# Start with a cleared Metro cache
npx expo start -c
# Check the project for common issues
npx expo-doctor
# Run the TypeScript compiler without emitting files
npx tsc --noEmit# Activate the virtual environment on Windows PowerShell
.venv\Scripts\Activate.ps1
# Install Python dependencies
pip install -r requirements.txt
# Start a FastAPI service if configured in the project
uvicorn app.main:app --reloadThe available commands depend on the scripts, dependencies, and service structure defined in the project.
NutriSense may process profile information, dietary preferences, food images, nutrition records, activity information, and data returned by connected services. The application should:
- Collect only information required for the selected feature.
- Explain how user data and food images are stored and used.
- Protect Firestore data with appropriate security rules.
- Avoid storing sensitive API keys in the mobile client.
- Secure communication between the mobile application and Python service.
- Provide users with appropriate account and data-management options.
- Treat health-related information and food images as sensitive.
- Avoid presenting estimated nutrition data as medical advice.
The project can be tested through the following workflow:
- Run the mobile application with Expo Go or an emulator.
- Start the Python AI/ML service locally or connect to its configured endpoint.
- Test onboarding, authentication, and profile updates.
- Test image capture, image upload, and food analysis.
- Verify returned calories, carbohydrates, protein, fats, and other nutrition fields.
- Test invalid, empty, large, and low-quality images.
- Test API failure and text-search fallback behavior.
- Test empty, invalid, and slow network responses.
- Test offline access and reconnection behavior.
- Test notification permissions and reminder scheduling.
- Test Firestore reads, writes, and security rules.
- Test different screen sizes and accessibility settings.
- Run TypeScript checks and review console warnings before committing.
- Test Python endpoints and model inference using representative food images.
The following improvements are planned for future versions of NutriSense:
- Improve food recognition for regional and homemade meals.
- Add portion-size estimation and confidence indicators.
- Improve carbohydrate, protein, fat, calorie, and nutrient estimation.
- Support barcode scanning and packaged-food labels.
- Add ingredient and allergen detection.
- Improve image preprocessing for different lighting and image quality.
- Allow users to correct detected food items and nutrition results.
- Improve meal recommendations using user history and feedback.
- Add configurable calorie and nutrient targets.
- Improve support for weight management, muscle gain, and general wellness goals.
- Add meal replacement and ingredient-substitution suggestions.
- Add regional food databases for Pakistani and South Asian meals.
- Improve halal, vegetarian, vegan, allergy, and intolerance filters.
- Add weekly and monthly progress reports.
- Add charts for calories, carbohydrates, protein, hydration, sleep, activity, and workout consistency.
- Add habit streaks and progress milestones.
- Improve manual health-data entry and validation.
- Improve Fitbit and Mi Band synchronization.
- Improve local data storage for offline use.
- Queue selected actions while the device is offline.
- Synchronize pending data when connectivity returns.
- Display synchronization status and last-updated information.
- Improve access to saved meal plans and nutrition information offline.
- Add explanations for AI-generated nutrition recommendations.
- Add confidence indicators and correction options for food recognition.
- Improve safety handling for medical and allergy-related questions.
- Provide clearer guidance to consult qualified health professionals when appropriate.
- Improve monitoring of inaccurate results and external API errors.
- Add dark mode and improved accessibility support.
- Add multilingual support, including Urdu and English.
- Improve onboarding and first-time user guidance.
- Add customizable dashboard sections.
- Improve screen-reader labels and text-size support.
- Add verified dietitian and fitness-professional support.
- Add educational nutrition content.
- Add recipe sharing with nutritional information.
- Add a moderated expert-support feature with clear health disclaimers.
- Add unit, integration, and end-to-end testing.
- Add continuous integration with GitHub Actions.
- Add automated linting and type checking for pull requests.
- Improve error handling and performance monitoring.
- Add secure backend functions for protected API calls.
- Improve deployment and release documentation.
- Nutrition results from AI/ML models and external APIs are estimates.
- Food recognition can be affected by image quality, lighting, ingredients, preparation methods, and portion visibility.
- A single food image may contain multiple ingredients that are difficult to identify accurately.
- Nutrition values may vary between recipes, brands, serving sizes, and regional dishes.
- Wearable support depends on device availability, platform permissions, and API access.
- Offline functionality may not include every feature.
- Users with medical conditions, allergies, or special dietary needs should consult a qualified professional.
NutriSense was developed as a Bachelor of Computer Science final-year academic project at Abdul Wali Khan University Mardan.
- Developer: Izhar Ahmad
- Degree: Bachelor of Computer Science
- Study period: 2021β2025
- Supervisor: Mr. Arjumand Yar Khan
Contributions, suggestions, and issue reports are welcome while the project is under development.
-
Fork the repository.
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make focused changes and test them locally.
-
Commit your work:
git commit -m "Describe your change" -
Push the branch:
git push origin feature/your-feature-name
-
Open a pull request with a clear title, description, testing notes, and screenshots where useful.
Please do not include secrets, private credentials, model files, or unrelated changes in a pull request.
License details should be added before public distribution. If this project is intended to remain proprietary, replace this section with the appropriate copyright and usage notice. If you choose an open-source license, add the matching LICENSE file to the repository.
- Developer: Izhar Ahmad
- GitHub: @izharahmaad
- Project: NutriSence
Made with React Native, Expo, TypeScript, Python, AI/ML, and Firebase, with a focus on personalized and culturally aware digital wellness. π