LCP 1.2 s

Commerce Platform

Multi-tenant storefront with edge-rendered catalog and event-driven inventory.

Type
Web
Status
Live
Role
Lead Engineer
Duration
2023-06 → 2025-01

Overview

A commerce platform has essential components — storefront hull, API gateway, data core, auth shield, and comms array — in addition to payment and fulfillment integrations.

Key metrics

LCP

1.2s

Coverage

84%

Uptime

99.95%

Req/day

40k

Engineering highlight

ChallengeRef: ADR-007

Cart race condition under peak load

Resolved inventory overselling during flash sales by introducing optimistic locking and idempotent checkout events.

Links

Timeline

Each bar marks a documented milestone or decision.

More notes

DecisionRef: ADR-003

REST to tRPC migration

Migrated public REST endpoints to tRPC for end-to-end type safety across web and admin clients.

Featured module

Frontend Hull

Edge-rendered product catalog with ISR, i18n, and accessible checkout flows.

Summary

Multi-tenant storefront with edge-rendered catalog and event-driven inventory.

Architecture

  • Frontend HullFeatured

    Edge-rendered product catalog with ISR, i18n, and accessible checkout flows.

    Next.jsReactTailwind CSS
  • API Gateway

    Type-safe API layer with validation, rate limiting, and tenant isolation.

    tRPCZodNode.js
  • Data Core

    PostgreSQL for transactional data with Redis caching and event outbox pattern.

    PostgreSQLRedisPrisma
  • Auth Shield

    Multi-tenant RBAC with OAuth providers and session management.

    NextAuthJWTRBAC
  • Comms Array

    Stripe webhooks, email notifications, and inventory sync events.

    StripeWebhooksBullMQ

Tech stack

Next.jsTypeScriptPostgreSQLRedisStripeVercel