2Kosher: Grocery Price Comparison Platform
Live at 2kosher.comOutcome
A live site at 2kosher.com that turns six stores' separate websites into one price-compared catalog and one cart, split across stores for the lowest total and filled into each store's own cart, on data a background worker keeps current every 4–6 hours with nobody watching it.
Overview
A live price-comparison and shopping site for six Brooklyn kosher grocery stores, built end to end: the scrapers that collect every store's catalog, the matching that recognises the same product at different stores, and the shopper site that compares prices, splits the cart and fills it. A background worker refreshes about 50,000 listings every 4–6 hours across four different e-commerce platforms, using each store's own JSON API rather than a browser, and crawls politely: one request per host at least 1.5 seconds apart, robots.txt obeyed, exponential backoff on errors. Every price change is kept as history.
Comparing prices only means something if two listings really are the same product, and every store names things its own way. Matching starts from barcodes, normalised so equal codes mean the same item everywhere, and falls back to trigram name similarity with sizes compared by what they hold (32 oz is a quart), plus a same-item rule that raised name-match precision from 54% to 94%, measured against barcode-confirmed pairs. Pairs are folded into items under one hard rule: two different barcodes are never treated as one product.
On the shopper side, invited users see each item's price ladder across the stores and build one cart, and an optimiser tries every combination of stores to show the cheapest way to buy it with one, two or three stops, so the saving from each extra store is explicit. Then 2Kosher fills each store's real cart: its server signs in as the shopper with the store login they saved, sealed with AES-256-GCM under a key the API and database never see, from a computer or a phone. A bookmarklet covers the one store whose cart lives only in the browser.
Screens & Demos

Architecture & Pipeline
01
6 Store Websites
4 platforms · their own JSON APIs
- JSON
02
Polite Scrapers
Python · 1.5 s per host · robots.txt
- Python
03
Job Queue
Postgres · SKIP LOCKED · heartbeats
- PostgreSQL
04
Catalog & Price History
~50k listings · every 4–6 h
05
Cross-Store Matching
Barcode · trigram name · size
06
Item Groups
Price ladder per item
07
Cart Optimiser
Cheapest split across stores
08
Fill Store Carts
Server sign-in · bookmarklet
09
Shopper Site & Admin
Next.js · FastAPI · Caddy HTTPS
- FastAPI
- Next.js
End-to-end flow, in order. Scroll sideways on a narrow screen.
Key Features
- Six Brooklyn kosher grocery stores on four e-commerce platforms (My Cloud Grocer, POS With Logic, Self-Point, Square Online), ~50,000 listings refreshed every 4–6 hours
- Scrapers built on each store's own JSON API, with no headless browser needed; Playwright stays in the image as the fallback
- Polite crawling: one request per host at least 1.5 s apart with random jitter, robots.txt and its Crawl-delay obeyed, exponential backoff that honours Retry-After
- Job queue in Postgres with no Redis or Celery: runs claimed with FOR UPDATE SKIP LOCKED, a partial unique index that makes double-booking a store impossible, and heartbeats that fail abandoned runs after 5 minutes
- Sanity gate: a run that returns nothing, or under half of the last good run, fails without removing a single product
- Sold-out recheck: products a store's listing hides are looked up one by one and kept as out of stock instead of being dropped
- Price history written by a database trigger on every price or sale-price change
- Barcodes normalised (GS1 check digit validated, UPC-E expanded to UPC-A), so equal codes mean the same item at every store
- Cross-store matching by barcode, then trigram name similarity, sizes compared by what they hold (32 oz = 1 quart) and a same-item rule: 54% → 94% precision against barcode-confirmed pairs; loose produce, with no barcode or size, matched on its words
- Matches folded into items with one hard rule, never two barcodes in one item; a full regroup of ~50,000 listings takes under 3 seconds, so it recomputes from scratch every run and can't drift
- Per-item price ladder across stores with sale prices, multi-buy deals, per-pound and per-piece pricing, and how fresh each price is
- Cart optimiser that tries every combination of stores (63 for six) and offers the cheapest split for each number of stops
- Anything a chosen store doesn't stock is named, with the nearest alternatives it does have offered as one-click swaps
- One-click cart fill: 2Kosher's server signs in to each store as the shopper and fills their real cart from a computer or a phone, with headless Chromium where a store's sign-in needs reCAPTCHA
- A bookmarklet that fills a store's cart from inside the shopper's own session, its messages origin-checked on both sides
- Store logins sealed with AES-256-GCM on the Next.js server, so the API, database and backups only ever hold ciphertext
- Invite-only accounts: scrypt password hashes, server-side sessions, sign-in throttled per email and per IP
- Savings this month, past orders with one-click reorder, favourites, and essentials suggested from earlier shops
- Admin dashboard: scrape jobs, alerts, sample data, match review, users and backups, with Run now and hiding a store from shoppers while it is still scraped
- Docker Compose on one server: Caddy HTTPS with Let's Encrypt, daily database backups keeping 7, all state in one folder that survives rebuilds
- Tested end to end: 130+ browser checks across every screen down to a 320 px phone, axe-core on every page, 190+ backend unit tests, and live cart fills at the stores themselves