The challenge
Most off-the-shelf commerce platforms charge a transaction fee on top of a subscription, lock catalog and checkout logic behind an app-store of third-party plugins, and give a store owner limited control over how their own storefront actually behaves. For a client who needed subscriptions, loyalty points, multi-vendor listings and gift cards all working together — not five separate plugins that half-integrate — the existing platforms meant either an expensive enterprise plan or a fragile plugin stack. We built our own instead of gluing someone else's together.
The solution
The result is a Next.js storefront and a separate Next.js/Prisma admin backend, both running against one shared database schema instead of a headless CMS bolted onto a checkout SDK. The commerce layer includes real subscriptions and loyalty points as native models (not third-party add-ons), a multi-vendor path for marketplace-style catalogs, gift cards, wishlists and back-in-stock alerts, and an AI-assisted layer (Google Gemini / OpenAI) behind product recommendations and support. Authentication runs on HttpOnly, SameSite cookies with a double-submit CSRF token checked in middleware — not tokens sitting in localStorage — and the storefront talks to the backend through same-origin API rewrites so the backend's real origin is never exposed to the browser.
Key features
- Subscriptions, loyalty points, gift cards and multi-vendor listings as native database models — not a stack of third-party plugins that half-integrate.
- Cookie-based auth (HttpOnly, SameSite) with double-submit CSRF protection enforced in middleware, instead of tokens readable from client-side JavaScript.
- Same-origin API rewrites, so the storefront never exposes the backend's real origin to the browser.
- An AI-assisted layer behind product recommendations and customer support, built on top of real purchase and behavior data already in the schema.
- A full admin backend — orders, inventory, CRM, support tickets and audit logging — not just a headless catalog with no operations layer.
Tech & tools
The process
Schema first
Designed the Prisma schema around every commerce concept the platform needed to support natively — orders, subscriptions, loyalty, vendors, gift cards — before writing a single storefront page, so features didn't get bolted on as afterthoughts.
Backend before storefront
Built the admin backend and its API surface first, so the storefront was written against a real, working API rather than the two being developed in parallel and drifting apart.
Security hardening pass
Ran a dedicated audit converting token-in-localStorage auth to HttpOnly cookies, adding CSRF middleware, CORS allowlisting and standard security headers (CSP, HSTS, X-Frame-Options) — documented in the project's own security reports, not just assumed.
AI integration
Added recommendation and support features on top of the existing order/behavior data already in the schema, rather than standing up a separate AI service with its own data pipeline.
Key results
- One shared schema drives subscriptions, loyalty, gift cards and multi-vendor listings together — a store owner isn't stitching together separate plugins that don't share customer or order data.
- Authentication moved from localStorage tokens to HttpOnly cookies with CSRF middleware, closing the token-theft-via-XSS risk that a client-side-readable token carries.
- The storefront never calls the backend's real origin directly — every request goes through same-origin rewrites, so the backend URL isn't exposed in browser network traffic.
- A live, demoable admin backend and storefront exist today — this isn't a pitch deck, it's a running platform you can log into.
Target audience
Store owners who've outgrown a plugin-stitched Shopify/WooCommerce setup, or need subscriptions, loyalty and multi-vendor working together from day one.
Future scope
Refresh-token rotation with server-side revocation and request-schema validation (zod) across every API route are the next items on the platform's own hardening checklist.
Try it yourself
Both the storefront and the admin backend are live and demoable right now.

