D2C storefront · Ops console · AI shopping assistant
Treviko
A live online store for a Rajkot home-essentials brand: a fast storefront with Trevi, an AI assistant that finds the right product, and an operations console for the team that runs catalogue, stock, orders, returns and money.
- Workers AI
- Streaming UI
- E-commerce
- Payments & COD
- Logistics
- RBAC
- Edge deployment

Screenshots of the live product at its public address.
The problem
A manufacturer with 50 everyday products and a warehouse in Rajkot needed to sell to homes across India, not only through dealers. Shoppers don't know which bottle won't leak in a school bag, and the team needed one place to run stock, orders, returns and cash on delivery without a spreadsheet.
- 50
- Products in 6 categories
- 90+
- API endpoints
- 40+
- Database tables
What I built
A storefront that feels like the brand
Warm, image-led pages with a clear promise up top: 24-hour dispatch, food-grade polymers and cash on delivery. Search, categories, a wishlist and a bag work the same on a phone as on a desktop.

Trevi, an assistant that shops with you
Shoppers type what they need in plain words. Trevi answers in a stream and shows real products as cards, grounded in the live catalogue, so it never invents an item or a price.
- Llama 3.3 70B on Workers AI, streamed over server-sent events
- A compact catalogue snapshot, cached for 60 seconds, is the model's only source of truth
- The model writes [[p:id]] markers that the storefront turns into product cards

Browsing built for 50 products, not 5
Category chips, a price slider, rating filters and a grid density switch. Each product shows its discount, badges and swatches before you open it.

Products with real variants
Shade and size are separate choices with their own stock, so the bag always holds a specific item that can be shipped. Prices show the saving and that tax is included.


A console for the people behind the store
Staff sign in to an operations console for products, stock, orders, returns, coupons, reviews, banners, warehouses and payments. Each staff role sees only what it needs, and every action is written to an audit log.
- Roles such as catalogue, operations, finance, marketing and support
- Order, shipping, return and refund flows in one place
- Dealership leads and newsletter sign-ups captured from the storefront

03 AI and edge engineering
A streaming assistant on the edge, and a store that resets itself
The whole backend runs on Cloudflare Workers next to a Postgres database. The assistant, order housekeeping and the nightly demo reset are all streamed or scheduled from the same Worker.
- 01Shopper asks in plain words
- 02Worker trims history to the last 12 turns
- 03Catalogue snapshot added to the prompt
- 04Llama 3.3 70B streams the answer
- 05[[p:id]] markers become product cards
- 06Shopper adds to bag

Dealership page on the live site.
Grounded, not guessing
The model only sees active products with price, rating, colours, sizes and stock, so recommendations are real and in stock.
Guardrails on input
Conversation history and message length are capped, which keeps answers fast and cost predictable.
Orders that clean up after themselves
A cron trigger every 10 minutes expires unpaid online orders and syncs payment and courier status.
Images through a cached proxy
Product images live in storage and are served by a small Worker that caches them at the edge.
Locked-down database
The API talks to Postgres through Hyperdrive with a dedicated role. Public tables have row-level security on with no policies, so the database's own REST keys can read nothing.
A demo that resets every night
At midnight IST the data is restored to a saved baseline and uploaded files are removed, so anyone can place test orders and the store is clean the next day.
- Storefront
- React 18 · Vite · Tailwind · Framer Motion
- API
- Cloudflare Worker · 90+ endpoints · customer and admin
- AI
- Workers AI · Llama 3.3 70B · streamed
- Data
- PostgreSQL on Supabase · Hyperdrive · 38 migrations
- Payments
- Cashfree-ready · cash on delivery
- Logistics
- Shiprocket · labels · warehouses
- Access
- Role-based staff · audit log
- Deploy
- Workers on treviko.kairn.in · nightly demo reset
Key decisions
Let the catalogue answer
Trevi only recommends from live data. That keeps a small, cheap model trustworthy and makes every suggestion shoppable.
One Worker, many jobs
API, assistant, cron housekeeping and demo reset share one deploy, so there is little to run and little to break.
Make the demo safe to poke
A nightly reset and fake-data rules mean reviewers can try every flow without anyone cleaning up after them.
Try it yourself
The store is live and runs as a public demo. Everything you create is wiped at midnight IST, so place test orders freely.
- Open the store, ask Trevi for a bottle that won't leak in a school bag, and add a result to your bag.
- Check out with cash on delivery to see the full order flow.
- Create your own customer account from Sign in; sign-up is open.
Customer
treviko.kairn.in, Sign in
- ID
Create any account from Sign in
Use fake details; they are deleted nightly.
Please don't enter real personal or payment details anywhere on the demo.
