@arbitrat/nest-generator
v1.0.1
Published
Opinionated NestJS generator used by @arbitrat/cli.
Readme
@arbitrat/nest-generator
Generates an Arbitrat NestJS service: a standalone npm app, or apps/api inside a pnpm workspace when @arbitrat/cli pairs it with Next.
This is the API half of arbi create workspace. Persistence belongs here, not in the Next.js app, once both exist. We are not subtle about that, and we will not pretend otherwise in a README.
Opinionated for Arbitrat engineers. arbitrat.org
Install
npm install @arbitrat/nest-generatorDepends on @arbitrat/core. Node.js 20+. Ships TypeScript source.
Most people should use the CLI instead:
npm install -g @arbitrat/cli
arbi create workspaceWhat it generates
Starts from @nestjs/cli (nest new, TypeScript, strict), then applies the Arbitrat overlay:
- Infisical-wrapped scripts and Husky (unless you skip hooks)
- Prettier
- A users feature module (
src/modules/users) as the pattern to copy, not a product - HTTP default port 3001 (so it can sit next to Next on 3000 without an argument)
- Optional
packages/contractsdependency when generated as workspaceapps/api
Jest already comes with the Nest CLI baseline. The Jest add-on makes the Arbitrat extras explicit.
Add-ons
| Id | Name | Notes |
| --- | --- | --- |
| jest | Jest | Jest + ts-jest + a smoke spec |
| prisma | Prisma | Prisma + Postgres, global PrismaModule, repositories |
| redis | Redis | RedisService |
| docker | Docker | Production Dockerfile (node dist/main.js) |
| sentry | Sentry | @sentry/node via src/instrument.ts |
Add-ons live in src/addons.ts until they earn their own files.
Programmatic use
import { generateNestApp } from "@arbitrat/nest-generator";
await generateNestApp({
projectName: "api",
targetDir: "./api",
selectedAddons: ["prisma", "sentry"],
});Optional flags: packageManager (npm | pnpm), skipGit, skipHusky, skipInstall, contractsPackage (workspace name of shared types).
Entry: src/index.ts.
