2026
Trashium
A three-role waste-management platform (household, crew, admin) with live maps, an offline PWA and ML-driven pricing. Sole full-stack developer on a team of five.
- Stack
TypeScriptNext.jsSupabaseLeafletRechartsPython
- Live
- trashium.com
Problem
Five of us built a scrap-collection platform and I was the only full-stack developer on it. That meant three different people had to use the same database without being able to see each other: a household booking a pickup, a crew driver working a zone, an admin who needs the whole picture. Any of those views leaking into another is a privacy failure, and putting the check in the React component only moves it somewhere an attacker does not have to go.
The harder problem was money. Before a household commits to a pickup, the app has to quote a price per kilogram, and that price has to be one the business can actually pay.
Approach
Access control sits in Postgres. Twelve tables, row-level security enabled on all twelve, twenty-one policies and fourteen functions behind them. A crew member querying pickup_requests gets their zone because the database will not return anything else, so the UI is a convenience rather than the control.
On top of that I built the crew operations view: a live Leaflet map, pickup queues scoped to the driver’s zone, and geo-tagged proof photos served through short-lived signed URLs, so a photo of somebody’s doorstep does not become a permanent public link. The admin side is a Recharts dashboard over the same data. All of it runs in English, Hindi and Bengali, and installs as an offline-capable PWA.
The pricing model is where I spent the most thought, and the first version was wrong in a way that looked like success. Trained to predict the payout directly, it returned an R² around 0.999. That is not a good model. The payout is computed from a business formula, so the model was reading the formula back to itself. I moved the target to market value per kilogram, which is the one quantity in the system nobody knows in advance, and derived everything downstream from it. A log-target linear regression gets 6.11% test MAPE there. A random forest gets 9.80%, and I kept it running as a challenger so a drift in the gap between them tells me something has changed.
Reading the source data closely turned up two more problems. Quality-defect risk had almost no effect on value and demand was inverted, so I regenerated the dataset with risk lowering value and demand raising it. Then the business formula itself: payout and margin cancelled exactly, which meant Trashium earned nothing on every pickup it had ever quoted. Adding a commission term fixed it, and setting that term to zero still reproduces the original if anyone wants to check the claim.
The model ships as embedded parameters computed at request time rather than as a separate inference service, with lib/pricing.ts mirroring the Python. Glass, organic and mixed waste have no coverage in the dataset, so those fall through to a rate table in Supabase and a quote never fails outright. Payouts are floored at zero, and anything under the minimum margin gets flagged rather than quoted quietly.
Results
Sixty commits between May and July 2026. I owned QA as well: Playwright for end-to-end, Vitest for units, alpha and beta cycles, and a verification pass on the bundled model output before release.
If you read one thing here, make it the 0.999. It arrived looking like the best result of the project, and every hour I spent after that was spent making the number worse on purpose.