Skip to content

adelincra/foodapp

Repository files navigation

Food Scan AI

A Flutter application that helps users track their nutritional intake by analyzing food product labels and meals using AI, built with clean MVVM architecture.

Features

  • πŸ“Έ Scan product labels and food items using your device's camera
  • πŸ” AI-powered nutrition analysis using Google's Gemini API
  • πŸ“Š Track daily nutrient intake with detailed breakdowns
  • πŸ“… View historical food consumption data
  • πŸ“ˆ Visual representations of macronutrient distribution
  • ⚑ Real-time nutritional insights and recommendations
  • 🧩 Built with MVVM architecture for clean, maintainable code
  • πŸ”„ Provider for robust state management

Screenshots

FoodScanAI_Recording.mp4
Screenshot 1 Screenshot 2 Screenshot 3
Screenshot 4 Screenshot 5 Screenshot 6

Architecture

Food Scan AI follows the MVVM (Model-View-ViewModel) architecture pattern:

  • Models: Data structures and business logic
  • Views: UI components (screens and widgets)
  • ViewModels: Intermediaries that handle UI logic and data operations
  • Repositories: Abstractions for data sources (AI API, local storage)

Project Structure

lib/
β”œβ”€β”€ core/
β”‚   └── constants/         # App-wide constants
β”œβ”€β”€ config/
β”‚   └── env_config.dart    # Environment configuration
β”œβ”€β”€ models/                # Data models
β”œβ”€β”€ repositories/          # Data access layer with interfaces
β”œβ”€β”€ theme/                 # App theme definitions  
β”œβ”€β”€ viewmodels/            # ViewModels for business logic
β”œβ”€β”€ views/                 # UI components
β”‚   β”œβ”€β”€ screens/           # Full page views
β”‚   └── widgets/           # Reusable UI components
└── main.dart              # Application entry point

Getting Started

Prerequisites

  • Flutter SDK (>=3.4.3)
  • Dart SDK
  • Google Gemini API key

Installation

  1. Clone the repository
git clone https://github.com/nikhileshmeher0204/read_the_label.git
  1. Navigate to the project directory
cd read_the_label
  1. Create a .env file in the root directory and add your Gemini API key:
GEMINI_API_KEY=your_api_key_here
  1. Install dependencies
flutter pub get
  1. Run the app
flutter run

State Management

This application uses Provider for state management:

  • BaseViewModel: Foundation class for all ViewModels
  • ViewModels:
    • UiViewModel: Handles UI state and navigation
    • ProductAnalysisViewModel: Manages product scanning and analysis
    • MealAnalysisViewModel: Handles food image analysis
    • DailyIntakeViewModel: Controls daily consumption tracking

Technologies Used

  • Flutter SDK (>=3.4.3)
  • Dart SDK
  • Google Generative AI (Gemini) for AI-powered analysis
  • Provider for state management
  • SharedPreferences for local storage
  • Material Design 3 with custom theme
  • Various Flutter packages:
    • image_picker for camera integration
    • flutter_dotenv for environment variables
    • fl_chart for data visualization
    • rive for animations

Future Enhancements

  • Spring Boot backend integration for cross-device synchronization
  • User authentication and profiles
  • Enhanced nutritional insights with AI recommendations
  • Social sharing features

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Google Generative AI for the Gemini API
  • Flutter team for the amazing framework

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published