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.

Role
Product design and full-stack engineering, end to end
Platforms
Storefront · Ops console · REST API · Image CDN
Stack
React 18 · Vite · Tailwind · Framer Motion · Cloudflare Workers · Workers AI · PostgreSQL · Supabase Storage · Hyperdrive · Cashfree · Shiprocket
  • Workers AI
  • Streaming UI
  • E-commerce
  • Payments & COD
  • Logistics
  • RBAC
  • Edge deployment
Treviko home page with the Trevi assistant recommending products, plus the shop and a product page on mobile

Screenshots of the live product at its public address.

01

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
02

What I built

01

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.

Treviko home page with hero, product carousel and the Ask Trevi bar
02

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
Trevi answering a question about leak-proof school bottles with three product cards
03

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.

Shop page with price and rating filters beside a grid of bottles
04

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.

05

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
Treviko Operations Console staff sign-in

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.

  1. 01Shopper asks in plain words
  2. 02Worker trims history to the last 12 turns
  3. 03Catalogue snapshot added to the prompt
  4. 04Llama 3.3 70B streams the answer
  5. 05[[p:id]] markers become product cards
  6. 06Shopper adds to bag
Dealership enquiry page

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
04

Key decisions

  1. Let the catalogue answer

    Trevi only recommends from live data. That keeps a small, cheap model trustworthy and makes every suggestion shoppable.

  2. One Worker, many jobs

    API, assistant, cron housekeeping and demo reset share one deploy, so there is little to run and little to break.

  3. 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.

05

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.

  1. Open the store, ask Trevi for a bottle that won't leak in a school bag, and add a result to your bag.
  2. Check out with cash on delivery to see the full order flow.
  3. 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.