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

create-bodhi-node-app

v1.1.10

Published

Create production-ready Node.js REST APIs with zero configuration - Authentication, MongoDB, Error Handling, and more!

Readme

Create Bodhi Node App

Create production-ready Node.js REST APIs with zero configuration. Get started with a fully-featured Express.js application in seconds.

Installation 🚀

You can create a new app using either of these methods:

Using npx (recommended)

npx create-bodhi-node-app my-project
cd my-project
npm install

Using npm global install

First, install the package globally:

npm install -g create-bodhi-node-app

Then create your project and install dependencies:

create-bodhi-node-app my-project
cd my-project
npm install

Getting Started 🎯

After creating your project and installing dependencies:

  1. Start the development server:
npm run dev
  1. Or for production:
npm start

Your API will be running at http://localhost:3000

Features Included 🌟

  • Express.js setup with best practices
  • MongoDB integration with Mongoose
  • Authentication with JWT
  • Request validation using Zod
  • Error handling middleware
  • Logging with Winston and Morgan
  • Security with Helmet and CORS
  • API compression
  • ESLint and Prettier configuration
  • Development mode with Nodemon

Why Bodhi Node App? 🤔

While frontend developers have had tools like create-react-app for years, backend developers have been left to configure their Node.js applications from scratch. Bodhi Node App changes that by providing a production-ready Node.js REST API boilerplate with all the essential features you need.

Getting Started In Detail 🎯

  1. Create your API (replace my-project with any name you prefer):
npx create-bodhi-node-app my-project
  1. Install dependencies:
cd my-project
npm install
  1. Start development server:
npm run dev

Environment Variables 🔧

NODE_ENV=development
PORT=3000
MONGODB_URI=mongodb://localhost:27017/your-db-name
JWT_SECRET=your-jwt-secret
JWT_EXPIRES_IN=1d

API Endpoints 🔌

Authentication Routes

  • POST /api/v1/auth/register - Register a new user
  • POST /api/v1/auth/login - Login user
  • GET /api/v1/auth/me - Get current user profile
  • POST /api/v1/auth/refresh-token - Refresh access token
  • POST /api/v1/auth/forgot-password - Request password reset
  • POST /api/v1/auth/reset-password - Reset password with token
  • POST /api/v1/auth/logout - Logout user

User Management Routes

Regular User Routes:

  • GET /api/v1/users/profile - Get user's profile
  • PUT /api/v1/users/profile - Update user's profile
  • PUT /api/v1/users/password - Update user's password
  • DELETE /api/v1/users/account - Delete user's account

Admin Routes (Requires admin role):

  • GET /api/v1/users/admin - Get all users (admin only)
  • GET /api/v1/users/admin/:id - Get specific user (admin only)
  • PUT /api/v1/users/admin/:id/role - Update user's role (admin only)

API Documentation

All endpoints are documented using Swagger/OpenAPI specification and include:

  • Request/Response schemas
  • Authentication requirements
  • Validation rules
  • Error responses
  • Example payloads

Access the full API documentation by visiting /api-docs after starting your server.

Route Protection

  • All user management routes are protected with JWT authentication
  • Admin routes have additional role-based authorization
  • Input validation using Zod schema validation
  • Rate limiting to prevent abuse
  • CORS protection configured

Features in Detail 🌟

Authentication & Authorization 🔐

  • JWT-based Authentication: Secure token-based authentication system
  • Role-Based Access Control: Easily manage user permissions
  • Password Reset Flow: Complete forgot/reset password functionality
  • Token Refresh: Automatic access token refresh mechanism
  • Secure Password Handling: bcrypt hashing for passwords

Database Integration 🗄️

  • MongoDB & Mongoose: Ready-to-use MongoDB integration with Mongoose ODM
  • Schema Validation: Mongoose schemas with built-in validation
  • Index Management: Optimized database indexes
  • Soft Delete: Built-in support for soft deletion

Security Features 🛡️

  • Helmet Integration: Secure HTTP headers automatically configured
  • CORS Protection: Configurable CORS settings
  • Rate Limiting: Protect your API from abuse
  • XSS Protection: Cross-site scripting protection
  • SQL Injection Protection: Query sanitization
  • Parameter Pollution Protection: Prevent parameter pollution attacks

Request Validation ✅

  • Zod Integration: Type-safe request validation
  • Custom Validators: Easy to add custom validation rules
  • Validation Middleware: Pre-built validation middlewares
  • Error Messages: Clear, customizable error messages

Error Handling 🚨

  • Centralized Error Handling: Global error handling middleware
  • Custom Error Classes: Specific error types for different scenarios
  • Operational vs Programming Errors: Different handling for different error types
  • Error Logging: Automatic error logging with stack traces

Logging System 📝

  • Winston Logger: Advanced logging with Winston
  • Multiple Transports: Console and file logging
  • Log Levels: Different log levels for development and production
  • Request Logging: Morgan integration for HTTP request logging

API Documentation 📚

  • Swagger/OpenAPI: Automatic API documentation
  • API Versioning: Built-in support for API versioning
  • Request/Response Examples: Clear examples in documentation
  • Authentication Documentation: Security schemes documentation

Development Tools 🛠️

  • Hot Reloading: Automatic server restart with Nodemon
  • ESLint Configuration: Code linting with ESLint
  • Prettier Integration: Consistent code formatting
  • Git Setup: Pre-configured .gitignore
  • Environment Variables: Dotenv configuration

Performance Optimizations 🚄

  • Compression: Gzip compression enabled
  • Security Headers: Optimized security headers
  • Body Parsing: Efficient request body parsing
  • Error Handling: Performance-optimized error handling

Project Structure 📁

Follows industry best practices with a clean, maintainable structure:

src/
├── config/         # Environment variables & configuration
├── controllers/    # Route controllers (controller layer)
├── middleware/     # Custom express middlewares
├── models/        # Mongoose models (data layer)
├── routes/        # Routes
└── utils/         # Utility classes and functions

Contributing 🤝

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

License 📄

This project is licensed under the MIT License - see the LICENSE file for details.

A Note from the Creator 💭

Just as frontend developers have create-react-app to jumpstart their React projects, backend developers deserve a robust solution for Node.js applications. That's why I created Bodhi Node App - to provide backend developers with a production-ready, feature-rich foundation for their REST APIs.

No more spending hours on boilerplate code or worrying about security configurations. With Bodhi Node App, you get a professionally structured Node.js application with all the essential features you need to build secure, scalable APIs.

Created with ❤️ by Bodheesh

Support 🌟

If you find this project helpful, please give it a star ⭐ on GitHub! It helps more developers discover this tool.