A production-ready monorepo workspace with shared Vendure configurations, PostgreSQL, Redis, and streamlined example creation.
# 1. Install dependencies
npm install
# 2. Start infrastructure (PostgreSQL + Redis)
npm run docker:up
# 3. Create a new example
npm run create-example my-feature
# 4. Copy (and modify) .env files
cp .env.example .env
# 4. Run the example
cd examples/my-feature
npm run devThis monorepo uses a shared configuration pattern with production-ready infrastructure:
vendure-examples/
├── src/ # 🔧 Shared base configurations
│ ├── vendure-config.base.ts # Base Vendure config (PostgreSQL + Redis)
│ ├── index.base.ts # Server bootstrap logic
│ └── index-worker.base.ts # Worker bootstrap logic
├── examples/ # 📦 Individual examples
│ ├── shop-github-auth/ # GitHub OAuth example
│ ├── shop-google-auth/ # Google OAuth example
│ └── s3-file-storage/ # S3-compatible storage example
│ └── // other examples
├── docker-compose.yml # 🐳 PostgreSQL + Redis + Adminer
├── scripts/
│ ├── create-example.js # Automated example creation
│ ├── migrate-db.js # Database migration utilities
│ └── reset-db.js # Database reset utilities
├── package.json # 📋 Centralized Vendure dependencies
└── tsconfig.base.json # 🔧 Base TypeScript config with path aliases
- 🏢 Production-Ready: PostgreSQL + Redis instead of SQLite
- 🔄 Shared Dependencies: All Vendure packages centralized at root
- 🛤️ Path Aliases: Clean imports like
@shared/config,@/plugins - ⚡ Fast Creation: New examples in seconds with
npm run create-example - 🧩 Extensible: Examples extend base config with
mergeConfig() - 🐳 Docker Integration: Full infrastructure with Docker Compose
- 📊 Database Tools: Migration and reset utilities included
| Command | Description |
|---|---|
| Infrastructure | |
npm run docker:up |
Start PostgreSQL + Redis services |
npm run docker:down |
Stop all services |
npm run docker:reset |
Reset database with fresh containers |
| Development | |
npm run create-example <name> |
Create new example with base config |
npm run list:examples |
List all available examples |
| Database | |
npm run migrate-db [example] |
Run migrations (all or specific example) |
npm run reset-db |
Completely reset database ( |
Each example extends the base configuration:
examples/my-feature/
├── src/
│ ├── vendure-config.ts # Extends @shared/config
│ ├── index.ts # Uses @shared/server
│ ├── index-worker.ts # Uses @shared/worker
│ └── plugins/ # Custom plugins (if any)
├── package.json # Only example-specific dependencies
├── tsconfig.json # Extends ../../tsconfig.base.json
└── README.md # Usage instructions
// examples/my-feature/src/vendure-config.ts
import { mergeConfig } from '@vendure/core';
import { getBaseConfig } from '@shared/config';
import { MyCustomPlugin } from '@/plugins/my-custom-plugin';
export const config = mergeConfig(
getBaseConfig(), // PostgreSQL + Redis + core plugins
{
plugins: [
MyCustomPlugin.init({
// custom options
}),
],
// Additional overrides
}
);- Infrastructure:
npm run docker:up- Start PostgreSQL + Redis - Create:
npm run create-example payment-gateway- Generate new example - Develop: Edit
examples/payment-gateway/src/vendure-config.ts - Test:
cd examples/payment-gateway && npm run dev - Deploy: Copy config to production Vendure project
Copy .env.example to .env and configure:
# Database (Docker defaults)
DB_HOST=localhost
DB_PORT=5432
DB_USER=vendure
DB_PASSWORD=vendure
DB_NAME=vendure
# Redis (Docker defaults)
REDIS_HOST=localhost
REDIS_PORT=6379
# Vendure
PORT=3000
SUPERADMIN_USERNAME=superadmin
SUPERADMIN_PASSWORD=superadmin
NODE_ENV=development- PostgreSQL:
localhost:5432(username:vendure, password:vendure) - Redis:
localhost:6379 - Adminer:
localhost:8080(database GUI)
# Migrate all examples
npm run migrate-db
# Migrate specific example
npm run migrate-db shop-github-auth
# Reset database (⚠️ destroys all data)
npm run reset-db