ZestyShop
All ProductsPhysicalDigitalCategories
Account
All articles

Architecture

Published June 2026

ZestyShop runs on Next.js 16 deployed to Vercel with Aurora PostgreSQL as the primary database. Auth, payments, file storage, and email all flow through AWS services or integrated providers.

graph TD classDef tier1 fill:#1e1b4b,stroke:#ec4786,stroke-width:2px,color:#f8fafc classDef tier2 fill:#0f172a,stroke:#475569,stroke-width:1.5px,color:#e2e8f0 classDef tier2aws fill:#0c192e,stroke:#3b82f6,stroke-width:1.5px,color:#e2e8f0 classDef tier2pay fill:#0a2a1e,stroke:#14b8a6,stroke-width:1.5px,color:#e2e8f0 classDef ext stroke:#ec4786,stroke-width:2px,color:#e2e8f0 browser[("Browser")] browser:::ext vercel["Vercel"] vercel:::tier1 ssr["Server Components"] client["Client Components"] api["API Routes"] auth["Better Auth"] ssr:::tier2 client:::tier2 api:::tier2 auth:::tier2 vercel --> ssr vercel --> client vercel --> api vercel --> auth aurora["Aurora PostgreSQL"] s3["S3"] ses["SES"] iam["IAM / OIDC"] aurora:::tier2aws s3:::tier2aws ses:::tier2aws iam:::tier2aws stripe["Stripe"] dodo["DodoPayments"] stripe:::tier2pay dodo:::tier2pay browser -->|HTTPS| vercel vercel -->|Kysely| aurora vercel -->|Presigned POST| s3 vercel -->|SMTP| ses vercel -->|STS| iam vercel -->|Webhooks| stripe vercel -->|Checkout| dodo

Data Flow

  • Browser → Vercel — All traffic hits the Vercel edge network. Server Components render pages server-side; Client Components handle interactivity.
  • Vercel → Aurora PostgreSQL — Products, orders, user accounts, reviews, categories, and discount codes all live in a single Aurora PostgreSQL cluster. Kysely provides typed queries.
  • Vercel → Stripe / DodoPayments — Better Auth plugins handle subscription management (Stripe) and one-time checkout (DodoPayments). Webhooks sync payment status.
  • Vercel → S3 — Product images and file uploads use presigned POST URLs. The browser uploads directly to S3 — the server never touches the file.
  • Vercel → SES — Transactional emails (verification, password reset, order confirmation, shipping notification) are sent via Amazon SES with DKIM-signed domain.
  • Vercel → AWS via IAM — Vercel OIDC provides temporary credentials via STS role assumption. No long-lived access keys in production.

Why Aurora PostgreSQL?

Aurora PostgreSQL was chosen for ACID compliance, native JSON support, and managed scaling. All relational data — products, orders, users, reviews, categories, and discount codes — lives in a single Aurora cluster. This keeps joins fast and schema migrations simple.

For local development, the app uses PGlite — an in-process WASM Postgres that requires zero external dependencies. The same SQL runs in dev and production. The app detects PGlite vs Aurora automatically via lib/db-pool.ts.

Auth & Sessions

Better Auth manages email/password and Google OAuth sign-in. Sessions last 30 days with auto-refresh. The Stripe and DodoPayments Better Auth plugins link subscriptions and checkout to user accounts. All auth queries go through the Kysely adapter to PostgreSQL.

Scale Strategy

The architecture is designed for growth. Aurora PostgreSQL scales vertically or via read replicas. S3 and SES are fully managed — they scale to any load. Vercel's edge network handles global distribution. The only stateful bottleneck is the database, and Aurora's Multi-AZ deployment provides both high availability and read scaling.

Read next

The Creation of ZestyShopFrom Storefront to Operations
ZestyShop

Bold products, playful vibes. Find your next favorite thing — physical or digital.

Shop

  • All Products
  • Physical Products
  • Digital Products
  • Categories

Account

  • My Account

Help

  • FAQ
  • Shipping Info
  • Returns
  • Contact Us
  • How We Built This
  • From Storefront to Operations

© 2026 ZestyShop. All rights reserved.

PrivacyTerms