The problem
Switching a Berlin home to clean energy means navigating solar installers, heat pump contractors, KfW loan applications, permit offices, and dynamic tariff providers — separately. Most households never start. Heimwende collapses it into one number: how much you save per month with the full upgrade bundled as a single financed product.
How it works
A homeowner enters their address. Mapbox flies to it. They draw their roof polygon on a satellite image and confirm the tilt and orientation. A Three.js model renders while the savings engine runs in the background.
The savings ladder stacks four upgrade rungs — ☀️ solar → 🔋 battery → ♨️ heat pump → 🚗 EV charger — computing marginal savings at each step. The final number is what the household pays today minus the upgrade installment minus new energy costs. Where the installment outweighs early savings, that's shown honestly.
Roof sizing comes from Google Solar API: real geometry, real local irradiance, backtested against 1,062 German solar projects. Three offer tiers — Budget, Balanced, Max Independence — are derived from the same data.
Permit checks run in parallel against live German government sources: Denkmal WMS (heritage protection), MaStR (neighbour PV count), OSM Overpass (building footprint), and Bebauungsplan PDFs fetched via Tavily and read by Claude in raw German. Results stream to the frontend over SSE as each check completes.
Subsidies — KfW 458, BAFA, 0 % VAT, optional Länder grants — are resolved fresh at query time from a seeded catalog and injected into the engine as a SubsidyContext. KfW interest rates are data-driven, not hardcoded.
Claude explains the result, narrates the permit findings, and generates the advisory report. It never touches the math.
Architecture
The backend is a FastAPI monolith (Python 3.12, uv) that doubles as a BFF — all secrets live here. The frontend is a Vite + React + TypeScript SPA talking to it over a frozen OpenAPI contract. The savings formula lives in specs/domain/savings-engine.spec.md with machine-checkable test vectors; the engine is TDD'd against them. Supabase holds the subsidy catalog, permit runs, and proposals.
The whole stack runs in two terminals. Golden fixtures (?fixture=demo-detached) let you develop against realistic payloads without hitting any real API.
Built with
FastAPI, React, Vite, Tailwind, TanStack Query, Mapbox GL, Three.js, Supabase, Anthropic Claude, Google Solar API, Tavily, MaStR, Denkmal WMS, uv, pnpm
Log in or sign up for Devpost to join the conversation.