The write-up
How tidy is built
a community map of the world’s litter, in preview
web · geo
What
A community map of litter: someone photographs rubbish, neighbours confirm it, a local group cleans it up, and the map visibly heals.
Why
So the people near a riverbank can see the rubbish on it, take it on together, and watch the spot heal on a globe you can zoom from space down to the street.
How
Every report stores nine nested hexagon sizes, so any zoom is a plain indexed GROUP BY in Postgres, with row-level security on every table. A Findings tab ranks 193 countries on air, plastic, water and quality of life, then writes itself up as a research paper.
Built with
- TypeScript 7
- React 19
- Vite 8
- MapLibre GL 5
- h3-js
- Tailwind 4
- Postgres
- PostGIS
- PGlite
- Vitest 4
- culori
By the numbers
- lines of source
- 36,355
- commits
- 48
- tests
- 1,491
- SQL functions
- 51
- hexagon sizes stored per report
- 9
- countries in the findings
- 193
- world data sources
- 6
- React components
- 17
- dollars a month to run
- 0
Languages
| TypeScript / TSX | 31,006 | 85.3% |
| SQL | 4,420 | 12.2% |
| JavaScript | 684 | 1.9% |
| CSS | 245 | 0.7% |
On the wire
- Postgres
- Supabase, row-level security on every table
- H3
- nine nested cells per report, rolled up by GROUP BY
- WebGL
- MapLibre globe, vector tiles, workers from blob:
- Uploads
- photos straight to R2, SigV4-signed per file
- Worker
- four-tier moderation queue, swappable model
Findings
- Spearman ρ
- Partial ρ on GDP
- Fisher-z intervals
- Bonferroni
- Kruskal–Wallis
- Research paper, live
APIs
- Supabase
- Cloudflare R2
- OpenFreeMap
- Our World in Data
- NASA FIRMS
- Nominatim
- Natural Earth
Also
Running on made-up reports until it opens. The database tests run against real Postgres.