create-izzy-backend
v2.0.0
Published
Scaffold a new backend project from Izzy4999/backend_template without git history.
Downloads
252
Maintainers
Readme
create-izzy-backend
Scaffold a new Node/Express backend project from the backend template without git history. Lets you choose how authentication (single-session vs multi-session) is configured at bootstrap.
What it does
- Clones the template into a directory (empty or
--force) - Sets the project name in
package.jsonfrom the target folder name - Applies an auth mode (env, single, or multi) so you get the right session behavior from the start
- Copies only the files for the chosen mode into
src/(single/multi), then removes thetemplates/folder from the new project so it stays only in the template repo - Optionally initializes git and installs dependencies
Requirements
- Node.js ≥ 16
- npm (or pnpm/yarn if you use
--install)
Usage
Run from anywhere (or from inside the template repo):
npx create-izzy-backend [target-dir] [options]target-dir– Where to create the project. Default: current directory (.).- The target directory must be empty unless you pass
--force.
Options
| Option | Description |
|--------|-------------|
| -i, --install | Run npm install (or pnpm/yarn) in the new project |
| -g, --git | Run git init and create an initial commit |
| -f, --force | Allow scaffolding into a non-empty directory (overwrite) |
Auth mode
Choose how auth is configured when the project is created:
| Flag | Mode | Behavior |
|------|------|----------|
| (none) or --auth-mode=env | env | No file copies. Auth is controlled at runtime by AUTH_SESSION_MODE in .env. The CLI may add this variable to .env.example and .env if missing. |
| -s or --auth-mode=single | single | Overwrites src with template files so auth is single-session (one refresh token per user; logout logs out everywhere). |
| -m or --auth-mode=multi | multi | Overwrites src with template files so auth is multi-session (multiple refresh tokens; logout only revokes the token used). |
Paths are resolved from the project root (the directory where the template was cloned).
Examples
# New project in ./my-api, env-based auth (default), then install deps
npx create-izzy-backend my-api --install
# New project in current directory, fixed to single-session auth
npx create-izzy-backend . -s
# New project in ./backend with multi-session auth, git init, and install
npx create-izzy-backend backend -m --git --install
# Overwrite an existing folder
npx create-izzy-backend my-api --force -sAfter scaffolding
cd <target-dir>(if you didn’t use.)npm install(if you didn’t use--install)npm run dev
API docs:
- Swagger UI: http://localhost:PORT/docs
- OpenAPI JSON: http://localhost:PORT/docs.json
License
ISC
