
Bharat PIN
A geo-coded addressing system that assigns unique 10-character codes to 4m x 4m grid locations across India for precise digital addresses.
Timeline
2 months
Role
Full Stack
Team
Solo
Status
CompletedTechnology Stack
Key Challenges
- Grid Algorithm
- Precision Mapping
- Encoding Logic
- Coordinate Accuracy
- Map Rendering
- Reverse Conversion
Key Learnings
- Geo Gridding
- Spatial Mapping
- Encoding System
- Offline Logic
- Map Integration
- State Handling
Overview
Bharat-Pin is an open-source, geo-coded addressing system built to provide a scalable and standardized digital address layer for India. Inspired by the Government of India's DIGIPIN initiative, this project divides India's geography into uniform 4m x 4m grids, assigning each a unique 10-character alphanumeric code based on latitude and longitude. It bridges the gap between physical locations and their digital representations and powers "Address as a Service" (AaaS) for seamless public and private service delivery.
Features
- π’ Generates unique 10-digit alphanumeric DIGIPIN-like codes.
- πΊοΈ Uses Leaflet.js to render interactive maps and grids.
- π Click on any location to get the Bharat PIN for that spot.
- π Converts between coordinates β code in real-time.
- βοΈ Offline usable logic for encoding and decoding.
Tech Stack
React.js β Frontend framework for building the user interface.
Tailwind CSS β Utility-first CSS framework for rapid and consistent styling.
Shadcn UI β Component library built with Radix UI primitives and Tailwind CSS for accessible and customizable UI design.
Leaflet.js β JavaScript library for interactive map rendering.
TanStack Query β Data-fetching library for managing server state, caching, synchronization, and API interactions.
GeoJSON β Standard format for encoding various geographic data structures.
JavaScript β Core programming language for implementing grid encoding/decoding logic and overall application functionality.
How It Works
- India's territory is divided into a bounding box from 63.5Β°E β 99.5Β°E and 2.5Β°N β 38.5Β°N.
- The area is split hierarchically into 4x4 grids for 10 levels (over 1 trillion cells).
- Each cell is encoded using 16 specific alphanumeric characters.
- The resulting 10-character code represents a specific 4m x 4m location.
- The application allows users to generate and decode this code via a visual map interface.
Use Cases
- π₯ Emergency Response β Share exact location using a 10-digit code.
- π¦ Delivery Services β Avoid address errors and improve last-mile delivery.
- π§ Navigation Systems β Pinpoint destinations more accurately than traditional addresses.
- ποΈ Urban Planning β Use structured, standardized location identifiers.
What I Learned
- π Gained a deep understanding of geo-gridding systems and how to convert coordinates into fixed address codes.
- βοΈ Practiced integrating complex algorithms with frontend tools like React and Leaflet, and improved skills in state management using TanStack Query.
