CASE STUDYMarketplace web app · hyperlocal commerce

Kacher-Dokan

A hyperlocal marketplace where shops set their own delivery radius and customers see only the shops that can reach them.

Live demo
Next.jsReactTypeScriptSupabasePostgreSQLPostGISRow-Level-SecurityRealtime
01

Screenshots

02

The problem

Neighborhood shops are where people buy daily essentials, but most have no online presence, and big delivery platforms don't cover every area and charge high commissions. Kacher-Dokan lets a shopkeeper open a shop, list products and decide how far they will deliver, while customers pick a location and instantly see only the shops that can deliver to them.
03

What it does

  • 01Map discovery: GPS, map pin or place search, showing only shops whose delivery radius covers you
  • 02Shopkeeper tools: shop registration with map location and photo, custom delivery radius, opening hours and an open / closed toggle
  • 03Product management with images, categories, units, stock count and in / out of stock
  • 04Single-shop cart and Cash on Delivery checkout with saved delivery addresses
  • 05Order workflow: Accept / Reject → Out for Delivery → Delivered, with live status tracking and cancel while pending
  • 06Realtime new-order badge and sound alert for shopkeepers
  • 07Direct messaging between customers and shops, with unread counters and per-side chat clearing
  • 08AI shopping assistant that finds products and nearby shops in Bangla and English
  • 09Admin panel to approve or reject new shops with a review note
  • 10Bangla / English switch, light / dark theme, installable PWA
04

How it works

  1. 1

    A shopkeeper registers a shop with a map location and delivery radius; an admin reviews and approves it.

  2. 2

    A customer shares a location through GPS, a map pin or place search.

  3. 3

    A PostGIS query (nearby_shops) returns only approved shops whose delivery radius contains that point, nearest first.

  4. 4

    The customer fills a single-shop cart and places the order through a server-side place_order function.

  5. 5

    The shop gets a realtime alert, then moves the order through Accept → Out for Delivery → Delivered while the customer watches live.

  6. 6

    The AI assistant uses tool calls (search products, list nearby shops, list a shop's products) to answer from real data.

05

Engineering decisions

  • Delivery coverage is checked in the database with PostGIS ST_DWithin, both for discovery and again when the order is placed.
  • Orders go through a security-definer Postgres function that re-checks stock, availability, quantity limits and prices, so the client can never set its own price.
  • Each order item stores the price at order time, so later price edits don't change past orders.
  • Row-Level-Security on every table, and a signup hook that blocks disposable email domains.
  • The AI assistant only answers from tool results and the Groq key stays server-side, with input length limits and rate-limit handling.
06

Tech stack

Framework
Next.js (App Router), React, TypeScript
Styling
Tailwind CSS
Database
Supabase PostgreSQL + PostGIS
Auth & security
Supabase Auth (email + Google), Row-Level-Security, Cloudflare Turnstile
Realtime
Supabase Realtime (orders and messages)
Maps
Leaflet, OpenStreetMap, Photon geocoder
AI
Groq (Llama 3.3 70B) with tool calling
Storage
Supabase Storage (shop and product images)
Hosting
Vercel
  • Reviews and ratings
  • Sales analytics dashboard for shopkeepers
  • Offline support and push notifications