All projects

Case study 02 — Full-stack

Bazar Dor

Daily market prices for 33 everyday products in Bangladesh — written in Bangla, checked before buying, and protected behind a real auth flow. My first build with an actual database, sessions, and a production domain.

Role
Solo — full-stack build
Timeline
2025
Type
Market price tracker
Status
Live on Vercel
Focus
Auth, SQL aggregation, locale
Bazar Dor homepage with daily market prices in Bangla

Why I built it

In Bangladesh, the price of vegetables and staples moves daily and varies by market. The information exists, but it is scattered, often written in English, and rarely shaped for a quick decision. A buyer wants one thing: is today a good day to buy this?

Bazar Dor answers that in Bangla. It lists 33 products across eight categories, shows today's price and the change from yesterday, and opens into a per-market breakdown. Public pages give the overview; the detailed market table requires an account, which gave me a real reason to implement authentication properly rather than bolt on a fake login screen.

What's in it

  • A daily overview with price risers, fallers, and the full product list.
  • Eight categories with a sort-by-price control that understands direction, not just alphabet.
  • Product detail pages showing the lowest, highest and average price plus a table for each market.
  • Email/password auth through Better Auth, with a profile page for editing your name.
  • Bangla numerals end to end, including formatted prices and percentage changes.
  • Loading skeletons, empty states and a mobile-first layout, with upstream prices cached for an hour.

The parts that took thought

01

Auth that worked locally and failed in production

Better Auth validated the request origin, and my production domain was not in the trusted list. Sign-up worked on localhost:3001 and broke on Vercel with a session that never stuck. The fix was configuration, not code: add the deployed origin to trustedOrigins, set the correct base URL, and keep the secret in the hosting environment. I now treat auth config as part of the deployment checklist, not an afterthought.

02

One product, many markets, one query

The detail page needs the lowest, highest and average price for a product across all markets. The naive version loops over markets and issues a query per row. I pushed the aggregation into PostgreSQL with a grouped query, then shaped the rows into a summary plus a table. Fewer round trips, and the numbers are computed by the database that owns the data.

03

Bangla numbers without breaking sorting

Prices are displayed with Intl.NumberFormat("bn-BD"), which produces Bangla numerals. That is right for reading and wrong for sorting — string order is not numeric order. I kept the raw numeric value alongside the display string, sorted on the number, and only formatted at the edge. The same split applies to percentage changes and their up/down arrows.

04

Not hammering somebody else's API

Prices come from an external worker and change at most once a day. Re-fetching on every request would be wasteful and fragile. The data layer caches responses for an hour, so the common path is fast and the upstream service sees a fraction of the traffic. It also made local development predictable when the upstream was slow.

What I would improve next

  • Price alerts: watch a product and get told when it crosses a threshold.
  • Seven-day sparklines so a single price has context.
  • Search and a persistent category filter for the full list.
  • Rate limiting on auth and price endpoints.
  • Integration tests for the aggregation query and the auth callback.
  • A watchlist that syncs across devices — the natural next use of the account system.