← Back to Work
Co-founder · CTO2024 — Present

CP Core Template

As Co-founder & CTO of Curious Packet, I architected and built a proprietary, production-ready full-stack e-commerce platform engine — with dedicated design and frontend collaborators — using Next.js 15, Neon Serverless Postgres, Drizzle ORM, and AWS S3 — designed to be forked and customized per client. This single template now powers three live storefronts (Shopiko, Bab Al Bahar, Everest Communications), cutting time-to-launch from months of greenfield work to days of configuration.

The Challenge

As I scaled Curious Packet from a solo consultancy into a product studio, I was winning e-commerce contracts for small-to-mid-sized brands — but every project started from scratch. Each engagement meant re-implementing the same core systems: authentication, product catalogs, cart logic, checkout flows, admin dashboards, and media pipelines. This created three compounding problems:

Slow delivery cycles. Wiring up a database, auth layer, S3 bucket, and admin UI consumed the first 4–6 weeks of every project before any client-specific work could begin.

Inconsistent quality. Subtle differences between projects — different state patterns, validation approaches, or auth implementations — made context-switching error-prone and increased maintenance burden across the portfolio.

Scaling the business was impossible. I couldn't take on parallel client work because each project demanded undivided, bespoke engineering effort.

I needed a single, opinionated, enterprise-grade foundation that could be forked, themed, and deployed for any e-commerce client — without sacrificing performance or type safety.

The Solution — Technical Deep Dive

Choosing the Stack

Every technology choice was deliberate, optimized for edge-readiness, type safety, and developer velocity:

LayerTechnologyWhy
FrameworkNext.js 15 (App Router + Turbopack)React Server Components for SEO-optimal SSR; Turbopack for sub-second local HMR
DatabaseNeon Serverless PostgresEdge-compatible serverless driver — queries execute in the same edge runtime as Next.js middleware, eliminating cold-start latency
ORMDrizzle ORMZero-codegen, native TypeScript inference — a schema change surfaces type errors in downstream components instantly, no build step needed
StorageAWS S3 + Imgix CDNPre-signed URL uploads bypass the server for large media; Imgix handles on-the-fly image transformations
Authbcryptjs + joseFull control over session logic — edge-compatible JWT verification with zero per-user SaaS costs across all client deployments
StylingTailwind CSS v4 + Radix UIUtility-first CSS with accessible headless primitives for rapid, consistent UI development
StateZustand + SWRLightweight global state for cart/checkout with stale-while-revalidate data fetching
ValidationZod + drizzle-zod + React Hook FormSingle schema definition shared from database to form — one source of truth

Core Architecture Decisions

Authentication without third-party lock-in

Rather than depending on Auth0 or Clerk, I implemented a custom auth system using bcryptjs for password hashing and jose for JWT management. The trade-off was more upfront engineering, but the payoff was full control over session logic, edge-compatible token verification, and zero recurring per-user costs across all client deployments.

End-to-end schema validation

I unified the validation layer using Zod schemas shared between the Drizzle database definitions (via drizzle-zod), React Hook Form resolvers, and Next.js server actions. A single source of truth — one schema change propagates type errors from database column to checkout form field.

Media optimization with ThumbHash

Implemented ThumbHash to generate ultra-compact image placeholders at build time, delivering a perceived-instant loading experience without the bandwidth cost of blurred base64 previews that plagued earlier projects.

Key Modules Built

01

Storefront Engine

Dynamic product routing, Zustand-powered cart with schema-validated state, and a multi-step checkout flow with server-side order finalization.

02

Admin Dashboard

Role-protected routes with Recharts-powered sales analytics, @dnd-kit drag-and-drop for category/image reordering, and TanStack Table for paginated data management.

03

Seeding Pipeline

Authored db:seed scripts using Faker.js to provision realistic product, order, and user data — enabling instant demo environments for client pitches.

04

Transactional Email System

Component-driven email templates with React Email and Resend, ensuring order confirmations and auth flows render consistently across email clients.

My Role & Workflow

Co-founder & CTO — I designed, built, and maintain this template end-to-end as the technical foundation of Curious Packet's service offering.

Technical strategy. Made all technology selection and architectural decisions. Evaluated trade-offs between DX speed, runtime performance, long-term maintainability, and cost-per-client.
Modular codebase design. Established strict separation of concerns: Data Access Layer (lib/dal.ts), database schemas (db/schema/), API route handlers, and presentational UI components — making it trivial for collaborators (or myself across contexts) to navigate.
Git workflow. Developed on a develop branch with feature branches per module. Merged to main only after manual integration testing across at least one client fork.
Client deployment model. Standardized a fork-and-configure workflow: clone the template, swap environment variables and theme tokens, customize content schemas, deploy. Typical client onboarding compressed to 2–3 days.

Results & Impact

3Client Storefronts Launched
~70%Reduction in Kickoff Time
0Runtime Type Errors in Prod

The template enabled Curious Packet to take on parallel engagements — turning what was sequential, bespoke work into a scalable product-led service model.

Key Learnings

01

Invest in foundations early.

The upfront cost of building a reusable template was significant, but it paid for itself by the second client project. Every subsequent engagement started weeks ahead.

02

Edge-first architecture is non-negotiable for e-commerce.

Choosing edge-compatible tools (Neon, jose, Next.js middleware) from the start avoided painful migrations later when performance became a competitive differentiator.

03

Type safety is a force multiplier for small teams.

With Drizzle + Zod + TypeScript, I catch the vast majority of bugs at the type level before running the app. Critical when maintaining multiple client forks simultaneously.

04

Own your auth when you own the platform.

Third-party auth simplifies individual projects but becomes a cost and flexibility bottleneck when deploying the same system for many clients.

← Back to Work