create-express-ts-api-kit
v1.1.0
Published
Interactive CLI to scaffold an Express.js + TypeScript backend API
Downloads
21
Maintainers
Readme
create-express-ts-api-kit
Interactive CLI to scaffold an Express + TypeScript backend API.
Quick Start (npx)
Use this command as the primary install/run flow:
npx create-express-ts-api-kit@latest my-backendThen follow prompts.
To skip prompts and use flags:
npx create-express-ts-api-kit@latest my-backend --yes --auth --auth-provider custom --auth-mode basic --auth-mechanism session_jwt --auth-transport dual --session-storage redis --database mongooseAlternative explicit bin usage:
npx --package create-express-ts-api-kit create-express-ts-api my-backendWhat This CLI Can Generate
- Express + TypeScript backend skeleton
- Config, route index, global error handler, response helper
- Optional health endpoints (basic or detailed)
- Optional auth module
- Optional Prisma or Mongoose setup
- Optional Swagger/OpenAPI docs endpoint
- Optional Redis integration
- Optional Nodemailer helper
- Optional Socket.IO and MQTT starter files
- Optional Zod validation setup
- Optional i18n error messages (TR/EN)
- Optional Docker and docker-compose files
- Optional GitHub Actions VPS deploy template
- Optional sample users module (soft delete / restore)
Auth Architectures
When --auth-provider custom is selected:
jwt_refreshJWT access token + refresh tokensession_onlySession-based auth, no JWTsession_jwtHybrid: JWT + session validationsession_jwt_refreshHybrid: JWT + session + refresh
Auth transport modes:
cookiebearerdual(cookie + bearer)
Session storage options (for session-based modes):
redismemorydatabase
Database Modes
nonemongoose(MongoDB)prisma(MongoDB with Prisma)
If auth-provider=authjs, Prisma is enforced automatically.
Feature Flags in Interactive Mode
The prompt flow can enable:
- Health endpoint
- Detailed health checks
- Auth module and auth endpoints
- Role mode and role list
- Forgot/reset password flow
- Email verification endpoints
- Brute-force protection
- Audit log service
- Permission middleware (role + Prisma role-permission setup)
- Socket.IO
- MQTT
- Redis integration
- Nodemailer integration
- Zod integration
- Swagger docs
- i18n errors
- Docker files
- GitHub workflow template
- Soft-delete users module
- Nodemon-based dev mode
- Auto install dependencies
- Auto init git
CLI Options
--help, -h
--yes, -y
--project <name>
--port <number>
--prefix <value>
--auth / --no-auth
--auth-provider <custom|authjs>
--auth-mode <basic|role>
--auth-mechanism <jwt_refresh|session_only|session_jwt|session_jwt_refresh>
--auth-transport <cookie|bearer|dual>
--session-storage <redis|memory|database>
--database <none|mongoose|prisma>
--prisma-version <latest|6.19>
--install / --no-install
--git / --no-git
--forceExample Commands
Custom auth + hybrid session/jwt + dual transport:
npx create-express-ts-api-kit@latest my-api --yes --auth --auth-provider custom --auth-mode basic --auth-mechanism session_jwt --auth-transport dual --session-storage redis --database mongoose --install --gitRole-based + Prisma + role-permission template:
npx create-express-ts-api-kit@latest my-rbac-api --yes --auth --auth-provider custom --auth-mode role --auth-mechanism session_jwt --auth-transport dual --session-storage database --database prisma --prisma-version latest --installAuthJS + Prisma:
npx create-express-ts-api-kit@latest my-authjs-api --yes --auth --auth-provider authjs --database prisma --prisma-version latest --installMinimal API without auth:
npx create-express-ts-api-kit@latest my-minimal-api --yes --no-auth --database none --installAfter Generation
cd my-backend
npm run devIf Prisma is selected:
npx prisma generateNode Requirement
- Node.js
>= 18
