@aayushkumarsingh/create-mern-starter
v1.0.0
Published
Scaffold a MERN stack project (MongoDB, Express, React, Node) with TypeScript and optional Tailwind CSS
Maintainers
Readme
create-mern-starter
Scaffold a production-ready MERN stack project (MongoDB, Express, React, Node.js) with TypeScript or JavaScript, optional Tailwind CSS v4, ESLint + Prettier, and Docker in seconds.
Quickstart
Run with npm create:
npm create @aayushkumarsingh/mern-starter@latest my-appOr using npx:
npx @aayushkumarsingh/create-mern-starter my-appWith pnpm:
pnpm create @aayushkumarsingh/mern-starter my-appWith yarn:
yarn create @aayushkumarsingh/mern-starter my-appWith bun:
bun create @aayushkumarsingh/mern-starter my-appOptions & Flags
| Flag | Description | Default |
|---|---|---|
| [project-directory] | Target directory for your new project | Prompted (my-mern-app) |
| --ts, --typescript | Use TypeScript for client and server | Prompted (typescript with -y) |
| --js, --javascript | Use JavaScript for client and server | Prompted |
| --tailwind / --no-tailwind | Include or omit Tailwind CSS (v4) | Prompted (true with -y) |
| --install / --no-install | Install dependencies immediately | Prompted (true with -y) |
| --git / --no-git | Initialize a Git repository with initial commit | Prompted (true with -y) |
| --pm <npm\|pnpm\|yarn\|bun> | Force package manager selection | Auto-detected |
| -y, --yes | Skip prompts and accept all defaults | false |
| -h, --help | Display usage instructions and available options | false |
| -v, --version | Display current CLI version | false |
Non-Interactive Example
npx @aayushkumarsingh/create-mern-starter my-app --yesOr with custom flags:
npx @aayushkumarsingh/create-mern-starter my-app --no-tailwind --no-install --no-gitWhat You Get
- Frontend:
- React 19 + TypeScript or JavaScript
- Vite 8 with instant HMR and dev proxy to
/api - Optional Tailwind CSS v4 via
@tailwindcss/vite(zero legacy config files) - ESLint 9 (flat config) with React rules
- Typed API wrapper and interactive health check status dashboard
- Backend:
- Express 5 + Node.js with strict ESM (
"module": "NodeNext") - Mongoose 9 with graceful offline boot fallback
- Development live reload via
tsx watch(TS) or native Node--watch(JS) - ESLint 9 (flat config) for Node
- Centralized typed environment variables and error handling
- Express 5 + Node.js with strict ESM (
- Root Workspace & Tooling:
- Concurrently runner (
npm run dev) executing both client and server simultaneously - Docker & Docker Compose: Full-stack multi-stage containers for MongoDB, Server, and Client (with Nginx reverse proxy)
- Prettier 3: Pre-configured root formatting (
npm run format) - Production Deployment Guides: Step-by-step guides for MongoDB Atlas, Render, Railway, Vercel, Netlify, and Docker VPS in
docs/deployment.md - Auto-generated
.envand.gitignore
- Concurrently runner (
Generated Project Structure
my-app/
├── client/ # Vite + React + TypeScript frontend
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Application views
│ │ ├── lib/api.ts # Typed fetch client
│ │ ├── App.tsx # Root application component
│ │ ├── main.tsx # React root bootstrap
│ │ └── index.css # Styling (Tailwind v4 or plain CSS)
│ ├── index.html
│ ├── vite.config.ts # Vite configuration with /api proxy
│ ├── tsconfig.json
│ ├── tsconfig.app.json
│ ├── tsconfig.node.json
│ └── package.json
├── server/ # Express + Mongoose + TypeScript backend
│ ├── src/
│ │ ├── config/ # Database connection and environment config
│ │ ├── controllers/ # Route controllers
│ │ ├── middleware/ # 404 handler and error middleware
│ │ ├── models/ # Mongoose schemas & models (User)
│ │ ├── routes/ # Express API routes (/api/health, /api/users)
│ │ ├── app.ts # Express application assembly
│ │ └── index.ts # Server entrypoint
│ ├── .env # Local environment variables
│ ├── .env.example
│ ├── tsconfig.json
│ └── package.json
├── package.json # Root scripts (concurrently dev & build)
├── .gitignore
└── README.mdSystem Requirements
- Node.js:
>= 20.0.0(Active LTS) - MongoDB: Local MongoDB community server or MongoDB Atlas cluster URI (optional during initial boot; server will boot offline with a warning).
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
License
This project is licensed under the MIT License.
