DEV Community

Manideep Chittineni
Manideep Chittineni

Posted on

πŸ› οΈ How We Built a Serverless Interactive Map for 68,000+ Indian Villages with Zero Hosting Costs

Navigating government data platforms to extract precise administrative boundaries or village-level coordinates is notoriously difficult. Developers and researchers are often met with fragmented datasets, fragile APIs, slow load times, and anti-bot measures.

To bridge this gap, we built Village Finder a fully open-source, interactive geospatial platform covering Andhra Pradesh, Telangana, Karnataka, and Tamil Nadu.

What makes this project unique is its architecture. It manages structural data for over 68,000 villages, hosts fluid visual map layers, streams individual cadastral land parcels, handles multi-language transliteration, updates daily and operates with exactly zero server or infrastructure costs.

Here is a deep dive into how we engineered a highly scalable, serverless civic-tech application using a modern static web stack.


πŸ—οΈ The Architectural Breakdown

[ data.gov.in API ] ──(Daily GitHub Action)──> [ Python Pipeline & Pytest ]
                                                      β”‚
                                           (Generates Static Artifacts)
                                                      β”‚
                                                      β–Ό
[ Browser Client ] <──(Byte-Range Requests)── [ Cloud Storage (PMTiles) ]

Enter fullscreen mode Exit fullscreen mode

1. The Data Pipeline (Python + GitHub Actions)

Instead of provisioning a heavy, always on relational database, the entire data lifecycle is orchestrated by GitHub Actions (update-data.yml).

  • Ingestion: The daily scheduled workflow queries the official Local Government Directory via the data.gov.in open API and cross-checks metrics against the live portal to catch stale data.
  • Validation: Before any updates go live, a strict automated test suite runs via pytest. This guarantees internal consistency ensuring every village maps cleanly to a valid sub-district and parent district code.
  • Storage: Validated datasets are compiled directly into normalized JSON and flat CSV assets, which are then automatically committed back into the repository as version-controlled data releases.

2. Serverless Vector Mapping (PMTiles & MapLibre GL)

Handling cadastral data individual survey plots and property boundaries across multiple states means dealing with millions of complex polygons. Standard geo-architectures require an expensive PostGIS database coupled with a dynamic tile server (like Tegola or Martin) to render these layers fluidly.

We bypassed this infrastructure completely using PMTiles:

  • The entire global state boundary and cadastral dataset is compressed into a single-file, cloud-optimized vector tile archive format.
  • This PMTiles archive is hosted on a cost-effective, CORS-enabled cloud storage bucket.
  • Using MapLibre GL on the frontend, the client browser requests only the specific byte ranges of the file required to view the user's current map viewport.

The result? Fast, pan-and-zoom vector tile maps served directly to the user with no database queries or active server computing required.

3. Native Script Translation (Offline Neural Models)

A massive usability hurdle was that the upstream API feeds lacked localized script names (Telugu, Kannada, Tamil, Hindi, Urdu). Relying on runtime machine translation APIs would introduce latency, require API keys, and spike operational expenses.

To solve this natively:

  • We embedded an offline compilation step using the AI4Bharat IndicXlit neural transliteration model.
  • During the build phase, the model maps canonical English names to localized scripts, outputting a highly compressed, static names_translit.json engine.
  • The frontend reads this static dictionary instantly at runtime, offering robust multilingual UI configurations and custom, morpheme-aware localized place names with zero client-side processing lag.

πŸ“ˆ Key Takeaways

Building impactful public utility platforms doesn't require a massive cloud infrastructure budget. By leaning heavily into static site architecture, edge-hosted assets, cloud-optimized geospatial files (PMTiles), and continuous integration pipelines, you can build remarkably fast, robust, and entirely free community applications.

Want to see it in action, audit the pipeline, or help add support for the remaining states?

Top comments (0)