How vinay-daripelly/eco-craft works
Project type and purpose
• This is a mobile, Android-native, full-stack application (“Ecocraft”) written in Kotlin.
• Its purpose is to let users (individuals or organizations) upload images of plastic waste, identify the resin type using an on-device TensorFlow Lite model, generate upcycling suggestions via an external LLM API, and track/manage submissions via Firebase.
File structure
• Top-level build files (build.gradle, settings.gradle, gradle/…) configure an Android Gradle project.
• Single module “app/” contains:
• AndroidManifest.xml, resource folders (res/layout, drawables, values)
• src/main/java/com/example/ecocraftplastic: Activity classes (HomeActivity, LoginActivity, PlasticDetectionActivity, etc.), Constants.kt and SuggestionService.kt
• src/main/assets/model_unquant.tflite: on-device ML model
• src/main/res/xml/data_extraction_rules.xml, backup_rules.xml: Android backup/data extraction
• src/androidTest and src/test: instrumented and unit tests
• No separate “backend” code—backend responsibilities are offloaded to Firebase (Auth, Firestore, Storage).
README for additional insights
• ML model for plastic classification runs locally (TensorFlow Lite).
• LLM integration (e.g., Gemini Pro) is called via SuggestionService.kt.
• Firebase Auth handles user identity; Firestore stores submissions and dashboard data; Cloud Storage may store image files.
• MPAndroidChart (or equivalent) for charts in Organization mode.
Detailed component breakdown (
• Android Client container
• UI: HomeActivity, PlasticDetectionActivity, etc.
• ML Inference Engine (model_unquant.tflite)
• Networking: SuggestionService → LLM API
• Local Data Handler (if any caching, e.g., SharedPreferences via Constants.kt)
• Cloud container
• Firebase Auth
• Firestore (Collections: detections, suggestions, recycle_requests)
• Cloud Storage (bucket for images)
• LLM API endpoint
• Flows:
1. Auth token → Firestore
2. ML inference → local → SuggestionService call
3. Firestore read/write → UI updates
4. Admin actions → Firestore updates → UI notifications