Inspiration
I kept noticing the same thing around my own home: a working monitor in a closet, a chair nobody sat in, a box of books I "meant to donate." None of it was broken. It just sat there, because giving it away felt like more effort than binning it. Multiply that by every home on my street and it is a staggering amount of avoidable waste, and avoidable carbon. I wanted to make giving something away as easy as taking a photo, and make the impact of that tiny act impossible to ignore.
What it does
ReLoop is a hyperlocal give-away map. Snap a photo of something you no longer need, and an AI vision model identifies it, estimates the CO₂ kept out of landfill, and drops it onto a live neighbourhood map. Anyone nearby can search by need ("something to sit on"), reserve an item, get turn-by-turn walking directions to go collect it, and chat to arrange the handoff. A community counter turns every reuse into a number you can actually feel, like trees planted or miles never driven.
How I built it
The frontend is React 19 + TypeScript + Vite + Tailwind, with Leaflet for the map. The backend lives entirely on Supabase (Postgres). The parts I am most proud of:
- Real geospatial: PostGIS with a GiST index. Nearest-item search uses
ST_DWithin/ST_Distance, and I surface the live query latency right in the UI. Hybrid "search by need": item text is embedded with
text-embedding-3-smallinto pgvector (HNSW index). A query is embedded, matched by meaning, then fused with Postgres full-text search using Reciprocal Rank FusionRealtime: Supabase Realtime streams new give-aways to every open map instantly over Postgres logical replication, with presence for "who is br reservation race conditions, client-side image compression, an installable PWA, confetti, and CI (Vitest + typecheck + build) on GitHub Actions, deployed on Vercel.
Challenges I ran into
- Not being a "ChatGPT wrapper." My hard rule: the model classifies, deterministic code computes impact, and every estimate is validated JSON with guardrails.
- Hybrid search. Getting vector and full-text search to agree meant learning Reciprocal Rank Fusion and expressing it in one SQL query across an HNSW and a GIN index.
- Race conditions. Two neighbours reserving the same item at once needed a
SECURITY DEFINERRPC and RLS, not client-side checks. - A sneaky type bug. A
leaflet.heatmodule augmentation silently broke every Leaflet type in the project. Tracking it down taught me a lot about ambient declarations. - Making impact credible. I anchored every number to a published factor and rendered rotating, relatable equivalents so the impact feels big and stays defensible under questions.
What I learned
That "a real system" and "an AI feature" are not the same thing. The AI is one contained call. The value is in the spatial queries, the vector index, the realtime layer, the auth and RLS, and the guardrails around the model. I also reached for far more of Postgres than I knew I could — PostGIS, pgvector, RRF, and logical-replication realtime — all inside a single database.
What's next for ReLoop
Group pickups and "circles" for schools and blocks, a veripartnerships with local reuse charities so a single tap can route an item to whoever needs it most.
Built With
- carto
- css
- deno
- github-actions
- gpt-4o-mini
- html
- javascript
- leaflet.js
- node.js
- openai
- osrm
- pgvector
- postgis
- postgresql
- pwa
- react
- supabase
- supabase-edge-functions
- tailwindcss
- typescript
- vercel
- vite
- vitest
- web-speech-api
Log in or sign up for Devpost to join the conversation.