Skip to content

pasindudilshan1/SmartCart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ SmartCart – Food Waste Reduction App

SmartCart Logo

A cross-platform mobile app that helps households minimize food waste through barcode scanning, smart inventory management, and nutritional tracking

Flutter Firebase License Dart

✨ PRODUCTION-READY WITH AZURE INTEGRATION & REAL BARCODE SCANNING! ✨


πŸ“‘ Table of Contents


πŸ”₯ What's New

βœ… Azure Authentication - Secure user accounts with Azure authentication services
βœ… Azure Table Storage - Cloud-based data storage with Azure integration
βœ… Real Barcode Scanning - Scan actual product barcodes with your camera using mobile_scanner
βœ… Open Food Facts API - Automatic product info lookup from 2+ million products
βœ… Household Management - Multi-member household setup and nutrition tracking
βœ… Offline Support - Works without internet using Hive local storage
βœ… Shopping List - Integrated cloud-synced shopping list feature
βœ… Nutrition Insights - Track household nutrition needs and dietary preferences


🌱 Project Overview

SmartCart is a cross-platform mobile application built with Flutter that helps households reduce food waste by making smarter grocery purchasing decisions. The app integrates barcode scanning, Azure cloud storage, household nutrition tracking, and inventory management to promote responsible consumption.

🎯 Key Goals

  • Reduce household food waste at the point of purchase
  • Align grocery decisions with household nutritional needs
  • Promote sustainability through awareness and insights
  • Provide cloud-synced inventory management via Azure
  • Enable household member management and personalized nutrition tracking

🌍 SDG Contribution

This project directly contributes to:

  • SDG 12: Responsible Consumption and Production
  • SDG 2: Zero Hunger
  • SDG 13: Climate Action (reduced food waste = reduced emissions)

πŸ’‘ Core Features

Feature Status Description
πŸ” User Authentication βœ… LIVE Azure authentication with secure login/signup
πŸ“· Barcode Scanning βœ… LIVE Scan real product barcodes using mobile_scanner
🌍 Product Database βœ… LIVE Access to 2+ million products via Open Food Facts
☁️ Cloud Storage βœ… LIVE Azure Table Storage for cloud data persistence
πŸ“¦ Smart Inventory βœ… LIVE Track products with expiry, quantities, categories
🍎 Nutrition Data βœ… LIVE Automatic nutrition info from Open Food Facts
πŸ‘₯ Household Management βœ… LIVE Multi-member household setup and tracking
⚠️ Expiry Alerts βœ… LIVE Get notified about expiring products
πŸ›’ Shopping List βœ… LIVE Cloud-synced shopping list management
πŸ“± Offline Mode βœ… LIVE Works offline with Hive local storage
🎨 Onboarding βœ… LIVE Interactive introduction screens for new users

🧱 Tech Stack

Layer Tools & Frameworks
Language Dart 3.0+
Framework Flutter 3.0+
Authentication Azure Authentication Services
Cloud Storage Azure Table Storage
Local Database Hive (NoSQL, offline storage)
State Management Provider
Barcode API Open Food Facts API
Scanner mobile_scanner, qr_code_scanner
API Client Dio (HTTP), http
Charts fl_chart
UI Material Design 3, Google Fonts
Permissions permission_handler
PDF Export pdf, printing
Onboarding introduction_screen

πŸš€ Quick Start

Prerequisites

  • Flutter SDK 3.0+ (Install Flutter)
  • Dart SDK 3.0+
  • VS Code or Android Studio with Flutter extensions
  • Git
  • Azure account with Table Storage configured
  • For Android: Android SDK, emulator or physical device
  • For Windows: Windows 10+ (for Windows desktop builds)

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/smartcart.git
    cd smartcart
  2. Install dependencies

    flutter pub get

    Or use the setup script:

    .\scripts\setup.ps1 get
  3. Configure Azure credentials (Important!)

    Copy-Item lib\config\azure_config.dart.template lib\config\azure_config.dart

    Edit lib/config/azure_config.dart with your Azure Storage account credentials.

    πŸ“š See docs/SETUP_CREDENTIALS.md and docs/AZURE_SETUP.md for details.

  4. Generate Hive adapters

    flutter pub run build_runner build --delete-conflicting-outputs
  5. Run the app

    flutter run

For detailed setup instructions, see docs/QUICK_START.md.


πŸ“‚ Project Structure

