All Lab Projects
Commerce InfrastructureOpen SourceMIT License Open Source Primitive

OpenStore

Composable storefront primitives for teams that want ownership of their stack.

01 THE PROBLEM & MOTIVATION

Why we had to
build this.

OpenStore is an un-opinionated, headless commerce foundation built for Next.js 16 and React 19. It strips away SaaS merchant lock-in, giving product teams complete control over cart state, checkout orchestration, inventory synchronization, and custom pricing models.

The Core Problem:

Traditional hosted platforms force teams into rigid template engines, restrictive checkout APIs, and steep transaction rev-shares. Building from scratch takes months. OpenStore provides the robust primitive layer — cart pipelines, payment adapters, and stock reconcilers — without dictating design or hosting.

Who it is built for:

  • High-growth DTC brands outgrowing Shopify checkout limitations
  • Digital product studios building bespoke client marketplaces
  • Engineering teams requiring multi-currency, localized, offline-first carts

02 INTERACTIVE MICRO-SANDBOX

Test the primitives
in your browser.

In-browser interactive simulation of the underlying protocol, data flow, and runtime constraints.

SUB-50MS P99 CHECKOUT BENCHMARK ENGINE
p99: 47msZero GC PausesMemory-Mapped Ring Buffer

Edge Checkout Concurrency Simulator

Benchmark OpenStore's optimistic checkout pipeline. Simulate high-concurrency order surges, idempotency locking, and zero-latency stock allocation at the network edge.

Concurrency Pressure: 500 req/sec
Batch Size: 500 tx
Execution Pipeline State:
Committed: 500 tx (100% success rate)
P50 LATENCY (MEDIAN)18 msTypical client round-trip
P95 LATENCY34 ms95% of orders completed
P99 SLA GUARANTEE47 ms Sub-50ms constraint satisfied
STOCK OVERSELLS0 conflictsAtomic CAS ring buffer
LATENCY DISTRIBUTION HISTOGRAM (N = 0)
Sub-50ms Distribution
0
< 15ms
0%
0
15-25ms
0%
0
25-35ms
0%
0
35-45ms
0%
0
45-50ms
0%
0
> 50ms
0%
Sub-50ms SLA Target Region (0% of traffic)
Tail Outliers > 50ms (0%)
TRANSACTION LATENCY BUDGET WATERFALL (AVERAGE)
1. Optimistic Stock Lock & Token Check3.4ms
2. Idempotency Key Atomic CAS in Edge KV4.2ms
3. Payment Gateway Async Handshake8.6ms
4. Memory-Mapped Ring Buffer Ledger Commit2.2ms
LIVE COMMITTED ORDERS FEED
Edge Ring Buffer
Order IDSKUAmountLatencyStatus

03 SYSTEM ARCHITECTURE

How the pieces
fit together.

A layered edge-first architecture: client-side optimistic UI cart, edge middleware session hydration, and modular provider adapters for Stripe, Razorpay, and custom warehouses.

LAYER 01

Storefront UI

React 19 Server Components with Optimistic Cart Hooks

Next.js 16 / React 19
LAYER 02

Cart Pipeline

State synchronization with conflict resolution and offline queue

IndexedDB / Edge KV
LAYER 03

Adapter Engine

Unified connector interface for Stripe, Medusa, and Postgres

TypeScript
LAYER 04

Inventory Mesh

Idempotent stock allocation with webhooks

Serverless Functions

04 CORE CAPABILITIES

Designed for
real production.

01

Zero-Latency Optimistic Cart

Instant cart modifications that reconcile in the background without blocking layout shifts.

EXAMPLE USAGE
const { addItem, items, subtotal } = useCart()
await addItem({ id: 'sku_123', quantity: 1, optimistic: true })
02

Pluggable Payment Gateway Mesh

Switch from Stripe to Razorpay or local bank rails with a single environment config change.

EXAMPLE USAGE
export const checkout = createCheckoutSession({
  provider: 'stripe',
  mode: 'payment',
  lineItems: cart.items
})
03

Multi-Tenant Currency & Tax Engine

Real-time localized price conversions and VAT calculation at edge without cold start latency.

< 12msCart Hydration
Design target
4.8 kBBundle Size
Zero external runtime
Zero-AllocState Machine
Zero-allocation state machine
ComposableArchitecture
Zero SaaS merchant lock-in

05 PUBLIC ROADMAP

What's shipped and
what is next.

Shipped Q3 2026

Multi-Warehouse Inventory Splitting

Route order line items to distinct fulfillment hubs dynamically.

In Progress Q4 2026

One-Click Subscriptions Engine

Recurring billing primitives without third-party vendor lock-in.

Planned Q1 2027

Agentic Checkout Assistant

Natural language shopping interface for mobile and terminal clients.

06 COMPANION LAB TRACKS & ESSAYS

Learn the architecture.
Build the primitives.

Every open-source primitive is accompanied by a hands-on learning track and an in-depth architectural breakdown written by our engineering pod.

ABETA LEARN TRACK

Build a Composable Storefront

Build optimistic cart hooks, idempotency locks, and sub-15ms hydration with React 19 in your browser.

Start Learning Track
TECHNICAL ESSAY

Building a Memory-Mapped Ring Buffer for Sub-15ms Cart Hydration

Read the comprehensive engineering whitepaper detailing our algorithms, benchmark flamegraphs, and production trade-offs.

Read Architectural Deep Dive

07 JOIN THE LAB

Contribute to
OpenStore.

Whether you want to file an issue, submit a design example, optimize an edge route, or write documentation, all contributions are welcomed and credited.