KomposVision is an offline-first mobile app that classifies waste in real time on the device and helps users track compost batches and learn sustainable practices. The final mobile app lives in komposvision_final/ and runs fully on-device β no network required.
π 1st Place β IYREF 2026 (Integrated Youth Renewable Energy Festival)
Features Β· Engineering Highlights Β· Architecture Β· Quick Start Β· Roadmap
- About the Project
- Features
- Engineering Highlights
- Architecture
- Tech Stack
- Project Structure
- Quick Start
- Environment Variables
- API Documentation
- Roadmap
- Running Tests
- Deployment
- Contributing
- Team
- License
KomposVision helps households and communities compost smarter by combining:
- Real-time on-device computer vision that classifies waste as organic vs inorganic
- Sorting guidance so only compostable material goes into the pile
- Offline-first progress tracking for compost batches and activities
- Guided learning via a materials guide and a local composting assistant
Everything in the mobile app runs on the device β inference, storage, and guidance all work with zero connectivity. An optional FastAPI backend exists for shared/online scenarios but is not required.
Point the camera at waste and get live, on-device results:
- Organic vs inorganic classification rendered directly over the camera feed
- Per-object confidence, updated continuously as you move the camera
- Runs entirely on-device with TensorFlow Lite β no network, no upload
- All data persisted locally with WatermelonDB (SQLite over JSI)
- Full functionality with zero connectivity
- Save a scan as a compost batch
- Log materials, activities, and progress over time
- Review composition summaries and history
- Practical do/don't guidance on what to compost and how
- Rule-based composting Q&A that uses your local batch context β works offline
The scan screen is the technical centerpiece β a fully on-device, real-time inference pipeline:
- 100% on-device inference. No frames or images ever leave the phone.
- Worklet-based frame processing. Camera frames are processed in a worklet; the YOLO11 decode + Non-Maximum Suppression run inside the worklet, so raw
TypedArray/ArrayBuffertensors are never serialized across the JS bridge β only the final β€20 plain detection objects cross to the JS thread viarunOnJS. - Stable frame-callback identity. The TFLite model is held in a
Synchronizablecontainer so the frame callback keeps a stable identity when the model finishes loading β avoiding Android view re-attach (addViewAt) crashes. - GPU resize to 640Γ640 RGB float32 via
react-native-vision-camera-resizerbefore inference. - Offline-first persistence with WatermelonDB (reactive SQLite over JSI).
- New Architecture + Hermes, NativeWind v4 styling, Expo Router file-based navigation.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Expo React Native App (offline-first) β
β Tabs: Scan Β· Progress Β· Materials Β· Chat β
βββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββ΄ββββββββββββββββββββββ
βΌ βΌ
ββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββ
β Real-time Vision (TFLite) β β Local Storage β
β on-device, in a worklet β β WatermelonDB (SQLite/JSI) β
β β β batches Β· scans Β· β
β organic / inorganic β β activities Β· materials Β· β
β live overlay β β profiles β
ββββββββββββββββ¬ββββββββββββββ ββββββββββββββββββββββββββββββ
β capture snapshot
βΌ
ββββββββββββββββββββββββββββββ
β Result + Compost Advisor β βββΊ saved to WatermelonDB
β organic/inorganic summary β
β + sorting guidance β
ββββββββββββββββββββββββββββββ
(optional β the app does not require it)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β KomposVision Online Backend β FastAPI + Supabase + Gemini β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Camera frame (YUV)
β react-native-vision-camera frame processor (worklet)
βΌ
Resize β 640Γ640 RGB float32 (vision-camera-resizer, GPU)
β
βΌ
TFLite YOLO11 runSync (react-native-fast-tflite)
β output [1, 4 + numClasses, 8400]
βΌ
Decode + NMS (inside the worklet; only β€20 plain boxes cross to JS)
β
βΌ
Live overlay: organic / inorganic + confidence
| Layer | Technology |
|---|---|
| Mobile | Expo SDK 54, React Native 0.81, React 19, TypeScript 5.9 |
| UI | NativeWind (Tailwind), Expo Router, React Navigation |
| Vision (on-device) | TensorFlow Lite Β· react-native-fast-tflite Β· react-native-vision-camera Β· YOLOv11 (organic/inorganic) |
| Concurrency | react-native-worklets / worklets-core (frame processing + NMS) |
| Storage | WatermelonDB (SQLite over JSI) |
| Backend (optional) | FastAPI Β· Supabase Β· Gemini API |
KomposVision/
βββ komposvision_final/ # Final mobile app (Expo)
β βββ app/ # Screens & routes (Expo Router)
β βββ assets/ # Images + TFLite models
β βββ components/ # Reusable UI components
β βββ database/ # WatermelonDB schema & models
β βββ services/ # Vision + composting services
β βββ utils/ # Helpers & advisors
βββ KomposVision_Online_Backend/ # Optional FastAPI backend
βββ komposvision-enterprise-frontend/ # Optional web dashboard
- Node.js v18+
- Expo CLI
- Android Studio or Xcode (real-time camera + TFLite require a native dev build)
cd komposvision_final
npm installnpm run startCamera + TFLite need a development build (they don't run in Expo Go):
npm run androidAndroid builds require JDK 17 (
org.gradle.java.homeinandroid/gradle.properties).
The mobile app runs fully offline and does not require environment variables.
If you use the optional backend, create KomposVision_Online_Backend/backend/.env with:
| Variable | Description |
|---|---|
SUPABASE_URL |
Supabase project URL |
SUPABASE_KEY |
Supabase service role key |
GEMINI_API_KEY |
Gemini API key |
The mobile app needs no API. When the optional backend is running, FastAPI docs are available at:
http://localhost:8000/docs
| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Service health check |
POST |
/scan |
Analyze a waste image |
POST |
/chat |
Composting Q&A assistant |
GET |
/progress |
Compost progress summary |
GET |
/materials |
Materials guide |
Planned work, in honest order of maturity:
- On-device C:N (carbon:nitrogen) segmentation β a YOLOv11-seg model is bundled in the app; pixel-level C/N composition and ratio estimation are planned but not yet trained/enabled. The app currently reports organic vs inorganic only.
- Contaminant-class detection β distinguishing specific non-compostables (plastic, metal, glass) beyond the organic/inorganic split.
- Image-from-gallery analysis β re-running inference on a chosen static image (today, analysis is real-time camera only).
No automated tests are configured yet. Linting and type-checking:
cd komposvision_final
npm run lint
npx tsc --noEmitcd komposvision_final
eas build -p androidcd KomposVision_Online_Backend
uvicorn backend.main:app --reloadgit checkout -b feat/your-feature-namecd komposvision_final
npm run start- Keep components small and focused.
- Prefer hooks for stateful logic.
- Match the existing structure in
components/,services/, anddatabase/.
Follow Conventional Commits:
feat: add compost batch reminders
fix: handle empty scan results
docs: update vision pipeline diagram
- Target the
mainbranch - Describe what and why
- Reference any related issues
KomposVision was built with β€οΈ by:
| Name | Role |
|---|---|
| Manta Yuana | Backend & Project Manager |
| Kadek Pindra | Frontend & Integration |
| Nova Andini | AI & Data Engineering |
| Dewa Surya | Frontend & UI/UX Designer |
This project is licensed under the MIT License. See LICENSE for details.
Built for sustainable communities Β· KomposVision
