npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

express-backend-starter

v1.0.2

Published

A production-ready CLI tool to scaffold Express.js/Node.js backend projects

Readme

🚀 Express Backend Starter CLI

A production-ready CLI tool to scaffold Express.js/Node.js backend projects in seconds.

Version License

✨ Features

  • 🎯 Interactive Setup - Guided prompts for project configuration
  • 🗄️ Multiple Databases - MongoDB, PostgreSQL, or MySQL support
  • 📚 Swagger Docs - Auto-generated API documentation
  • Zod Validation - Type-safe request validation
  • 📧 Email Support - Nodemailer integration
  • 🔒 Security First - Helmet, CORS, rate limiting, JWT auth
  • 📁 Clean Architecture - Professional folder structure
  • Production Ready - Best practices built-in

🚀 Quick Start

Using npx (Recommended)

npx express-backend-starter

Or Install Globally

npm install -g express-backend-starter
express-backend-starter

📋 What Gets Generated?

Always Included

  • ✅ Express.js server setup
  • ✅ JWT authentication middleware
  • ✅ Error handling middleware
  • ✅ CORS configuration
  • ✅ Rate limiting
  • ✅ Helmet security headers
  • ✅ Cookie parser
  • ✅ Bcrypt password hashing
  • ✅ File upload with Multer
  • ✅ Environment configuration
  • ✅ Professional folder structure

Database Options

  • MongoDB → Mongoose ORM
  • PostgreSQL → Prisma ORM
  • MySQL → Prisma ORM

Optional Features

  • 📚 Swagger → API documentation UI
  • Zod → Runtime validation
  • 📧 Nodemailer → Email functionality

🎬 Demo

$ npx express-backend-starter

🚀 Welcome to Express Backend Starter CLI

Let's scaffold your backend project...

? What is your project name? my-awesome-api
? Which database do you want to use? MongoDB
? Include Swagger documentation? Yes
? Include Zod validation? Yes
? Include Nodemailer for email functionality? No

✅ Project created successfully!

Next steps:
  cd my-awesome-api
  npm run dev

Happy coding! 🎉

📁 Generated Project Structure

my-awesome-api/
├── .env.example
├── .gitignore
├── README.md
├── package.json
└── src/
    ├── app.js                    # Main application
    ├── config/
    │   ├── db.js                 # Database connection
    │   └── swagger.js            # Swagger config (optional)
    ├── controllers/
    │   └── healthController.js   # Sample controller
    ├── middleware/
    │   ├── auth.js              # JWT authentication
    │   └── errorHandler.js      # Global error handler
    ├── models/
    │   └── User.js              # Sample model
    ├── routes/
    │   └── healthRoutes.js      # Sample routes
    ├── services/                 # Business logic
    └── utils/
        └── validation.js         # Zod schemas (optional)

🛠️ Tech Stack

  • Framework: Express.js
  • Authentication: JWT (jsonwebtoken)
  • Security: Helmet, CORS, express-rate-limit
  • Password Hashing: bcryptjs
  • File Upload: Multer
  • Database ORMs: Mongoose (MongoDB) or Prisma (PostgreSQL/MySQL)
  • Documentation: Swagger (optional)
  • Validation: Zod (optional)
  • Email: Nodemailer (optional)

📖 Usage

1. Run the CLI

npx express-backend-starter

2. Answer the Prompts

The CLI will ask you:

  • Project name
  • Database choice (MongoDB/PostgreSQL/MySQL)
  • Include Swagger? (y/n)
  • Include Zod? (y/n)
  • Include Nodemailer? (y/n)

3. Navigate to Your Project

cd your-project-name

4. Configure Environment

cp .env.example .env
# Edit .env with your settings

5. For Prisma (PostgreSQL/MySQL)

npx prisma migrate dev
npx prisma generate

6. Start Development

npm run dev

Your server will be running at http://localhost:5000

🌐 API Endpoints

Generated project includes:

  • GET / - Welcome message
  • GET /api/health - Health check
  • GET /api/health/info - Server info
  • GET /api-docs - Swagger UI (if enabled)

🔧 Available Scripts

{
  "dev": "nodemon src/app.js",    // Development with auto-reload
  "start": "node src/app.js"       // Production start
}

🔐 Environment Variables

The generated .env.example includes:

PORT=5000
NODE_ENV=development
JWT_SECRET=your_secret_key
JWT_EXPIRE=7d

# Database URLs (based on your choice)
MONGO_URI=mongodb://localhost:27017/dbname
# or
DATABASE_URL=postgresql://user:pass@localhost:5432/dbname

# Optional
EMAIL_HOST=smtp.gmail.com
[email protected]
# ... and more

📚 Documentation

For detailed development guide, see devGuide.md

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

MIT License - see LICENSE file for details

🙏 Credits

Built with:

💬 Support

If you have any questions or issues, please open an issue on GitHub.


Made with ❤️ for the Node.js community