A CLI tool to quickly scaffold configuration files and boilerplate Express + TypeScript projects.
npm install tsnode-app-cli
.env, tsconfig.json, .gitignore, and boilerplate code to get you started instantly.
tsnode-app-cli is a lightweight, blazing-fast CLI tool built by π¨π»βπ Vijay Jadhav that scaffolds a ready-to-use Node.js + TypeScript project.
tsconfig.json
model/, controller/, router/, and app.ts
signup and login endpoints
.env + dotenv setup
.gitignore and project initialization
bash
> npx tsnode-app-cli
`
Or install globally:
`bash
> npm install -g tsnode-app-cli
Then run:
> tsnode-app-cli
`
$3
After running the CLI, you will see a prompt:
`bash
β¨ Welcome to the Project Setup CLI by Vijay Jadhav
π Enter your project name: (type exit to close)
`
The CLI will:
1. Validate your project name
2. Create a folder with the project name
3. Generates required files.
4. Install dependencies automatically
5. Start the dev server if selected π
$3
When you run the generator, it creates the following structure:
`bash
my-app/
βββ .env
βββ package.json
βββ tsconfig.json
βββ .gitignore
βββ src/
β βββ app.ts
β βββ controller/
β β βββ auth.controller.ts
β βββ model/
β β βββ auth.model.ts
β βββ middleware/
β β βββ auth.middleware.ts
β β βββ refreshToken.middleware.ts
β βββ router/
β β βββ auth.router.ts
β βββ interface/
β β βββ auth.interface.ts
β βββ lib/
β βββ error.ts
`
---
$3
The generated project includes:
| Package | Purpose |
| ---------------- | --------------------------------- |
| express | Fast and minimalist web framework |
| mongoose | MongoDB ODM for data modeling |
| jsonwebtoken | Secure authentication with JWT |
| bcrypt | Password hashing |
| dotenv | Environment variable management |
| cookie-parser| Parse request header's cookies |
| cors | Cross-origin resource sharing |
| morgan | HTTP request logger |
| typescript | Static typing support |
$3
Built-in ready-to-use routes:
| Method | Endpoint | Description |
| -------- | ------------------ | --------------------------------- |
| GET | / | Project info |
| POST | /auth/signup | Register new users |
| POST | /auth/login | Authenticate users and return JWT |
$3
Inside your generated project, you can use:
`bash
npm run dev # Start the development server with ts-node-dev
npm run build # Compile TypeScript to JavaScript
`
$3
The .env file will include keys like:
`bash
PORT=8080
MONGO_URI=mongodb://localhost:27017
DB=project-name
JWT_SECRET=your-secret-key
CLIENT=localhost
``