I Got Tired of Copying the Same MERN Boilerplate, So I Built a CLI
Source: Dev.to
The problem every full‑stack dev knows
Every time I start a new project, the first hour looks the same:
npm create vite@latest # pick React → set up Tailwind- Create a
server/folder →npm init→ install Express, Mongoose, dotenv, cors - Write the same
db.jsconnection file - Copy CORS config from the last project
- Set up the proxy in
vite.config.js - Copy the same JWT auth code if I need login
- Wire up React Router, protected routes, the whole thing
By the time I actually start building features, I’m already mentally drained. And every project’s boilerplate ends up slightly different because I “improve” it each time.
QuickStack – a CLI that does it for you
npx create-quickstack-app my-appThat’s it. You get a ready‑to‑run full‑stack starter.
What you get
| Category | Stack |
|---|---|
| Frontend | React + Vite + Tailwind CSS |
| Backend | Express.js + Mongoose |
| Auth (optional) | JWT + bcrypt + httpOnly cookies |
| Developer Experience | NPM Workspaces, Axios pre‑configured, one npm run dev command |
Choosing versions
QuickStack lets you pick between stable, battle‑tested versions or the latest releases:
- Stable → React 18.3, Tailwind v3, React Router v6
- Latest → React 19, Tailwind v4, React Router v7
Add --auth to include authentication scaffolding.
Auth scaffolding (when --auth is used)
POST /api/user/register– create accountPOST /api/user/login– login, sets JWT as httpOnly cookiePOST /api/user/logout– clears sessionGET /api/user/me– returns current user (protected)
Includes:
- Login and signup pages with forms
ProtectedRoutecomponent that redirects to/login- Auth service with Axios interceptors
- React Router setup with all routes wired
This isn’t a toy “TODO‑app” example; it’s what I actually use in production.
How the CLI works
- commander – argument parsing (
--auth,--stable,--latest,--yes) - @inquirer/prompts – interactive prompts
- fs-extra – copies template directories
- chalk – colorful terminal output
Instead of fragile string templating, QuickStack copies real, runnable project directories and patches them based on your choices. The templates in the repository are fully functional—you can cd into them and run them as‑is.
Version‑specific adjustments (React 18 vs 19, Tailwind 3 vs 4) are handled by a preset engine that rewrites package.json dependencies and config files after the base template is copied.
Installation & usage
npx create-quickstack-app my-app
cd my-app
npm run dev- Client →
- Server →
Links
- npm:
- GitHub:
What’s next
- TypeScript template variant
- Docker Compose included in scaffold
- PostgreSQL + Prisma as a database option
- More framework options (e.g., Next.js)
If this saves you even 30 minutes on your next project, I’ll consider it a win. I’d love to hear what features you’d like—feel free to open an issue or drop feedback. If you found this useful, a ⭐ on the GitHub repo would mean a lot. Thanks for reading!