Skip to main content
All projects
AI E-commerce

Giant Store

An AI-powered storefront where a Gemini shopping assistant, grounded in the store's own catalog through local RAG, recommends only real products, in English or Arabic.

Try it liveCodeWatch the run
Giant Store
  • 0

    invented products: every recommendation is re-checked by id

  • $977

    desk setup built by the assistant for a $1,000 budget

  • 4

    step checkout with coupons and saved addresses

  • 45

    automated tests

Inside the product

See it working

Real screens and a recorded run, captured from the working product.

Giant Store
A full shopping run: the animated home page, Cmd+K search, adding to the cart, asking the AI assistant for a $1,000 desk setup and getting real product cards, the SAVE20 coupon, the four-step checkout and the order confirmation.
Giant Store
Open full size

Bilingual welcome screen introducing the platform and its key modules.

01 / 14

My role

Sole engineer: the storefront, the shopping assistant and its retrieval pipeline, checkout and the admin dashboard.

The problem

Shopping assistants built on a language model love to recommend products the store does not sell, quote wrong prices and answer in the wrong language. A store also needs the assistant to keep working when the model is slow or unavailable.

What I built

A complete storefront built with Next.js 16, React 19 and Tailwind CSS 4 that needs no database or backend setup. Each question to the assistant goes through retrieval: the catalog is split into product chunks, embedded locally with fast hashed embeddings, and only the most relevant products are passed to Gemini with a strict, versioned system prompt that forbids inventing products, matches the shopper's language and returns structured JSON.

The server then sanitizes the answer: every recommended product is validated against the catalog by id, so a hallucinated item can never reach the page. Recommendations arrive as product cards with a one-tap Add. If no key is set or the model is unavailable, a built-in local advisor answers instead.

Architecture

Next.js App Router with route handlers and a proxy. Cart, wishlist and compare live in persisted Zustand stores; auth and orders in React Context; catalog, accounts and orders are kept in the browser so the store starts with one command. The chat endpoint is hardened with same-origin checks, a body-size limit, JSON-only input, Zod validation and rate limiting. Admin-created products appear instantly in the storefront, the instant search, the recommendation rails and the assistant's index.

Challenges

Making the assistant useful and trustworthy at the same time: grounding it in the catalog, keeping prices and names exact, answering naturally in Arabic or English, and failing gracefully. A full shopping experience around it had to stay fast and smooth on phones.

Key engineering decisions

Local retrieval with hashed embeddings instead of an external embedding API, so the feature has no extra cost or setup. Server-side validation of every model output instead of trusting the prompt. Motion built with Framer Motion that respects reduced-motion settings.

Results & impact

In real runs on the production build, the assistant planned a $1,800 photography kit around a $1,199 camera, recommended a $199 GPS smartwatch in fluent Arabic, and built a $977 desk setup (a 4K monitor, a desk and a mouse) for a $1,000 budget, all as real product cards. A three-item order of $1,707 with the SAVE20 coupon took $341.40 off, unlocked free shipping and was saved at $1,474.85 with tax, and a product created in the admin went live instantly with its own page. Its Vitest suite has 45 tests across 13 files.

Highlights

  • Bilingual AI shopping assistant with local RAG and product cards
  • Server-side answer sanitization and a local fallback advisor
  • Catalog filters, sorting, grid and list views and quick view
  • Cmd+K instant search across products, categories and suggestions
  • Compare board with a best-rating-per-dollar insight
  • Cart with coupons and a free-shipping progress bar, four-step checkout
  • Accounts with order history, wishlist and reviews; role-based admin dashboard with metrics and product management
  • Animated, fully responsive interface with a mobile bottom navigation