smartcart/
β”œβ”€β”€ lib/                          # Main application code
β”‚   β”œβ”€β”€ main.dart                 # App entry point
β”‚   β”œβ”€β”€ config/                   # Configuration files
β”‚   β”‚   β”œβ”€β”€ azure_config.dart     # Azure credentials (gitignored)
β”‚   β”‚   └── azure_config.dart.template
β”‚   β”œβ”€β”€ models/                   # Data models (Hive)
β”‚   β”‚   β”œβ”€β”€ product.dart
β”‚   β”‚   β”œβ”€β”€ household_member.dart
β”‚   β”‚   β”œβ”€β”€ nutrition.dart
β”‚   β”‚   └── sustainability.dart
β”‚   β”œβ”€β”€ screens/                  # UI screens
β”‚   β”‚   β”œβ”€β”€ home_screen.dart
β”‚   β”‚   β”œβ”€β”€ login_screen.dart
β”‚   β”‚   β”œβ”€β”€ register_screen.dart
β”‚   β”‚   β”œβ”€β”€ splash_screen.dart
β”‚   β”‚   β”œβ”€β”€ onboarding_screen.dart
β”‚   β”‚   β”œβ”€β”€ scanner_screen.dart
β”‚   β”‚   β”œβ”€β”€ inventory_screen.dart
β”‚   β”‚   β”œβ”€β”€ initial_inventory_setup_screen.dart
β”‚   β”‚   β”œβ”€β”€ shopping_list_screen.dart
β”‚   β”‚   β”œβ”€β”€ nutrition_screen.dart
β”‚   β”‚   β”œβ”€β”€ household_setup_screen.dart
β”‚   β”‚   β”œβ”€β”€ household_management_screen.dart
β”‚   β”‚   β”œβ”€β”€ household_nutrition_screen.dart
β”‚   β”‚   └── product_detail_screen.dart
β”‚   β”œβ”€β”€ services/                 # Business logic & APIs
β”‚   β”‚   β”œβ”€β”€ azure_auth_service.dart
β”‚   β”‚   β”œβ”€β”€ azure_table_service.dart
β”‚   β”‚   β”œβ”€β”€ barcode_service.dart
β”‚   β”‚   └── local_storage_service.dart
β”‚   β”œβ”€β”€ providers/                # State management
β”‚   β”‚   β”œβ”€β”€ inventory_provider.dart
β”‚   β”‚   └── nutrition_provider.dart
β”‚   └── widgets/                  # Reusable widgets
β”‚       β”œβ”€β”€ product_card.dart
β”‚       └── household_info_card.dart
β”œβ”€β”€ assets/                       # Images, icons
β”‚   β”œβ”€β”€ icons/
β”‚   └── images/
β”œβ”€β”€ android/                      # Android platform code
β”œβ”€β”€ windows/                      # Windows platform code
β”œβ”€β”€ test/                         # Unit & widget tests
β”œβ”€β”€ docs/                         # Documentation
β”‚   β”œβ”€β”€ QUICK_START.md
β”‚   β”œβ”€β”€ BUILD_GUIDE.md
β”‚   β”œβ”€β”€ HOT_RELOAD_GUIDE.md
β”‚   β”œβ”€β”€ SETUP_CREDENTIALS.md
β”‚   β”œβ”€β”€ ARCHITECTURE.md
β”‚   β”œβ”€β”€ FIREBASE_STRUCTURE.md
β”‚   └── ...
β”œβ”€β”€ scripts/                      # Build & setup scripts
β”‚   β”œβ”€β”€ setup.ps1
β”‚   β”œβ”€β”€ build_playstore.ps1
β”‚   β”œβ”€β”€ clean_build_apk.ps1
β”‚   β”œβ”€β”€ quick_build.ps1
β”‚   └── fix_qr_scanner.ps1
β”œβ”€β”€ pubspec.yaml                  # Dependencies
β”œβ”€β”€ analysis_options.yaml         # Linting rules
└── README.md                     # This file

For detailed architecture, see docs/ARCHITECTURE.md.


πŸ”§ Scripts

All scripts are located in the scripts/ folder:

Script Description
setup.ps1 Interactive setup and run helper
build_playstore.ps1 Build release APK/AAB for Play Store
clean_build_apk.ps1 Clean build directory and rebuild APK
quick_build.ps1 Quick debug APK build
fix_qr_scanner.ps1 Fix QR scanner permissions
add_keells_products.ps1 Populate product database with Keells products
add_biscuits_crackers.ps1 Add biscuits and crackers to product database
populate_shopping_list.ps1 Populate shopping list with sample data
save_to_shopping_table.ps1 Save data to Azure shopping table
setup.bat Windows batch setup script

Usage Examples

# Interactive setup
.\scripts\setup.ps1

# Get packages
.\scripts\setup.ps1 get

# Build for production
.\scripts\build_playstore.ps1

# Clean and rebuild
.\scripts\clean_build_apk.ps1

For more details, see docs/BUILD_GUIDE.md.


πŸ“š Documentation

All documentation is organized in the docs/ folder:

Getting Started

Architecture & Design

Azure Integration

Development

Troubleshooting


🀝 Contributing

We welcome contributions! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please ensure:

  • Code follows Dart/Flutter style guidelines
  • All tests pass
  • Documentation is updated
  • No credentials are committed

πŸ“„ License

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


πŸ™ Acknowledgments

  • Open Food Facts - Product database API providing nutrition information
  • Azure - Cloud infrastructure and storage services
  • Flutter Team - Amazing cross-platform framework
  • Keells Supermarket - Product data for Sri Lankan grocery items
  • Contributors - Thank you for your support!


Made with ❀️ for a sustainable future

Reducing food waste, one scan at a time

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors