
How We Built RE—EARTH: A 3D Campus E-Waste Platform Using AWS Cedar, Amplify, S3, and CloudWatch
RE—EARTH is a browser-based 3D planet where college campuses compete to recycle e-waste — built with React, Three.js, and a full AWS stack including Cedar policy enforcement, Amplify hosting, S3 audit storage, and CloudWatch monitoring.
What is RE—EARTH?
RE—EARTH is a web app that turns e-waste recycling into a campus-wide competition. Students drop off old phones, laptops, and batteries at a kiosk. The kiosk operator scans, weighs, and wipes the device. The campus earns points. Those points grow a 3D cybernetic forest on a spinning Earth in the browser. The more you recycle, the greener your planet looks.
Live app: https://main.d3cukmq7nr5vg3.amplifyapp.com
GitHub: https://github.com/kamilahmadhashmi/re-earth
GitHub: https://github.com/kamilahmadhashmi/re-earth
The Problem
E-waste is the fastest-growing waste stream in the world. Most colleges have no system to track it. Devices pile up in drawers. Data is never wiped. Nothing is verified. RE—EARTH fixes that — it gives students a reason to recycle, gives operators a proper workflow, and gives admins a signed certificate they can actually use for compliance.
How We Used AWS Open Source
1. AWS Cedar Policy Language
We used the open-source
cedar-policy engine to write safety rules for the kiosk. Cedar lets you write policies in a clean, readable syntax. We used it to block dangerous devices — for example, a swollen battery cannot go into a storage locker without an operator override.1
2
3
4
5
6
7
8
9
10
11
12
13
permit(
principal == Role::"KioskOperator",
action == Action::"StoreDevice",
resource == Device::"SafeDevice"
);
forbid(
principal,
action == Action::"StoreDevice",
resource == Device::"SwollenBattery"
) unless {
principal has override && principal.override == true
};This runs client-side and enforces rules before anything is submitted. It is lightweight, readable, and open source — no server needed.
2. AWS SDK + LocalStack
We used the AWS SDK (
@aws-sdk/client-s3) to upload signed recycling certificates to S3. During local development, we ran LocalStack to emulate S3 and CloudWatch on our own machine — no AWS charges, no network calls. This let us test the full upload flow offline before pointing it at real AWS.How We Used AWS Cloud Services
AWS Amplify Hosting
We deployed RE—EARTH on AWS Amplify. It handles our CDN, HTTPS, and SPA routing rewrites automatically. We push to GitHub and Amplify builds and deploys. The app loads in under 2 seconds globally because of Amplify's edge network.
Amazon S3 — Audit Vault
Every recycled device generates a certificate. That certificate is a JSON file with a SHA-256 hash, device info, weight, and a QR code. We store these in an S3 bucket following NIST SP 800-88 R1 guidelines. Students can scan the QR and verify their drop-off was real. Colleges can use this for EPR compliance reporting.
Amazon CloudWatch
We set up two alarms:
RE-EARTH-Amplify-Endpoint-Health— fires if the app goes downRE-EARTH-Amplify-Endpoint-Latency— fires if load time spikes
Both feed into an ops dashboard so we can see the app's health at a glance. We also ran CloudWatch Synthetics to ping the live URL every 5 minutes and confirm it returns HTTP 200.
Architecture
1
2
3
4
5
6
7
8
9
[ Student Browser / Campus Kiosk ]
|
Cedar Policy Engine (client-side, open source)
|
AWS Amplify (hosting + CDN + SPA rewrites)
|
Amazon S3 (recycling certificates, SHA-256 proofs)
|
Amazon CloudWatch (health alarms + ops dashboard)Tech Stack
- Frontend: React 18 + TypeScript + Vite
- 3D Engine: Three.js via @react-three/fiber
- State: Zustand
- AWS Open Source: Cedar Policy, AWS SDK, LocalStack
- AWS Cloud: Amplify, S3, CloudWatch
- Language split: 90.6% TypeScript, 6.5% JavaScript
What We Learned
Cedar is surprisingly easy to use for access control rules. Writing policies in Cedar felt cleaner than writing if/else chains in JavaScript. LocalStack saved us a lot of time — we could test S3 uploads without spending credits. Amplify made deployment almost invisible — the hardest part was setting the right SPA rewrite rule, and even that took only five minutes.
If you are building a sustainability or civic tech app on AWS, this stack works. The open source tools are well-documented. The managed services are cheap at small scale. Cedar + S3 together give you an audit trail that actually holds up.
Try It
Live: https://main.d3cukmq7nr5vg3.amplifyapp.com
Code: https://github.com/kamilahmadhashmi/re-earth
Code: https://github.com/kamilahmadhashmi/re-earth
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article