SortKaro — Waste Sorting Helper for India

Tagline: Which bin does it go in? Ask in English or Hindi — get the bin, the reason, and what to do next.

Try it out: Live demo — https://devilking7x.github.io/sortkaro/ · Source code — https://github.com/devilking7x/sortkaro (MIT licence)

Track: Theme Track: Rethinking Waste (Arbiter Hacks V1)

Inspiration

In most Indian homes, waste sorting fails at one small moment: you are holding something in your hand and you do not know which bin it goes in. So the battery goes in with the vegetable peels, the CFL bulb goes in with the newspaper, and the whole bag becomes unrecyclable. India generates about 62 million tonnes of waste a year and recycles only a fraction of it — not because people do not care, but because the rule is not in front of them at the moment they need it.

What it does

SortKaro puts the rule in front of them. It is a static web page (plain HTML/CSS/JS, zero dependencies, no server, no tracking) — type an item in English or Roman Hindi and it tells you the bin, why, and what to do with it.

  • Ask about an item — a 73-item hand-built list of common Indian household items (vegetable peels to CFL bulbs), each with a bin, a plain explanation, and a disposal tip. Search works in English and Roman Hindi (akhbaar, kele ka chilka, purana mobile, dawai).
  • Rule-based classifier — exact match, aliases, then keyword rules. When it does not know an item it says "not sure" instead of guessing.
  • Bin guide — browse each bin: green = wet/compostable, blue = dry/recyclable, red = hazardous, separate e-waste collection, yellow bag = sanitary. Rules follow the Solid Waste Management Rules 2016 and common ULB practice; cities differ and the app says so.
  • 10-item quiz — random household items, pick the bin, get a score immediately. Best score is saved on the device only (localStorage).

Measured results (from the test suite, not estimates): the classifier scores 20/20 (100%) on twenty item names that are not in the 73-item list (e.g. "used AA battery", "cracked CFL bulb", "plastic milk packet", "broken LED bulb"). Recompute live in DevTools: SortKaro.evaluateHeldOut(). Tricky pairs are kept apart: CFL bulb = hazardous (mercury), LED bulb = e-waste (circuit board); paint tin = hazardous, tin can = dry; milk packet = dry, chips packet = check locally.

The waste problem we targeted (Theme Track): the problem is contamination at the point of sorting — one wrong item (a battery, a CFL, a sanitary pad) in the wrong bin spoils a whole bag of recyclables and sends it to landfill. SortKaro targets the 5 seconds before the item is dropped in a bin. How we would measure whether it worked: (1) the quiz — a user's score before and after using the guide (the quiz is scored, so a before/after comparison is built in); (2) the classifier's held-out accuracy (20/20 on unseen item names); (3) in a real deployment, the share of households whose dry-waste bags arrive uncontaminated — we cannot measure (3) from a static page, and we do not claim to.

What it is not: SortKaro is a guide, not a government rulebook. It does not recognise photos or brands, does not book pickups, and does not contact any collector.

How we built it

Plain HTML, CSS and JavaScript — no frameworks, no build step. The dataset is a hand-built list of 73 items with bins, explanations and tips; the classifier layers exact match, then aliases (including Roman Hindi names), then keyword rules, and falls back to an honest "not sure" instead of guessing. The quiz draws 10 random items and grades immediately, with the best score stored in localStorage. Tested with 10/10 Node unit tests (73 items / 6 categories / no duplicates, exact + alias + Hindi names, punctuation/case handling, tricky pairs, held-out 20/20, search, quiz grading) and 10/10 Playwright smoke checks (page loads, zero console/page errors, banana peel → green, old mobile phone → e-waste, unknown item → "not sure", held-out line 20/20 live, bin browse, quiz 10 items + grading).

Challenges we ran into

The dataset itself was the challenge — and it caught a real counting error. The draft originally said 72 items; testing counted 73 — the milk packet had been added to the list without updating the count. The test now counts the list directly, so the number on the page can never drift from the data again. The harder problem was the tricky pairs: a CFL bulb and an LED bulb look the same in your hand, but one is hazardous (mercury) and the other is e-waste (circuit board). Getting those apart took explicit rules, not keyword matching — "bulb" alone must never decide the bin — and the test suite pins each tricky pair (CFL vs LED, paint tin vs tin can, milk packet vs chips packet) so a future edit can't blur them. The classifier also had to learn to say "not sure": an unknown item like "quantum flux capacitor" returns an honest "Not sure yet" instead of a confident wrong bin.

Accomplishments that we're proud of

  • A classifier that scores 20/20 (100%) on twenty item names it never saw — measured live, recomputable in DevTools.
  • Tricky pairs kept apart by explicit rules: CFL = hazardous, LED = e-waste — the distinction that matters most in a real kitchen drawer.
  • A quiz with a built-in before/after measure: your score before and after using the guide is the impact metric.
  • An honest "not sure" — the app would rather admit ignorance than mis-sort your waste.
  • 10/10 Node tests and 10/10 Playwright checks, zero console/page errors.

What we learned

  • In a rules-based classifier, the dataset is the product — and it needs a test that counts it, because a hand-built list drifts silently.
  • The most valuable feature can be a refusal: "not sure" protects the recycling bag better than a confident guess.
  • Rules follow the Solid Waste Management Rules 2016, but cities differ — and saying that on the page is what makes the guide trustworthy instead of brittle.

What's next for SortKaro

  • Photo-based item lookup is the obvious next step — but only with a labelled dataset and a held-out evaluation first; guessing from a photo is worse than typing and getting an honest answer.
  • City-specific rules: let a user pick their city and see its actual ULB bin colours and collection days.
  • A "my building" mode: a shared board for one apartment building, so neighbours learn the same rules together.

Built With

HTML, CSS, JavaScript (no frameworks, no build step), Node.js 20 (tests), Playwright (smoke tests)

Testing instructions (for judges)

  1. Open https://devilking7x.github.io/sortkaro/
  2. Type banana peel and click Which bin? → Wet waste — Green bin, with the reason and tip.
  3. Type old mobile phone → E-waste — separate collection. Type cfl bulb → Hazardous — Red bin. Type led bulb → E-waste (the two bulbs are kept apart).
  4. Type quantum flux capacitor → "Not sure yet" — the app says so instead of guessing.
  5. Click any bin chip (e.g. Blue bin) → the full list of items in that bin.
  6. Click Start the quiz → 10 random items; pick a bin for each, then Check my score.
  7. To run the tests locally: clone the repo, then npm test (10 unit tests) and npm run smoke (10 Playwright checks). Both pass.

Built With

Share this project:

Updates

Submission history