AWS Builder Center
Sparrow: the next electricity bill is the proof

Sparrow: the next electricity bill is the proof

Sparrow proves whether a small energy-saving habit worked, using a family’s own electricity bills. Built serverless on AWS in three days. Covers the architecture, a 199 MB to 31 KB Lambda fix, an IAM bug CloudWatch caught, and why the sparrows in my society inspired it.

From 'how do I code this?' to 'what if a million users hit it?' 😂— led me to backend, AWS, and DB.

Sparrow: the next electricity bill is the proof

Environmental Hacks (AWS x Bharat Builds Tour) · Track 03: Waste and Energy · Team Aveniq (ID: EEYPNK) · India

Why a sparrow

Five years ago, sparrows were part of the day. They nested in our homes and were a daily sight in the sky. Then they thinned out. Today I can count two or three around my society, and that count is still falling.
Nobody decided to remove them. Many small, unnoticed loads on the environment added up, and one day the birds were gone. That is the idea behind this project: if small habits can make something vanish, small habits can also help keep it.
The second reason is practical. Most families want to help but have no way to see whether anything they do makes a difference. Electricity shows up as one number, once a month. Advice is everywhere. Proof is not.

What Sparrow does

Sparrow is a mobile-first web app. A family does a short setup, takes one small action at a time (like hunting down devices that sit on standby), and then the next bill decides whether it worked.
  • The home starts in a neutral Dawn state. It becomes Fresh or Thriving only when a new bill shows fewer units than the previous one. Tapping "done" never changes anything. Only a bill does.
  • Verification is deliberately plain: units on the previous bill against units on the new bill.
  • CO2 avoided uses the CEA CO2 Baseline Database v21.0 (FY 2024-25) grid factor of 0.710 kg per kWh. The source is one tap away.
  • Rupees saved use the family's own average rate from their own bill. No tariff table, so it works for any state or utility.
  • A share card turns the result into something a family can post on Instagram or Facebook.
  • Learn tab: short 30-second videos and cards. Every card shows its source (BEE, the Lok Sabha record, a PIB factsheet, a state electricity department). A card with no source says so instead of inventing a number.
  • Tasks tab: simple checks around the house.
  • Community tab: families share photos of real actions, react with five predefined stickers, comment and share. Photos are screened by Amazon Rekognition before they appear, and if the check is unavailable the photo stays hidden (fail closed).
  • Demo mode uses clearly labelled sample data and makes zero network calls.
The UI is in English and Hindi. The language system supports ten Indian languages, and the rest fall back to English until a native speaker reviews them. I would rather ship fewer languages than claim translations nobody has checked.

One worked example (sample data)

Not a real household. This is the test data used to check the maths:

Previous bill
New bill
Units
200
170
Amount
₹1,500
₹1,275
Rate
₹7.50/kWh
₹7.50/kWh
Result: 30 kWh saved (15%), about 21 kg CO2 (30 × 0.710) and about ₹225. Pure arithmetic on two bills, no assumptions beyond the published grid factor.

How it is built on AWS


  • AWS Amplify Hosting serves the React single-page app.
  • Amazon Cognito handles email sign-up with a confirmation code.
  • Amazon API Gateway (HTTP API) with a Cognito JWT authorizer protects every data route.
  • AWS Lambda (Python) implements the API, including the bill-to-bill verification. Each function in the deployed stack is 31,029 bytes.
  • Amazon DynamoDB stores profiles, bills, missions, and community posts, comments and reactions.
  • Amazon S3 holds bill and community photos in a private bucket. Browsers upload through presigned POST URLs with size and content-type limits enforced by S3 itself. Reads use short-lived signed URLs.
  • Amazon Rekognition screens community photos before they become visible.
  • AWS SAM / CloudFormation defines the whole backend as code.
  • Amazon CloudWatch produced the log line that solved the hardest bug (below).

What fought back

1. A blank page after the first deploy. Amplify served  index.html  and nothing rendered. Windows PowerShell 5.1  Compress-Archive  wrote backslash paths into the zip, which a Linux host cannot resolve. Rebuilding the archive with  tar  fixed it. When only the HTML loads, check the archive before the code.
2. A Lambda that packaged the whole repo. My first SAM template pointed  CodeUri  at the repository root, so every function shipped with  node_modules : about 199 MB each. Pointing it at the backend folder brought each function down to 31,029 bytes. That is roughly a 6,400x reduction from one path change.
3. A permission that only failed in real use. Adding photo support made the bill upsert read the existing item first. The deployed function had no  dynamodb:GetItem , and saving a bill returned a generic error. CloudWatch showed the  AccessDeniedException  straight away. Fixing it was one line. The lasting fix was a test that derives the IAM actions from the code and fails if a function's policy does not allow them.
4. A frontend and backend that disagreed. My tests passed because they mocked the network. The real request failed on a malformed header and a payload the strict validator rejected. There is now one file of valid and invalid request examples, checked by both the frontend and backend test suites.
5. India-specific limits. SMS to Indian numbers needs registration I could not finish inside a hackathon window, so sign-in is email and code. I dropped SMS rather than fake it. Amazon Polly has no Gujarati voice, so Sparrow is text-first, not voice-first.
6. Design. I am not a designer. I tried hard to make the interface feel warm and specific to a family, and it stayed simple. I decided simple and readable beats clever and broken. Colour contrast is tested (17 of 17 checks pass).

Numbers :



Build window
About three days (8 to 11 Oct 2026)
Backend tests
83 passing
Frontend tests
146 passing
Contrast checks
17 / 17
Lambda size
~199 MB to 31,029 bytes per function
AWS spend
Covered by WeMakeDevs credits. Cost Explorer showed under $0.0001 of billed usage on the account for 8 to 11 Oct (estimated)
Languages in UI
English, Hindi. Others fall back to English until reviewed

The team and the toolchain

Built by Harshil Kalsariya (implementation and infrastructure) and Sravya Maddipati (educational videos, Learn cards, documentation for visitors, and design perspective).
Tools, by role:
  • Design: Figma Make and Figma Design
  • Implementation: Claude 4.6 Opus
  • Debugging: Codex 5.6Terra
  • Design refactoring: Antigravity (Gemini 3.6Flash)
  • Code review: CodeRabbit
  • Code scanning: Kind
  • Deployment: AWS SAM
  • Implementation booster: NARACLI by ByNara

Honest limits

  • This is a prototype. Sign-in is email and code. Google sign-in is wired in the template but not enabled.
  • Every saving shown to a user comes from their own bills. Demo numbers are labelled SAMPLE.
  • The 6% per degree AC figure on the Learn card is a BEE estimate, and the card says so.
  • Bill photos are stored privately and are not read automatically.
  • Nobody has yet tested whether the "next bill proves it" loop changes behaviour in real households.

What is next

Native-speaker reviews for the remaining languages, a rooftop-solar estimate using a sourced roof-area rule, and a pilot with a handful of real households to see whether the proof loop changes what they do.

Try it

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article