JWT Authentication Boilerplate CLI

1.0.2 · active · verified Wed Apr 22

create-auth-app-cli is a command-line interface tool designed to rapidly scaffold a complete boilerplate for a JWT (JSON Web Token) authentication system. Currently at version 1.0.2, it provides a functional backend API with features such as user registration, login, logout, automatic token refresh, and robust Role-Based Access Control (RBAC). The generated project utilizes Node.js, Express.js, and MongoDB, incorporating security best practices like bcrypt for password hashing and HTTP-only cookies for refresh tokens. This CLI streamlines the setup process for backend authentication services, offering a clean and scalable project structure. Its release cadence is typically driven by updates to the underlying libraries in the generated template, security enhancements, or new features added to the boilerplate, rather than frequent releases of the CLI itself.

Common errors

Warnings

Install

Imports

Quickstart

Scaffolds a new JWT authentication project, navigates into it, sets up environment variables, installs dependencies, and starts the development server.

npx create-auth-app-cli my-jwt-auth-backend
cd my-jwt-auth-backend
cp .env.example .env
# IMPORTANT: Fill in your actual secrets and MongoDB URI in .env
# For example:
# MONGO_URI=mongodb://localhost:27017/my-jwt-db
# ACCESS_TOKEN_SECRET=super_secret_jwt_key_123
# REFRESH_TOKEN_SECRET=another_super_secret_key_456
# Then install dependencies and run the server
npm install
npm run dev

view raw JSON →