π I Built an Artisan-Like CLI for Next.js (With MongoDB + JWT)
If youβve ever built a backend with Next.js, you know the painβ¦
Every time you start a new project, you end up doing the same things:
- Setting up MongoDB connection
- Writing authentication (JWT, hashing passwords)
- Creating API routes
- Structuring folders
Again⦠and again⦠and again.
π€ The Problem
Next.js is amazing for full-stack apps, but it doesnβt give you a backend scaffold like Laravel.
In Laravel, you have:
php artisan make:model
php artisan make:controller
π Everything is fast and structured.
But in Next.js?
π You start from scratch every time.
π‘ The Idea
I wanted Laravel Artisan-like speed in Next.js.
So I built:
π§° poudwal
A CLI that scaffolds full backend systems for Next.js 14 App Router.
π¬ Demo
β‘ What poudwal Can Do
With a few commands, you can:
- π Create a full Next.js project
- π Add JWT authentication (login/register)
- π¦ Setup MongoDB with Mongoose
- π Generate complete CRUD APIs
- π§± Get a clean scalable structure
- π¦ Use TypeScript support
π Quick Start
npx poudwal create my-app --ts
cd my-app
npm install
npm run dev
π§βπ» Real Example
Letβs say youβre building an ecommerce app:
npx poudwal create ecommerce-app --ts
cd ecommerce-app
# Generate APIs
npx poudwal make:crud product
npx poudwal make:crud order
# Add authentication
npx poudwal install:auth
π Done.
You now have:
- Product & Order APIs
- Authentication system
- MongoDB setup
- Ready backend
π§ Why This Is Useful
Without poudwal:
- β Write models manually
- β Setup auth from scratch
- β Create API routes manually
With poudwal:
- β Everything generated instantly
- β Clean structure
- β Focus on business logic
βοΈ Key Commands
Create Project
poudwal create my-app
Generate Model
poudwal make:model User
Generate API
poudwal make:api product
Generate Full CRUD
poudwal make:crud Product
Install Auth
poudwal install:auth
π Authentication Flow
- User registers β password hashed
- User logs in β JWT token generated
- Middleware protects
/api/*routes
π± Environment Setup
MONGODB_URI=mongodb://localhost:27017/myapp
JWT_SECRET=your_secret_key
JWT_EXPIRES=7d
π¦ Try It Yourself
π https://www.npmjs.com/package/poudwal
π¬ Iβd Love Your Feedback
This is just the beginning.
If youβre a Next.js developer:
π Would this save your time?
π What feature should I add next?
π Future Plans
- Prisma support
- Role-based authentication
- Validation (Zod/Yup)
- Better CLI UX
β If You Like It
- Star the repo
- Try it in your next project
- Share feedback
Thanks for reading π

Top comments (0)