Inspiration Construction and demolition waste accounts for over 30% of all solid waste globally — yet most of it ends up in landfills despite being perfectly recyclable. We were inspired by the gap between the circular economy vision and the reality on demolition sites: contractors don't know who wants their waste, recyclers don't know what's available nearby, and there's no system connecting them. We wanted to build the infrastructure layer that closes this loop — not just a marketplace, but an intelligent network that tracks the environmental impact of every kilogram diverted from landfill.
What it does The Construction Waste Intelligence Platform is a role-based circular economy marketplace with four distinct user types:
Producers (contractors/demolition sites) — publish waste listings with material type, weight, and price. AI-powered YOLOv8 scanning classifies materials directly from site photos.
Consumers/Buyers — browse the marketplace, purchase materials with delivery address, and track their personal ESG impact (CO₂ offset, energy saved, tonnes diverted).
Drivers — see available pickup jobs generated from purchases, accept them, and mark deliveries complete. Each driver has their own independent job history.
Recyclers — browse procurement marketplace filtered by material type, configure facility capacity and accepted materials, and track real-time processing metrics.
Every ESG metric — CO₂ saved, energy preserved, landfill diversion — is calculated from actual material weights entered during listing publication using IPCC AR6 emission factors, not estimates.
How we built it Frontend — Next.js 16 with Tailwind CSS, deployed on Vercel. Role-based routing with a UserContext using sessionStorage for tab-isolated sessions so multiple users can be logged in simultaneously across different browser tabs.
Backend — FastAPI with SQLAlchemy ORM, deployed on Render. Full CRUD endpoints for listings, auth, transactions, and logistics with role-based access control.
Database — PostgreSQL 18 with PostGIS extension on Render for geospatial queries. ST_DistanceSphere for proximity matching between waste sources and recyclers.
AI Service — Decoupled FastAPI microservice running YOLOv8 (Ultralytics) for waste material classification from uploaded site images.
Infrastructure — Nginx reverse proxy, Redis for background queue orchestration, Docker Compose for local development, Alembic for database migrations.
ESG Engine — Custom carbonCalc.ts library using IPCC AR6, EPA WARM model, and ICE Database v3.0 emission factors. Calculations are weight-based: CO₂ saved = weight_kg × emission_factor[material_type].
Challenges we ran into Multi-tab session isolation — localStorage is shared across browser tabs, causing role switching when multiple users were logged in simultaneously. Solved by migrating session identity (role, email, token) to sessionStorage which is tab-scoped.
Hydration mismatches — Next.js SSR rendered components before localStorage was accessible, causing React hydration errors. Fixed by moving all client-side storage reads into useEffect and using a UserContext provider that initializes after mount.
PostGIS on Render free tier — The alembic upgrade head migration was failing because the Dockerfile was using the hardcoded db hostname from docker-compose instead of the DATABASE_URL environment variable. Fixed by passing the URL via both -x db_url CLI flag and environment variable override in env.py.
Role contamination between users — Consumer purchases were accidentally writing to user_listings (a producer-only key) via the scoped storage utility, making the consumer's dashboard appear as a producer dashboard. Fixed by strictly separating which storage keys each role can write to.
Git submodule conflict — The frontend/ directory had its own .git folder, causing GitHub to treat it as a submodule pointer rather than actual files. Fixed by removing the nested .git and re-adding frontend as normal tracked files.
Accomplishments that we're proud of True multi-role platform — Four completely independent dashboards (Producer, Consumer, Driver, Recycler) each with role-appropriate CRUD operations, navigation, and data isolation.
Real ESG calculations — Every CO₂, energy, and landfill metric is derived from actual weight_kg values entered during listing publication — not price estimates or mock data.
Tab-isolated sessions — Multiple users can be logged in simultaneously across different browser tabs without interfering with each other's sessions or data.
Full deployment pipeline — Frontend on Vercel (always-on), backend + PostgreSQL on Render (free tier), all wired together with environment variables and automatic Alembic migrations on deploy.
Per-user data scoping — Every user's purchase history, listings, and job history is namespaced by email (cwi:email:key) so data never leaks between accounts.
What we learned sessionStorage vs localStorage is a critical distinction for multi-user web apps — session identity should always be tab-scoped.
React Context is the right tool for app-wide state that must never be re-read from external storage during navigation.
PostGIS migrations require careful SQL syntax — UNIQUE ON DELETE is invalid; UNIQUE must precede REFERENCES.
Decoupling the AI service from the backend allows independent scaling and prevents heavy ML model loading from blocking API responses.
ESG reporting is only credible when tied to verified physical measurements — weight-based calculations are fundamentally more accurate than price-derived estimates.
What's next for Circular Construction OS Waste Passport NFTs — Mint tamper-proof digital certificates on-chain for every material transfer, providing immutable chain-of-custody for ESG reporting.
Real-time PostGIS matching — Auto-match waste listings to the nearest recycler facility using ST_DistanceSphere and push notifications when a match is found.
Live AI scanning — Integrate the YOLOv8 microservice with the frontend camera for real-time material classification on mobile devices at demolition sites.
Carbon credit marketplace — Convert verified CO₂ offsets into tradeable credits that producers and recyclers can sell to corporate ESG buyers.
Driver route optimization — Multi-stop route planning using OpenRouteService API to batch multiple pickups into a single optimized driver run.
Regulatory compliance exports — Auto-generate PDF waste manifests and ESG reports in formats accepted by EU Waste Framework Directive and US EPA reporting standards.
Built With
- axios
- bcryptjs
- blockchain
- cdw-seg-dataset
- computer-vision
- crypto
- css3
- epa-data
- express.js
- framer
- git
- github
- html5
- iso-14001
- javascript
- jwt
- leed-standards
- lucide-icons
- mobilenet
- mongodb
- multer
- node.js
- npm
- react
- react-router
- recharts
- rest-api
- sha-256
- vercel
- yolo
Log in or sign up for Devpost to join the conversation.