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:
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.
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.
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_h3vslatlng_to_cellcaused silent failures until we pinned toh3==3.7.7. - Async SQLite on Windows —
aiosqlitewith thelifespancontext 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
MapContainerkeys stable. - Windows drive-letter
cd—cd D:\pathfrom a C: prompt doesn't switch drives. Must runD:first, thencd. - Empty heatmap on first load — solved with a
/payments/seed-demoendpoint 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
lifespanis the correct pattern for DB initialisation — cleaner than the deprecatedon_eventhandlers. - 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
- aiosqlite
- fastapi
- framer-motion
- h3-py
- leaflet.js
- python
- react-leaflet
- react18
- recharts
- sqlite
- tailwindcss
- vite
Log in or sign up for Devpost to join the conversation.