Installation
Set up the NexusCommerce development environment with pnpm, Docker, and Supabase Cloud.
Overview
NexusCommerce is a pnpm monorepo with four runnable services: a Next.js frontend, a NestJS API, Python AI workers, and a Fumadocs documentation site. Supporting infrastructure (Redis, ClickHouse, Grafana) runs via Docker Compose. The primary database and auth are hosted on Supabase Cloud.
For production deployment, see Deployment.
Key Concepts
Monorepo — All code lives in a single repository managed by pnpm workspaces and Turborepo. Running pnpm dev starts all services with hot reload.
Supabase Cloud — NexusCommerce uses managed Supabase for PostgreSQL, Auth, Storage, and Realtime. No local database setup required.
Docker Compose (dev) — Redis, ClickHouse, Python workers, and Grafana run as containers via infrastructure/docker-compose.yml.
Getting Started
Prerequisites
- Node.js 22+
- pnpm 10+ (
corepack enable && corepack prepare pnpm@10 --activate) - Docker Engine 24+ with Compose V2
- A Supabase Cloud project (free tier works)
Step 1: Clone and install
git clone https://github.com/your-org/nexuscommerce.git
cd nexuscommerce
pnpm installStep 2: Configure environment
cp .env.example .envFill in the required values:
# Supabase (from your Supabase project settings)
NEXT_PUBLIC_SUPABASE_URL=https://xxx.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ...
SUPABASE_SERVICE_ROLE_KEY=eyJ...
SUPABASE_DB_URL=postgresql://postgres:[email protected]:5432/postgres
# API
API_PORT=3001
FRONTEND_URL=http://localhost:3000
# Redis + ClickHouse (defaults work with Docker Compose)
REDIS_URL=redis://localhost:6379
CLICKHOUSE_URL=http://localhost:8123
CLICKHOUSE_USER=defaultStep 3: Start infrastructure services
cd infrastructure && docker compose up -dThis starts Redis (6379), ClickHouse (8123), Python workers (8288), and Grafana (3333).
Step 4: Apply database migrations
npx supabase db pushThis creates all 25+ tables with RLS policies and indexes.
Step 5: Start the development servers
pnpm devThis runs all services via Turborepo:
| Service | URL | Port |
|---|---|---|
| Frontend | http://localhost:3000 | 3000 |
| API | http://localhost:3001 | 3001 |
| Docs | http://localhost:3002 | 3002 |
Step 6: Verify
Open http://localhost:3000 to see the landing page. The API health endpoint is at http://localhost:3001/api/v1/health.
Features
Individual Service Commands
You can start services individually using pnpm filters:
pnpm --filter @nexuscommerce/web dev # Frontend only
pnpm --filter @nexuscommerce/api dev # API only
pnpm --filter @nexuscommerce/docs dev # Docs only
pnpm --filter @nexuscommerce/ui storybook # Storybook on port 6006Build and Typecheck
pnpm build # Build all packages and apps
pnpm typecheck # TypeScript compiler checks
pnpm lint # ESLint across monorepo
pnpm test # Run all testsLoad Testing
k6 load tests are available for smoke, load, stress, and soak profiles:
pnpm k6:smoke # 1 VU, 30s — quick sanity check
pnpm k6:load # 50 VUs, 5min — standard load
pnpm k6:stress # 200 VUs, 10min — stress test
pnpm k6:soak # 20 VUs, 30min — endurance testConfiguration
Health Checks
| Endpoint | Service | Expected |
|---|---|---|
GET /api/v1/health | API (port 3001) | {"status":"ok"} |
GET /health | Workers (port 8000) | {"status":"ok"} |
GET /ping | ClickHouse (port 8123) | Ok. |
GET / | Frontend (port 3000) | HTML page |
Environment Tiers
| Tier | How to run | Notes |
|---|---|---|
| Development | pnpm dev + Docker Compose | Hot reload, no TLS |
| Production (VPS) | docker-compose.prod.yml | Caddy auto-SSL, all services |
| Production (K8s) | Helm chart | HPA, Ingress TLS, StatefulSets |
See Deployment for production setup.