patra-turbo-template
v1.1.6
Published
Scaffold a new project from the turbo-template monorepo (Next.js, Express, WebSocket, Prisma, Tailwind)
Maintainers
Readme
patra-turbo-template
Scaffold a new Turborepo monorepo from the turbo-template (Next.js, Express, WebSocket, Prisma, Tailwind).
Layout: Both the npm package and the template live under template/:
template/create-turbo-template/– this package (publish to npm)template/turbo-template/– the monorepo template (source for scaffolding)
What to do next
Bundle the template into the package (so it’s included when you publish):
cd template/create-turbo-template bun run copy-templateThis copies
../turbo-templateinto./template(createstemplate/create-turbo-template/template/with the app).Test locally (from any empty folder):
node path/to/template/create-turbo-template/cli.js my-test-app cd my-test-app && bun install && bun run devPublish to npm
Open a terminal, go into this package folder, then run:cd path/to/CI_CD/template/create-turbo-template npm login npm publish(Replace
path/to/CI_CDwith your actual path, e.g.C:\Users\patra\Desktop\Devops_prac\CI_CDon Windows.)prepublishOnlywill runcopy-templateagain before packing, so the tarball always has an up-to-datetemplate/.
Usage (after publish)
npx create-turbo-template my-app
cd my-app
bun install
bun run devOr with npm:
npm create turbo-template@latest my-app
cd my-app
bun install
bun run devPublishing to npm
One-time: copy the template into the package
cd create-turbo-template bun run copy-templateThis copies
../turbo-templateinto./template(excluding node_modules, .git, etc.).Publish
- If you don’t have an npm account: npmjs.com
- npm requires two-factor authentication (2FA) to publish. Enable it at npmjs.com → Account → Security.
- Login:
npm login - Publish (choose one):
- Unscoped (name must be free):
npm publish - Scoped (e.g. @yourusername/turbo-template): change
"name": "create-turbo-template"to"name": "@yourusername/create-turbo-template"in package.json, thennpm publish --access public
- Unscoped (name must be free):
Later: after changing turbo-template
- Run
bun run copy-templateagain increate-turbo-template - Bump version in package.json (e.g.
1.0.1) - Run
npm publish
- Run
What gets created
apps/web– Next.js (port 3000)apps/http-server– Express API (port 3002)apps/ws-server– WebSocket server (port 3001)packages/db– Prisma + PostgreSQLpackages/ui– Shared React componentspackages/eslint-config,packages/typescript-config– Shared configs
