Zenpixl
Back to case studies
CASE STUDY · E-COMMERCE SaaS / OUR PRODUCT5 min read

How we built PixlCart, a multi-tenant e-commerce platform with a database per store

PixlCart lets businesses launch their own online store with a storefront, admin dashboard and shipping integrations — each store running on its own isolated database, provisioned automatically.

Visit the live site
pixlcart.com
E-commerce SaaS live website
Industry
E-commerce
Type
Zenpixl product (SaaS)
My Role
Product Owner & Lead Engineer
Platform
Web: storefront + dashboards
THE PROBLEM

Small merchants needed their own store without the platform lock-in

Merchants who outgrow marketplaces want their own branded store, their own customer data and their own domain. Hosted builders solve part of that, but they mix every merchant's data into one system and make advanced customisation expensive.

We wanted a platform where every store is properly isolated, new stores can be launched without manual setup, and the same codebase can also run as a dedicated single-store installation for larger clients.

→Each merchant’s data had to be fully isolated from every other merchant
→New stores needed to go live without a developer setting them up
→Merchants needed both a customer-facing storefront and an admin dashboard
→Shipping and tax had to work for merchants in different countries
→Larger clients needed the option of a dedicated, single-tenant install
THE SOLUTION

A landlord layer that provisions stores, and a tenant layer that runs them

PixlCart is split into two halves. The landlord side handles registration, approval and provisioning: when a new store is approved, the platform creates a dedicated PostgreSQL database and credentials for it, registers the store's domain, then runs migrations and seed data automatically.

The tenant side runs each store. Every request is routed to the right database based on the domain it arrives on, and serves both the public storefront and the merchant's admin dashboard. A separate landlord dashboard lets our team manage stores, and a marketing site handles sign-ups.

Automatic store provisioning: database, credentials, migrations and seed data
Domain-based routing to each store’s own database
Customer storefront built with Next.js for speed and SEO
Merchant admin dashboard for products, orders, customers and roles
Landlord dashboard for the PixlCart team to approve and manage stores
Shipping carrier support (USPS, UPS, FedEx, DHL, Royal Mail, DPD, Canada Post) and VAT-aware invoicing
Single-tenant mode for clients who want a dedicated installation
TECHNICAL HIGHLIGHTS

Why we built it this way

01

A separate database for every store

Instead of one shared database with a store ID on every row, each store gets its own PostgreSQL database. A bug in one query can never leak another merchant’s data, backups and exports are per store, and a heavy store cannot slow the others down.

02

Resolve the tenant from the domain, then cache it

Each request looks up the store by its host name in a management database, decrypts that store’s credentials and connects. Connection details and database clients are cached in memory, so the lookup cost is paid once rather than on every request.

03

Encrypted tenant credentials

Database passwords for each store are stored encrypted in the management database and only decrypted in memory when needed, so a leaked management table does not expose store databases.

04

One codebase, two deployment modes

A single environment switch runs the same API either in multi-tenant mode for the SaaS or in single-tenant mode for a dedicated client install. We maintain one codebase while serving both small merchants and larger custom clients.

05

Typed, validated APIs

The backend is written in TypeScript with Prisma for database access and Zod schemas validating every request, with Swagger documentation for the store API. This keeps a large surface area manageable for a small team.

THE RESULTS

Live, growing, and trusted

New stores are provisioned automatically, without manual server work
Complete data isolation between merchants by design
Storefront, merchant dashboard and landlord dashboard on one platform
Shipping and tax support for US, UK, Canadian and Australian merchants
Same codebase powers both the SaaS and dedicated client installations
TECH STACK
Node.jsExpressTypeScriptPrismaPostgreSQLZodNext.jsReactTailwind CSSDockerSwagger / OpenAPIJWT Auth

Planning an e-commerce platform or marketplace?

We build commerce platforms that are isolated, fast and ready to scale — from a single store to a multi-tenant SaaS.

Discuss your project