New

20% off - LAUNCH20

Shop
Back to Case Studies
Featured

Kinetia Store — Multi-Tenant E-Commerce Platform

Kinetia Store E-commerce / SaaS
48
REST Endpoints
8
Promotion Types
23
Database Tables

Situation

Independent merchants need to launch online stores without technical knowledge or their own infrastructure. The alternatives are expensive SaaS platforms (Shopify, BigCommerce) or custom development. A multi-tenant platform was needed where each merchant could create, configure, and operate their own store from a single shared system.

Task

Build a complete multi-tenant e-commerce platform with product catalog, shopping cart (registered users and guests), checkout with order management, a configurable rules-based promotion engine, independent admin dashboard, public storefront per store, and i18n support in 3 languages.

Action

Developed a Turborepo monorepo with 3 applications (Express 5 REST API, Next.js 15 SSR Storefront, Next.js 15 Admin Dashboard) and 4 shared packages. Implemented logical tenant isolation via storeId-scoped queries on PostgreSQL 17, a 4-stage promotion engine with 8 discount types and AND/OR condition grouping, JWT auth with refresh token rotation, and guest cart support with session-based IDOR protection.

Result

Platform in active development with 5 of 14 roadmap phases completed (foundation, auth, orders, promotions, storefront). The codebase spans 23 database tables, 48 REST endpoints, and 291 commits across all branches. The promotion engine supports 8 discount types with composable conditions, 11 comparison operators, and 9 target types.

Technologies Used

Next.js 15 Express 5 TypeScript PostgreSQL 17 Drizzle ORM Redis 7 Turborepo

The Challenge

Independent merchants face a tough choice: pay premium SaaS fees (Shopify at $39–399/month), deal with rigid templates, or invest heavily in custom development. Small and medium businesses need the flexibility of a custom solution at the cost of a shared platform. Kinetia Store aims to be that platform — a multi-tenant e-commerce system where any merchant can launch a fully-featured store without writing a single line of code.

Our Approach

We built Kinetia Store as a modular monolith using Turborepo:

  1. 3 Applications — Express 5 REST API, Next.js 15 SSR Storefront (customer-facing), and Next.js 15 Admin Dashboard (merchant-facing)
  2. 4 Shared Packages — Database schemas + migrations, ESLint config, TypeScript config, and Tailwind config
  3. Service Layer Pattern — Routes handle HTTP + Zod validation, Services contain business logic, keeping concerns cleanly separated
  4. Multi-Tenant by Design — Every entity references storeId, all queries are tenant-scoped, with row-level locking for concurrent tenant creation

Rules-Based Promotion Engine

The promotion system is a 4-stage pipeline: fetch → evaluate conditions → apply actions → stacking rules.

TypeDescription
Percentage10% off entire order
Fixed Amount$5 off orders over $50
Buy X Get YBuy 2, get 1 free
BundleDiscount when buying specific items together
Mix & MatchCombine items from different categories
TieredIncreasing discounts at quantity thresholds
Free ShippingWaive shipping on qualifying orders
BOGOBuy one, get one at 50% off

Conditions support AND/OR grouping with 11 comparison operators and 9 target types (products, categories, collections, cart total, and more). Bulk loading in parallel prevents N+1 queries. Merchants configure promotions visually from the admin dashboard — no code needed.

Technical Highlights

  • Multi-Tenant Isolation — Logical isolation via storeId on a single PostgreSQL instance; dual ownership (admin + merchant) with polymorphic FKs; slug→UUID resolution via res.locals to survive Express 5 Router boundaries
  • Guest Cart System — Session-based carts with 30-day expiration; IDOR protection via session header validation; seamless merge when guests register
  • JWT Authentication — Short-lived access tokens (15min) with refresh token rotation (7d); secure cookie transport
  • Internationalization — next-intl with 3 languages (Spanish, English, Portuguese) on both Storefront and Admin
  • Type Safety End-to-End — Drizzle ORM for type-safe SQL, Zod validation on all API inputs and env vars, shared TypeScript configs
  • Race Condition Prevention — Row-level locking with transactions for concurrent tenant creation

Architecture

kinetia-store/
├── apps/
│   ├── api/          # Express 5 REST API (Node.js 24)
│   ├── storefront/   # Next.js 15 SSR (customer-facing)
│   └── admin/        # Next.js 15 (merchant dashboard)
├── packages/
│   ├── database/     # Drizzle schemas + 23 tables
│   ├── eslint-config/
│   ├── typescript-config/
│   └── tailwind-config/

Current Status

Kinetia Store is in active development with a 14-phase roadmap:

  • Phases 0–4 — Complete (foundation, auth, orders, promotions, storefront)
  • Phase 5 — Admin Dashboard (in progress)
  • Upcoming — Stripe payments, account management, transactional emails, inventory, advanced search, production readiness (CI/CD, monitoring)

Codebase metrics: 291 commits, ~80 merged PRs, 10 test files, 104 planned tasks (38 completed).

Ready to Write Your Success Story?

Let's discuss how we can help solve your technical challenges.

Let's Talk