AWS Builder Center
Building a subsidy-honest rooftop solar guide on AWS in four days

Building a subsidy-honest rooftop solar guide on AWS in four days

For the Environmental Hacks hackathon I built SolarSaathi, a web app that answers whether your rooftop suits solar, what it costs after subsidies, and which schemes can actually be combined. The money math stays deterministic, the LLM only explains, and every subsidy figure links to its official source.

India has set out to put solar on 10 million rooftops, and homeowners who want one are left with installer pitches, stale blog posts and scattered government PDFs. For Environmental Hacks, the second hackathon of the Bharat Builds Tour by WeMakeDevs (Waste and Energy track), I built SolarSaathi, a web app that answers five questions: does my roof work, what should I install, what will it cost, which subsidies apply, and can they be combined?

The rule that shaped everything

Money and eligibility must never come from a language model. Roof geometry comes from the Google Solar API, the financial model is deterministic TypeScript, and a stacking engine checks every scheme's caps, exclusions and timing before adding benefits. The LLM only explains. If no verified policy record exists, the app fails closed: "No verified subsidy rule is published for your area yet." A tool that quietly guesses a subsidy is worse than one that says it doesn't know.

Architecture on AWS

  • Amplify Hosting serves the Next.js app.
  • API Gateway + Lambda (Node.js 22): 21 functions behind a versioned /v1 API, all defined in one AWS SAM template and validated and built in GitHub Actions.
  • DynamoDB single-table design. Policy records are versioned and never overwritten; conditional writes enforce a two-person approval (author, source curator and publisher must differ).
  • S3 (versioned, private) archives each official PDF so every cited number links to evidence.
  • Cognito for sign-in, with groups for homeowners, brokers and policy admins; every route checks ownership.
  • EventBridge runs a policy crawler every 15 minutes that detects changes on official sources (MNRE, state departments, DISCOMs). CloudWatch alarms watch it.
  • Secrets Manager keeps API keys out of the browser and out of the Lambda environment.

What went wrong (the useful part)

  1. Bedrock said no. Every model call in my new account, including Amazon's own Nova, returned  Operation not allowed , and  GetFoundationModelAvailability  reported  NOT_AUTHORIZED . No message explained why. Because the chat agent already sat behind a small model-client interface, I added an OpenAI adapter in an afternoon and kept Bedrock as the default. Lesson: put your model behind an interface from day one, and test Bedrock access before building on it.
  1. Lambda concurrency quota. My first CloudFormation deploy failed because the account allowed only 10 concurrent executions and I had asked for reserved concurrency. Removing the reservation fixed it.
  1. Fixtures vs. truth. I built a  /demo  area with clearly labelled sample data so the whole flow can be seen even before the live policy catalog is approved. Keeping sample data visibly separate from verified data took more discipline than any code.

What I'd do next

Publish the PM Surya Ghar central benefit and the first state rules through the admin workflow, add a scoped deployment identity instead of the root CLI session, and move chat back to Bedrock once the account is cleared.
AI disclosure: I built this with Claude Code, Codex as a coding assistant and reviewed and tested its output.
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