Theme Track Requirement: Specific Waste Problem & How We Measure Success

Trilo tackles household and student-residence waste mixing, missed pickups, and open burning/dumping in urban and peri-urban Senegal (Dakar, Saint-Louis, Thiès, and Touba), where clean plastics, organics, metals, and hazardous batteries are routinely combined into a single sack or burned when collection carts miss narrow lanes. We measure success directly inside the application on the Measures screen through three live indicators computed from recorded entries rather than guesswork: (1) kilograms sorted per household per week across eight material streams, (2) percentage of logged waste diverted from open burning or dumping relative to honest baseline disposal entries (burned and dumped), and (3) percentage of neighbourhood missed-pickup and illegal-dump reports marked resolved alongside median resolution turnaround time in days, exportable at any moment as CSV or a printable residence summary.


Inspiration & Cited Waste Context

According to the World Bank’s Project Appraisal Document: Senegal Municipal Solid Waste Management Project (Report No. PAD2491, published February 12, 2020, World Bank PDF), Senegal generated over 2.4 million tons of solid waste annually (2015 baseline), with roughly 1.08 million tons remaining uncollected each year. National access to regular waste collection stood at 45% (84% in Dakar, 33% in regional capitals, and 22% in secondary municipalities), while Dakar’s collected waste went untreated to the 114-hectare Mbeubeuss open dumpsite.

In university residences and shared family compounds, valuable secondary materials (clean PET bottles, HDPE jerrycans, aluminium cans, corrugated cartons, glass bottles, and kitchen peelings) are already traded or composted informally, yet roommates lack three everyday tools:

  1. A 10-second shared logbook that works even when mobile data drops and records an honest baseline when waste still gets burned or dumped.
  2. Clear, local sorting rules for common West African items (water sachets, charcoal ash, oil-soaked thiéboudienne cartons, swollen phone batteries).
  3. A shared neighbourhood map-free directory and missed-pickup tracker that protects household privacy.

What Trilo Does

  • Interactive Stencil SVG Sorting Bins: Eight vector bins (Plastic, Organic, Glass, Metal, Paper & cardboard, Textile, E-waste & batteries, and hatched Other residual) rise dynamically as a household logs waste during the week. Clicking any bin pre-selects that stream in the quick-log slip.
  • Under-10-Second Logging by Weight or Local Bag Size: Residents log exact kilograms or pick familiar containers (small plastic bag ~0.8 kg, 10 L bucket ~3.5 kg, 25 L basin ~7.0 kg, 50 kg woven sack ~14.0 kg) and record whether the batch was reused, composted, sold to a buyer (with FCFA earned), dropped off, collected by truck/cart, or honestly burned/dumped.
  • 84-Item Sorting Guide + Transparent Rule-Based Helper: Covers 84 everyday items in English and French. The “Where does this go?” helper applies six deterministic if/else hazard, organic, and cleanliness rules (data/items.js), explicitly stating the matched rule and never pretending to use machine learning.
  • Community Directory with Honesty & Safety Guardrails: Lists drop-off points, material buyers, compost sites, and repair/reuse workshops with “Confirm active” counters and 3-flag auto-hide moderation. All 40 preloaded sample places carry a visible Demo (fictional) badge, and prices are marked FCFA/kg (unverified, illustrative).
  • Missed-Pickup & Illegal-Dump Reports with Realtime Updates: Residents post text-only reports (blocking raw phone numbers on both client and database CHECK constraints to prevent doxxing), neighbours add Me too confirmations, and reporters mark resolved items to track median turnaround days.
  • Opt-In Residence Challenge: Aggregates per-member diverted kilograms via a PostgreSQL security_invoker view (community_leaderboard) only for opted-in households without ever exposing raw household waste logs.

How We Built It (Technical Execution & Feasibility)

  • Zero-Build Vanilla Stack (< 300 KB): Built entirely with semantic HTML5, modern CSS (css/style.css), and modular vanilla JavaScript (js/config.js, js/i18n.js, js/pagination.js, js/store.js, js/charts.js, js/tour.js, js/ui.js, js/app.js, data/items.js, data/sample.js). Total frontend code is 288 KB, loading quickly on budget Android phones without bundlers or npm build pipelines.
  • Dual Cloud + Offline Local Demo Architecture: Connects to Supabase (@supabase/[email protected] pinned CDN release) when reachable, and automatically falls back to localStorage (try/catch guarded) if offline or paused, showing a clear Cloud or Local demo badge in the header.
  • Strict PostgreSQL Row Level Security (supabase/schema.sql): Enforces 37 RLS policies across 11 tables with anon table writes revoked. Verified with a live two-account browser test: Account B receives 0 rows when querying Account A’s waste_logs or households and cannot delete Account A’s reports, while public directory entries, reports, and Me too counts sync across accounts.
  • Shared Accessible Pagination (js/pagination.js + js/pagination.test.html): Powers all 7 lists in both Local and Cloud modes (.range(from, to) + { count: 'exact' }), verified by a 12-assertion browser test suite (>= 44×44 px controls, <nav aria-label="Pagination">, aria-current="page", aria-live="polite", filter-change reset, and last-item deletion step-back).

Challenges We Ran Into

  • Designing honest metrics without shaming baseline disposal: If residents only record recyclables, diversion percentages always read 100% and hide progress. Including explicit Burned (baseline) and Dumped (baseline) destinations lets a residence establish an honest week-1 baseline and watch real diversion climb over 12 weeks.
  • Keeping server-side and offline pagination identical: Unifying Supabase .range(from, to) exact-count queries and localStorage array slicing behind one state machine (js/pagination.js) required careful handling when filters change or the final item on the last page is deleted.
  • Balancing public neighbourhood coordination with household privacy: Household waste habits reveal consumption patterns. Using security-definer membership helpers (is_household_member) alongside an opt-in security_invoker leaderboard view kept raw logs strictly private while keeping community reports public.

What’s Next for Trilo

  • Field pilot with student residence blocks using SURVEY.md to validate actual weekly bag weights and buyer drop-off schedules.
  • Printable QR invite slips for residence courtyard bulletin boards so roommates can join a household logbook without typing invite codes.
  • Optional municipal/GIE collector verification badges co-managed with campus sanitation teams.

Built With

Share this project:

Updates

Submission history