@stratum-hq/create
@stratum-hq/create generates a complete project directory with everything you need to start building with Stratum – package.json, Docker Compose, environment files, and framework-specific starter code.
npx @stratum-hq/create my-appThis creates a my-app/ directory with:
package.jsonwith@stratum-hq/lib,pg, and your chosen frameworkdocker-compose.ymlwith PostgreSQL 16 and pre-loaded extensions (ltree, uuid-ossp).env.examplewithDATABASE_URLand other defaults- A starter server file with Stratum middleware
README.mdwith getting-started instructions
Options
Section titled “Options”npx @stratum-hq/create my-app [options]
Options: --template <name> Framework template: express (default), fastify, or nextjs --skip-install Skip npm install after scaffolding --force Overwrite existing directoryTemplates
Section titled “Templates”Express (default)
Section titled “Express (default)”npx @stratum-hq/create my-app --template expressGenerates an Express server with Stratum middleware, tenant-aware routes, and TypeScript configuration.
Fastify
Section titled “Fastify”npx @stratum-hq/create my-app --template fastifyGenerates a Fastify server with Stratum plugin registration.
Next.js
Section titled “Next.js”npx @stratum-hq/create my-app --template nextjsGenerates a Next.js project with edge middleware for tenant resolution and server-side helpers.
After Scaffolding
Section titled “After Scaffolding”cd my-app
# Start the databasedocker compose up -d
# Run the appnpm run devThe generated project uses autoMigrate: true, so Stratum creates its tables automatically on first run – no separate migration step needed.
What Gets Generated
Section titled “What Gets Generated”my-app/ package.json # Dependencies + scripts docker-compose.yml # PostgreSQL 16 with extensions docker/ init.sql # CREATE EXTENSION uuid-ossp, ltree .env.example # DATABASE_URL, JWT_SECRET src/ server.ts # Framework-specific starter with Stratum README.md # Getting started instructions