Registry / devops / create-bns-api

create-bns-api

JSON →
library1.2.7jsnpmunverified

Scaffolds a production-ready NestJS 11 backend with JWT + OAuth2 authentication, Prisma ORM, and PostgreSQL/SQLite support. Current stable version 1.2.7. Includes a BNS utility CLI (@robyajo/bns-cli) for generating modules, switching databases, upgrading templates, and generating JWT secrets. Supports TypeScript out of the box. Differentiators: opinionated structure, automatic .env with random JWT secrets, upgrade mechanism with diff-based warnings for breaking changes.

npm install create-bns-api
INSTALL
IMPORT
SIG · CREATE-BNS-API
C
create-bns-api
devopsjavascriptv1.2.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

create-bns-api
npx create-bns-api my-project
npm install create-bns-api
CLI tool, should be invoked via npx, not installed locally. Since v1.0.
@robyajo/bns-cli
npx @robyajo/bns-cli make <name>
npm run make <name> without script
Utility CLI for existing projects. Use npx or npm run make (if script added). Since v1.0.
PrismaModule
import { PrismaModule } from './prisma/prisma.module'
import { PrismaModule } from '@prisma/client'
Custom Prisma module generated in template, not from @prisma/client. Always from local path.

Scaffold a NestJS project, run database migration, and start development server.

npx create-bns-api my-project cd my-project npx prisma migrate dev npm run start:dev
Debug
Known issues
gotchaRunning npx create-bns-api inside an existing project may overwrite files without warning.
fix
Always run in an empty directory or use --yes with caution. Check output before confirming.
affects: >=1.0
gotchaThe CLI uses SQLite by default; PostgreSQL must be explicitly specified with --pg flag.
fix
Use --pg flag: npx create-bns-api my-project --pg
affects: >=1.0
gotchaUpgrade via @robyajo/bns-cli --upgrade may overwrite files with low similarity (<60%) without backup.
fix
Always git commit before upgrade. Review changes with git diff.
affects: >=1.0
deprecatedThe --postgres flag is deprecated in favor of --pg.
fix
Use --pg instead of --postgres.
affects: >=1.2.0
gotchaGenerated JWT secrets are random but stored in .env file; if .env is committed to version control, secrets are exposed.
fix
Add .env to .gitignore. Do not commit secrets.
affects: >=1.0
Errors
Common errors & fixes
Error: Cannot find module '@nestjs/core'
Project dependencies not installed after scaffolding.
fix
Run npm install inside the project directory.
Error: P1001: Can't reach database server
Database connection string in .env is incorrect or database not running.
fix
Check DATABASE_URL in .env. For PostgreSQL, ensure service is running and credentials match.
Error: Prisma schema validation failed
Prisma migration not run or schema out of sync.
fix
Run npx prisma migrate dev to apply migrations.
Upgrade
Version history
1.2.7latest on npm
Audit
Dependencies
@nestjs/corerequiredCore NestJS framework dependency for generated projects
@nestjs/jwtrequiredJWT authentication module
@nestjs/passportrequiredPassport integration for OAuth2
@prisma/clientrequiredPrisma ORM client for database access
passportrequiredPassport.js for authentication strategies
Agent activity
2 hits · last 30 days
node
2
Resources
create-bns-api — npm install create-bns-api · libregistry