Case Study

Fragscentric

2,000+ customers Serverless commerce Catalog-grounded AI

I started Fragscentric in 2022, selling fragrance decants through Telegram and social communities. The business has served more than 2,000 customers. As its owner and developer, I built a storefront with checkout, inventory management, customer accounts, and delivery tracking around that existing business.

I chose Astro for the storefront and a Hono API backed by Cloudflare D1. Pages and D1 keep the core hosting and database within the free tier at the current workload. SMS and AI usage are separate costs.

Stock belongs at checkout

Fragrance decants come in different sizes, each with its own price and stock. I keep product descriptions in static pages, fetch availability at runtime, and resolve products and prices again in the API when an order arrives. Checkout has to check what is available at that moment.

I reserve stock with conditional database updates that only succeed when enough units remain. The service checks which reservations succeeded and restores them if another item is unavailable or order creation fails. Order items store the purchased name, size, and price as snapshots, so later catalog edits don’t rewrite a customer’s purchase history.

Status changes follow an explicit transition map. The update also checks the previous status in the database; if another action has changed it, the caller has to reload. Cancellations release held stock, while reopening a released order requires a fresh availability check.

Because the static catalog and database share product slugs, a repository check validates their alignment and catches missing product assets before deployment.

Running orders from Telegram

I already used Telegram to run the business, so I added order notifications with inline action buttons. Those actions call the same order service as the admin interface. The bot doesn’t maintain a second set of inventory or status rules.

Bot actions are restricted to the configured administrator. Customers get a separate tracking page that combines the store’s order status with live Pathao courier activity. Signed tracking links let them open an order from an SMS without creating an account.

Recommendations tied to available stock

The fragrance advisor uses retrieval-augmented generation over the current catalog. The API searches product attributes and applies filters such as budget, season, and availability before passing product data to the model. Prices include active promotions.

When a search is too narrow, retrieval relaxes preference filters in stages while retaining the in-stock requirement. Generated product references are checked against the retrieved catalog before they become recommendation cards. A deterministic fallback can return available products when the model response is unusable, with a support handoff when there is no suitable match.