HaritHisab — Daily Carbon Tracker for Students
Tagline: Roz ka carbon hisab — apni aadat, apna anumaan, apna sudhaar. (Daily carbon maths for Indian students, in Hindi first.)
Try it out: Live app — https://devilking7x.github.io/harit-hisab/ · Source code — https://github.com/devilking7x/harit-hisab
Inspiration
Most Indian students have no idea what their daily habits cost the climate — and the carbon calculators that exist are in English, built for Western lifestyles, and often pretend to "measure" what they can only guess. I built HaritHisab as a Hindi-first daily tracker for Indian student life: bus and metro, not just cars; LPG cooking; veg and non-veg meals as they actually happen here.
What it does
HaritHisab is a Hindi-first, offline daily carbon-footprint tracker for students. Log one day's travel (bus, metro, car, scooter, auto, walk, cycle), electricity (kWh), LPG cooking, meals (veg / egg / chicken / mutton) and single-use plastic — and see an estimated CO₂e total with a per-category breakdown, a 7-day bar chart, a comparison with India's per-capita average (~5.2 kg/day), and one practical reduction tip based on your biggest category. All data stays in the browser's localStorage: no server, no account, no tracking.
Honest numbers: Every figure is labelled an ESTIMATE, never a measurement. Factors are published and shown in-app with sources: DEFRA 2024 (bus, rail, petrol car), CEA India 2023 grid average (0.71 kg CO₂e/kWh), IPCC (LPG 2.98 kg/kg), Poore & Nemecek (2018) food footprints, OECD/literature plastic estimate. The app states its limits plainly: UK factors are approximate for India, scooter/auto and food values are midpoint estimates, and it cannot measure real emissions — it applies factors to what you enter. No "saved the planet" claims anywhere.
Who it's for: Indian university students (built by one — BA student, MJPRU Bareilly) who want a simple daily habit check in their own language.
How we built it
Plain HTML, CSS and JavaScript — no framework, no build step — with localStorage for offline-first privacy. The calculation core (carbon.js) is a pure module: each category has a published factor, the day total is the sum of category estimates, and the 7-day chart reads the same log the table shows. A worked example is pinned by tests: bus 10 km, electricity 3 kWh, LPG 0.4 kg, 2 veg meals, 50 g plastic = 6.24 kg CO₂e. Tests: 16 Node unit tests (node --test tests/carbon.test.js) and 12 Playwright smoke checks.
Challenges we ran into
The hardest challenge was not the maths — it was the honesty. Every emission factor available is a national or global average, not a measurement of one student's day: DEFRA's bus factor is British, the grid average is a national mean, food footprints are global midpoints. The tempting move was to present a precise-looking total as if the app had measured something. Instead, every figure on the page is labelled ESTIMATE, every factor is published in-app with its source, and the limits are stated where the number appears — including that the app cannot measure real emissions, only apply factors to what you enter. Getting the worked example right took the same care: the 6.24 kg total is hand-verified from the individual factors (bus 10 km = 1.02 kg, electricity 3 kWh = 2.13 kg, LPG 0.4 kg = 1.19 kg, and so on), and the test pins it so a factor change can't silently move the headline number.
Accomplishments that we're proud of
- A carbon tracker that never pretends to measure: every number is a labelled estimate with a published, sourced factor.
- A worked example (6.24 kg CO₂e) that is hand-verified and pinned by tests — the headline number can't drift.
- A Hindi-first UI with a full English toggle, built for the students who actually need it.
- One practical tip tied to your biggest category each day — behaviour change starts with one concrete swap, like seeing that the bus is 0.10 kg/km vs a car at 0.17, or that one mutton meal ≈ 5 kg.
- 16/16 Node tests and 12/12 Playwright checks passing.
What we learned
- In climate tools, the factor is the claim: publishing sources and labelling estimates is what separates a tracker from a greenwashing widget.
- A single concrete comparison (bus vs car per km, one mutton meal vs a week of veg) changes behaviour more than a total ever will — so the tip targets the biggest category, not the total.
- Hindi-first is not translation: the whole interaction (labels, tips, units) was written for Indian student life first, English second.
What's next for HaritHisab
- India-specific factors where they exist (e.g. Indian bus occupancy and grid mixes by state) to replace the UK approximations, with the sources still published.
- A weekly summary view: your 7-day average vs the 5.2 kg/day national average, with one swap suggestion per week.
- A "what-if" mode: change one habit (bus instead of scooter) and see the week's difference before you commit to it.
Built With
HTML, CSS, JavaScript (plain, no framework, no build step), localStorage (offline-first, privacy by design), Node.js 20 (node --test), Playwright (smoke tests)
Testing instructions (for judges)
- Open the live link (works offline once loaded; no sign-up).
- Fill the form: bus 10 km, electricity 3 kWh, LPG 0.4 kg, 2 veg meals, 50 g plastic — then click "💾 Aaj ka hisab save karo".
- Expected result: 6.24 kg CO₂e total, 5-category breakdown, a tip, one bar in the 7-day chart, one row in the Log.
- Click "English" (top right) to switch the whole UI to English.
- Click "⬇️ CSV download karo" to export your log; "🗑️ Saara data mitao" deletes all local data.
- Tests:
node --test tests/carbon.test.js(16 tests) andnode tests/smoke.spec.mjs(12 Playwright checks) in the repo.
Built With
- css
- html
- javascript
- localstorage
- node.js
- playwright
