Skip to content
← All work

Offline-first sales & subsidy app for rooftop solar installers

SolarKatha

A Flutter app that runs a rooftop solar job from site visit to PM Surya Ghar subsidy credit: AI bill scan, roof layout on satellite imagery, Hindi/English proposals and UPI payments.

My role: Design and full-stack development: Flutter app, Supabase backend, Edge Functions, PDF service and release

Visit solarkatha.vercel.app ↗
  • Flutter
  • Supabase
  • PowerSync
  • Gemini
  • Deno
Screenshot of SolarKatha, offline-first sales & subsidy app for rooftop solar installers, built by Anshuman Verma

Overview

SolarKatha is a field app for Indian rooftop solar installers, built for sales reps working on rooftops with patchy signal and customers who prefer Hindi. It works offline on a local SQLite copy kept in sync by PowerSync. Anything that needs a secret (Gemini, Razorpay, PDF signing, push) runs in Supabase Edge Functions, and business rules such as project creation, stage order and notifications live in Postgres triggers, so the app, the public tracking page and the payment webhook always behave the same way.

The challenge

Rooftop solar installers in India sell on site: on the customer's roof, often with weak mobile signal, to households who may prefer Hindi. Reps work out system size, subsidy, EMI and payback by hand, proposals go back and forth on paper, and after the sale the PM Surya Ghar subsidy process runs through ten stages that customers constantly call to ask about.

SolarKatha had to put the whole job in one app that keeps working offline, gets the numbers right for each company's pricing and each state's subsidy rules, produces a professional proposal in the customer's language, takes the advance by UPI, and lets owners and customers see exactly where every subsidy stands.

How it works

  1. 1Site visit (offline)
  2. 2Gemini bill scan
  3. 3Sizing & roof layout
  4. 4Hindi/English proposal
  5. 5Sign + UPI advance
  6. 610 subsidy stages tracked

Architecture

The app is Flutter 3 for Android and web, using Riverpod 3, go_router and freezed. Data lives in a local SQLite database synced with Supabase Postgres (Mumbai) through PowerSync sync streams scoped by role (owner, sales rep, installer) and enforced by Row-Level Security. Photos, bills and surveys go into an offline attachment queue that uploads when signal returns.

Anything needing a secret runs in Deno Edge Functions: the Gemini bill scan, PVGIS generation estimates, PDF requests, Razorpay payment links and webhook, the public tracking API and push. Proposals are rendered by a separate Node/TypeScript service on Vercel using puppeteer-core and serverless Chromium with Noto Sans Devanagari fonts, called with HMAC-signed requests. Sizing, subsidy, EMI and payback come from a pure Dart package with 52 tests, and the roof survey computes area on Esri satellite imagery and fits panels automatically.

Business rules live in Postgres. Signing a proposal fires a trigger that creates the project and its ten PM Surya Ghar stages with SLA due dates; stages advance automatically, only owners can reopen them, and every change is audited. A pg_net trigger calls the push Edge Function with a secret stored in Supabase Vault, sending Firebase notifications in Hindi or English. A pg_cron job rebuilds the public demo data every week.

What I built

Offline-first by design

PowerSync sync streams over Supabase Postgres: leads, photos, bills, surveys and stage updates work with no signal and upload later, with streams scoped by role and Row-Level Security on the server.

AI electricity bill scan

A bill photo goes to Gemini through an Edge Function, which extracts monthly units, sanctioned load, DISCOM and tariff category with per-field confidence for the rep to confirm; AI usage is logged per company.

Solar maths package

A pure Dart package for system sizing, PVGIS generation estimates, central and state subsidy slabs, tariff slabs, EMI and payback with panel degradation — 52 tests at about 99% coverage, driven by per-company config.

Roof survey on satellite imagery

Reps tap roof corners on Esri imagery; panels are fitted automatically in portrait or landscape with setbacks and concave-roof support, capping the system size and appearing in the proposal.

Proposals, signatures and UPI

A compliance checklist (DCR, ALMM, approved inverters), Hindi and English PDFs from a Chromium service with Devanagari fonts, WhatsApp sharing, on-phone signing and Razorpay UPI links confirmed by a verified webhook.

Subsidy tracking and push

Signing creates the project and all 10 PM Surya Ghar stages with SLA dates; customers follow progress on a branded public page, and Firebase push notifications arrive in Hindi or English with deep links.

Engineering decisions

  • Make the app work fully offline, because reps are often on rooftops with no signal.
  • Keep secrets out of the app: Gemini, Razorpay, PDF signing and push all run in Edge Functions.
  • Put business rules in Postgres triggers so the app, public page and payment webhook can never disagree.
  • Keep the solar maths in a pure, heavily tested Dart package with every number configurable per company.

Results

  • Live demo at solarkatha.vercel.app with one-tap owner, sales rep and installer logins.
  • Works offline on site and syncs when signal returns, verified on an Android emulator.
  • Hindi and English proposals, UPI advance payments and a public customer tracking page.
  • 85 Flutter widget tests, 37 Deno tests and 52 maths tests (about 99% coverage).

Stack

App
Flutter 3 (Android + web), Dart, Riverpod 3, go_router, freezed, flutter_map, fl_chart, Material 3
Offline sync
PowerSync (sync streams, local SQLite, offline attachment queue)
Backend
Supabase (Mumbai): Postgres, phone OTP auth, Storage, Row-Level Security, triggers, pg_cron, pg_net, Vault
Edge & AI
Deno/TypeScript Edge Functions, Google Gemini, PVGIS
Documents & payments
Puppeteer + Chromium PDF service on Vercel, Razorpay links and webhooks, Firebase Cloud Messaging
Quality
85 Flutter widget tests, 37 Deno tests, 52 maths tests, GitHub Actions, signed release APK

Related services

Need something like this?

I can build a version of this for your product, your data and your stack.

Start a project