Real-time waste classification powered by Amazon Nova on AWS Bedrock. Point a camera at an item and get a bin recommendation:
- WASTE
- RECYCLING
- COMPOST
The app includes smart frame gating to reduce unnecessary Bedrock calls, feedback capture, and simple analytics.
Deploy to your own EC2 instance following the steps in AWS Deployment below.
Once running, your app will be available at https://<your-ec2-ip>.sslip.io (with certbot TLS).
Current hosting stack:
- EC2 (Amazon Linux 2023)
- FastAPI backend as a systemd service (
econova) - nginx serving frontend and proxying API
- Let's Encrypt certificate via certbot
- Bedrock auth through EC2 IAM role (no hardcoded AWS keys)
- Live camera-based classification
- Smart change detection to avoid wasteful inference calls
- Auto-clear when object leaves frame
- Confidence-based agent decision modes
- Feedback endpoint for corrections
- SQLite analytics dashboard data
EcoNova-Guardian/
├── README.md
├── activate_envs.sh
├── backend/
│ ├── main.py
│ ├── ai_client.py
│ ├── agent.py
│ ├── models.py
│ ├── database.py
│ ├── config.py
│ ├── prompts.py
│ └── requirements.txt
├── frontend/
│ ├── index.html
│ ├── app.js
│ └── styles.css
├── deploy/
│ ├── bedrock-policy.json
│ ├── econova.service
│ ├── nginx.conf
│ ├── bootstrap.sh
│ └── deploy_update.sh
└── data/
└── test_images/ # gitkeep only; drop test images here locally
- Python 3.10+
- AWS Bedrock access in your AWS account
- Browser with camera permission
macOS only.
activate_envs.shactivates the backend venv, auto-installs dependencies whenrequirements.txtchanges, opens the frontend server in a new Terminal window, and starts the FastAPI backend — all in one step.
cd EcoNova-Guardian
source activate_envs.shFlags:
--force-install— re-runpip installeven if requirements haven't changed--dev-reload— start uvicorn with--reloadfor live code reloading
Then open:
Backend:
cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000Frontend:
cd frontend
python3 -m http.server 8080Use .env for local dev values.
Required for local runs:
AWS_REGION=us-east-1
BEDROCK_MODEL_ID=us.amazon.nova-lite-v1:0Optional local keys (if not using profile/role):
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_SESSION_TOKEN=Other optional settings:
CONF_HIGH=0.85
CONF_MED=0.7
BEDROCK_DAILY_CAP=0
DATABASE_PATH=data/events.dbOn EC2, prefer IAM role auth.
Do not keep static access keys in .env on server.
GET /healthPOST /classify(multipart form-data with image)POST /feedbackGET /stats
- Create IAM policy from
deploy/bedrock-policy.json - Create IAM role for EC2 and attach that policy
- Launch EC2 instance (open 22, 80, 443)
- Attach the IAM role to the instance
- Run server bootstrap steps (install python/nginx, configure services, certbot)
This repo includes:
deploy/econova.servicedeploy/nginx.confdeploy/bootstrap.sh
After initial EC2 setup, deploy code changes from your local machine with:
./deploy/deploy_update.shWhat it does:
- Syncs
backend/,frontend/, anddeploy/to EC2 - Installs Python dependencies
- Restarts
econova - Reloads
nginx - Prints health check output
Optional overrides:
EC2_HOST=<your-ec2-ip> EC2_KEY=~/Downloads/econova-key.pem ./deploy/deploy_update.shLikely file permission issue on frontend files. Ensure nginx can read:
/home/ec2-user/home/ec2-user/app/home/ec2-user/app/frontend/*
Backend upstream failed. Check:
sudo systemctl status econova --no-pager
sudo journalctl -u econova -n 120 --no-pagerUpdate IAM policy to allow bedrock:InvokeModel for Nova Lite model/inference profile resources used at runtime.
Remove temporary static keys from server .env and use EC2 IAM role credentials.
- EC2
t3.micro: about $7-8/month outside free tier - Bedrock Nova Lite: low cost for hackathon demo traffic
Always stop/terminate EC2 when not demoing.
- Python, FastAPI, Uvicorn
- Vanilla JavaScript, HTML, CSS
- SQLite
- AWS Bedrock + Amazon Nova Lite
- nginx + systemd + certbot
Built for the Amazon Nova AI Hackathon.
