Inspiration

India has 63 million small businesses — yet most new shop owners still pick their location by walking around the neighbourhood and asking neighbours. There is no Zillow for retail. No tool that tells a first-generation entrepreneur in Delhi whether Lajpat Nagar or Karol Bagh is the smarter bet for a pharmacy.

We were inspired by a simple observation: every time someone pays for something, they are voting with their wallet on a location. Aggregate enough of those votes onto a map, and you have the most honest demand signal in retail — real money, real places, real time.


What it does

RetailIntel is a three-in-one location intelligence platform:

  1. Store Opener Advisor — an entrepreneur inputs product category, city, and budget. The platform scores every major commercial zone and returns the top 5 locations with an Opportunity Score, risk level, estimated rent, daily revenue range, and a full 12-month profit simulation.

  2. Smart Buyer Finder — a consumer searches for any product. The platform uses their GPS to rank nearby stores cheapest-first, with distance, rating, and open/closed status.

  3. Geotagged Payments — every transaction is stamped with the buyer's GPS coordinates, indexed to an H3 hexagonal cell, and rendered on a live heatmap. Hot zones glow red; emerging zones glow teal. Entrepreneurs can see exactly where purchasing power concentrates before committing capital.


How we built it

Backend — FastAPI + SQLite + H3

The API is a FastAPI application with four routers (/score-location, /simulate, /find-product, /payments) backed by an aiosqlite SQLite database for async I/O.

The Opportunity Score for each zone is computed as:

$$S = \frac{\left(\text{FootTraffic} \times w_t\right) \cdot \left(\text{SpendIndex} \times w_s\right) / 100 \;-\; n_c \cdot \lambda \cdot 5 \;-\; \text{RentIndex} \times 0.4}{1.2}$$

$$\text{Score} = \max(0,\; \min(100,\; S))$$

Where $w_t$ and $w_s$ are category-specific traffic and spend multipliers, $n_c$ is competitor count, and $\lambda$ is the category's competition sensitivity.

Every payment is converted to an H3 hexagonal index at resolution 9 (~174 m cell diameter):

h3_index = h3.geo_to_h3(lat, lng, resolution=9)

The heatmap scales each cell's circle by transaction count:

$$\text{radius}_i = \min(1200,\; 300 + \text{count}_i \times 80) \quad \text{(metres)}$$

$$\text{opacity}_i = \min(0.70,\; 0.15 + \text{count}_i \times 0.06)$$

Frontend — React 18 + Vite + Leaflet

Built with React 18, TailwindCSS v3, react-leaflet for maps, and Recharts for charts. A custom two-layer cursor (8px dot + 36px lagged ring) adds polish. Vite proxies all /api/* calls to the FastAPI backend.


Challenges we ran into

  • H3 API versioning — h3-py 3.x and 4.x have completely different function signatures. geo_to_h3 vs latlng_to_cell caused silent failures until we pinned to h3==3.7.7.
  • Async SQLite on Windowsaiosqlite with the lifespan context manager required careful ordering to ensure DB init completed before the first request.
  • Leaflet + React StrictMode — react-leaflet throws duplicate map container errors under React's double-render. Solved by keeping MapContainer keys stable.
  • Windows drive-letter cdcd D:\path from a C: prompt doesn't switch drives. Must run D: first, then cd.
  • Empty heatmap on first load — solved with a /payments/seed-demo endpoint that injects 40 realistic geotagged transactions automatically on first mount.

Accomplishments that we're proud of

  • A fully working geotagged payment pipeline — browser GPS → H3 hex index → SQLite → live map circle — built end to end in one session.
  • The scoring formula produces intuitive, defensible rankings: Connaught Place scores high on traffic but is penalised on rent; Rohini wins on cost — exactly what a real entrepreneur would reason.
  • A custom cursor with a lagged ring that expands on hover — purely CSS + requestAnimationFrame, zero libraries.
  • The simulation outputs a breakeven month and a go/no-go recommendation — a concrete decision, not just a score.

What we learned

  • H3 hexagonal indexing is remarkably elegant — fixed-size cells mean no boundary distortion, and resolution 9 gives city-block-level granularity perfect for retail decisions.
  • Browser Geolocation API needs graceful fallbacks — denied permissions are common, so a default coordinate (Delhi centre) is essential.
  • FastAPI lifespan is the correct pattern for DB initialisation — cleaner than the deprecated on_event handlers.
  • Scoring needs category-aware weights — a pharmacy thrives on foot traffic; an electronics store cares more about spend index. One formula fits none.

What's next for Smart_economy

  • Real data ingestion — live feeds from Google Places API, OpenStreetMap Overpass, and government footfall datasets.
  • Heatmap × Score overlay — see in one view whether high-spend zones match high-opportunity zones.
  • WebSocket live stream — push new payments onto the map in real time instead of polling every 15 seconds.
  • User session history — filter the heatmap to your own purchases only.
  • CSV export — download raw payment data from the stats panel.
  • PostGIS migration — swap SQLite for PostgreSQL + PostGIS for true spatial queries and production scaling.

Built With

Share this project:

Updates