Polestark

My own D2C store, built solo: a Next.js shop with an AI shopping assistant grounded in the live catalog.

How it connects

Razorpay webhookShiprocketZeptoMailCloudflare R2Mistral

CategoryWeb
Timeline2026
ContextOwn brand · Solo build
StatusLive · polestark.com
Polestark storefront
29.5klines of TypeScript
32database models
41+49pages + API routes
62of 62 commits, solo

The product

Polestark is a complete direct-to-consumer commerce stack for my 3D-printing brand: storefront, variant-matrix catalog, Razorpay payments with a verified webhook, COD eligibility, Shiprocket logistics, transactional email, and an admin panel to run it all.

The standout is an AI shopping assistant with real tool-calling: a bounded Mistral loop that searches store policies and cites them, validates its own JSON output, keeps a product only if it exists, is active and is in stock, and logs every query with latency, tunable from an admin panel.

Under the hood

THE ENGINEERING

  • 01

    Normalized product-variant matrix (base → options → variants) — a real catalog model, not a toy CRUD

  • 02

    AI assistant with tool-calling, guardrails and per-query latency logging; admin-tunable model/temperature/limits

  • 03

    Grounded answers: the in-stock catalog in the prompt, a policy-search tool with cited sources, zod-validated JSON and at most two tool calls per question

  • 04

    Razorpay webhook checks the HMAC signature over the raw body, so orders complete even if the buyer closes the tab

  • 05

    SEO as engineering: per-entity OG image generation, JSON-LD, merchant feeds for Google Shopping & Meta Commerce

  • 06

    Image pipeline: admin uploads become three square WebP sizes (200, 600 and 1,200 px) made with sharp, stored in Cloudflare R2 and served through a custom image loader

  • 07

    Abandoned-cart cron, guest-cart sync on login, geolocation address autofill in quick checkout

Next case study

ToolSamurai →