This is the initial MVP of a project tasked to me by the UCSC Sustainability Office: an AI-powered waste auditing application that uses machine learning to assist in determining the state of campus waste sorting.
My initial plan is to start by creating a simple mobile application where users can upload a variety of images of campus trash and tag it with data regarding the types of contaminants/waste in the dumpsters. The goal is to crowdsource this app to sustainability-motivated UCSC students, with the idea of creating a large dataset to train an AI model that can eventually perform this analysis independent of manual tagging.
From here, I will create a model trained on the aforementioned data to be able to utilize computer vision to automatically determine the levels of contamination in a given campus dumpster using PyTorch and TensorFlow to get a better understanding of how accurately garbage and recycling are sorted in their respective bins on campus.
Check out the web app here
Click here to access the application's privacy policy
Before you begin, ensure you have the following installed on your system:
- Flutter SDK (3.8.1 or higher) - Installation Guide
- Git - Installation Guide
- Firebase CLI - Installation Guide
For iOS development (macOS only):
- Xcode (latest stable version) - Available on Mac App Store
- iOS Simulator (included with Xcode)
- CocoaPods - Install with:
sudo gem install cocoapods - Apple Developer Account (for device deployment)
For Android development:
- Android Studio - Download
- Android SDK (API level 21 or higher)
- Java JDK (version 11 or higher)
- Android device or Android Emulator
For Web development:
- Chrome or Edge (recommended browsers for development)
-
Clone the repository:
git clone https://github.com/nchalla3/ucsc-waste-tagging.git cd ucsc-waste-tagging -
Install Flutter dependencies:
flutter pub get
-
Verify your Flutter installation:
flutter doctor
Resolve any issues shown by
flutter doctorbefore proceeding.
This app requires Firebase for authentication, data storage, and image hosting. Follow these steps:
-
Create a Firebase project:
- Go to Firebase Console
- Create a new project or use an existing one
- Enable the following services:
- Authentication (Email/Password and Google Sign-in)
- Cloud Firestore
- Cloud Storage
-
Configure Firebase for your platforms:
For Android:
# Install and configure Firebase CLI if not already done npm install -g firebase-tools firebase login # Initialize Firebase in your project firebase init # Generate Android configuration flutterfire configure --project=your-project-id
This will create
android/app/google-services.jsonFor iOS:
# Use the same flutterfire command, it will also generate iOS config flutterfire configure --project=your-project-idThis will create
ios/Runner/GoogleService-Info.plistFor Web: The same
flutterfire configurecommand will updatelib/firebase_options.dartwith web configuration. -
Enable Authentication providers:
- In Firebase Console, go to Authentication > Sign-in method
- Enable "Email/Password" provider
- Enable "Google" provider and configure OAuth consent screen
-
Set up Firestore security rules:
rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /waste_reports/{document} { allow read, write: if request.auth != null; } } }
-
Set up Storage security rules:
rules_version = '2'; service firebase.storage { match /b/{bucket}/o { match /uploads/{allPaths=**} { allow read, write: if request.auth != null; } } }
-
Open iOS Simulator or connect an iOS device
-
Run the app:
flutter run -d ios
-
For physical device deployment:
- Open
ios/Runner.xcworkspacein Xcode - Select your development team
- Choose your connected device
- Run from Xcode or use
flutter run
- Open
-
Start an Android emulator or connect an Android device
# List available devices flutter devices # Start an emulator (if you have one configured) flutter emulators --launch <emulator_id>
-
Run the app:
flutter run -d android
-
Run the app in Chrome:
flutter run -d chrome
-
Build for web deployment:
flutter build web
The built files will be in the
build/webdirectory.
# Hot reload development
flutter run
# Run with specific device
flutter run -d <device_id>
# Run in release mode
flutter run --releaseAndroid APK:
flutter build apkAndroid App Bundle (recommended for Google Play):
flutter build appbundleiOS (requires macOS and Xcode):
flutter build iosWeb:
flutter build web# Run all tests
flutter test
# Run tests with coverage
flutter test --coverage
# Run integration tests (if available)
flutter drive --target=test_driver/app.dartlib/
βββ main.dart # App entry point
βββ firebase_options.dart # Firebase configuration
βββ screens/ # UI screens
β βββ auth/ # Authentication screens
β βββ home/ # Main app screens
βββ services/ # Business logic and API calls
βββ widgets/ # Reusable UI components
βββ wrappers/ # App-level wrappers
Flutter Doctor Issues:
- Ensure all required tools are installed and in your PATH
- For Android: Make sure ANDROID_HOME environment variable is set
- For iOS: Ensure Xcode command line tools are installed:
xcode-select --install
Firebase Configuration:
- Verify that
google-services.json(Android) andGoogleService-Info.plist(iOS) are in the correct locations - Check that your Firebase project has the required services enabled
- Ensure your app's package name matches your Firebase project configuration
Build Errors:
- Clean your build:
flutter clean && flutter pub get - For iOS:
cd ios && pod install && cd .. - For Android: Delete
android/.gradlefolder and rebuild
Authentication Issues:
- Verify OAuth consent screen is configured in Google Cloud Console
- Check that SHA-1 fingerprints are added for Android (for Google Sign-in)
- Ensure your domain is authorized in Firebase Authentication settings
iOS:
- CocoaPods issues:
cd ios && pod repo update && pod install - Provisioning profile errors: Check signing settings in Xcode
- Simulator not found: Update Xcode or install additional simulators
Android:
- Gradle build failures: Update Android Gradle Plugin and Gradle wrapper
- SDK license issues: Run
flutter doctor --android-licenses - Emulator performance: Enable hardware acceleration in BIOS/UEFI
Web:
- CORS issues: Use
flutter run -d chrome --web-renderer html - Firebase configuration: Ensure web app is properly configured in Firebase Console
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature - Make your changes and test thoroughly
- Commit your changes:
git commit -m "Add new feature" - Push to your branch:
git push origin feature/new-feature - Submit a pull request
This project is developed for the UCSC Sustainability Office. Please contact the project maintainer for licensing information.
For technical issues or questions about the project, please:
- Check the troubleshooting section above
- Search existing issues in the repository
- Create a new issue with detailed information about your problem
This project is developed in partnership with the UC Santa Cruz Sustainability Office to support campus waste reduction and sustainability goals.