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 πŸ™

Β© 2025 – Pkg Stats / Ryan Hefner

generate-node-structure

v0.1.0

Published

πŸš€ The Ultimate Node.js & Express Boilerplate. Production-ready REST API generator with PostgreSQL, JWT Auth, Security, Sentry, and more. Start your next project in seconds!

Readme

πŸš€ Generate Node Structure

The Ultimate Production-Ready Node.js & Express Boilerplate

npm version License: MIT Node.js Downloads

  • Build scalable, secure, and high-performance REST APIs in seconds.
  • Stop wasting time on boilerplate code. Focus on building your product.

Report Bug Β· Request Feature


🌟 Why Choose This Boilerplate?

Starting a new Node.js project often involves setting up the same repetitive structure: Authentication, Database connection, Security headers, Error handling, etc. Generate Node Structure eliminates this hassle by providing a battle-tested, production-ready foundation instantly.

Whether you are building a small MVP or a large-scale enterprise application, this structure scales with you.

✨ Key Features

| Feature | Description | | :--- | :--- | | πŸ— Modular Architecture | Clean, organized folder structure designed for scalability and maintainability. | | 🐘 PostgreSQL Ready | Pre-configured with pg for robust and efficient database interactions. | | πŸ” Complete Auth System | JWT-based Authentication: Signup, Login, Logout, Password Reset & Email Verification. | | πŸ›‘ Enterprise Security | Secured with Helmet, CORS, Rate Limiting, and Input Validation (Joi). | | πŸ“ Auto Documentation | Integrated API documentation generation with node-api-document. | | πŸ“§ Email Service | Ready-to-use email sending service with Nodemailer and EJS templates. | | πŸ› Real-time Monitoring | Integrated Sentry for tracking errors and performance issues in real-time. | | 🌐 Localization (i18n) | Built-in support for multiple languages using localizify. | | ⚑ High Performance | Optimized query structure, compression, and best practices for speed. |


πŸš€ Getting Started

Launch your new project in under 30 seconds.

Option 1: The Fastest Way (npx)

Run this command in your terminal where you want to create your project:

npx generate-node-structure

Option 2: Global Installation

Install the CLI globally to use it anytime:

npm install -g generate-node-structure

Then generate a new project:

create-node-structure

πŸ“‚ Project Structure Overview

We follow a clean Model-Service-Controller pattern to keep concerns separated.

.
β”œβ”€β”€ bin/                # CLI entry point
β”œβ”€β”€ config/             # Database & App Configuration
β”œβ”€β”€ enc_dec/            # Encryption & Decryption Utilities
β”œβ”€β”€ languages/          # Localization (i18n) Files
β”œβ”€β”€ middleware/         # Custom Express Middleware (Auth, Error handling)
β”œβ”€β”€ modules/            # API Features (The heart of your app)
β”‚   └── v1/             # Versioned API
β”‚       β”œβ”€β”€ Auth/       # Authentication Module
β”‚       └── User/       # User Management Module
β”œβ”€β”€ scripts/            # Database initialization & utility scripts
β”œβ”€β”€ template/           # Project templates
β”œβ”€β”€ tests/              # Unit & Integration Tests
β”œβ”€β”€ utils/              # Shared Helper Functions
β”œβ”€β”€ views/              # Email Templates (EJS)
β”œβ”€β”€ .env.example        # Environment Variables Reference
β”œβ”€β”€ index.js            # App Entry Point
└── package.json        # Dependencies & Scripts

πŸ›  Configuration

1. Environment Variables

Rename .env.example to .env and configure your secrets:

cp .env.example .env

Open .env and fill in your details:

  • Database Credentials (Host, User, Password, DB Name)
  • JWT Secret (For secure token generation)
  • Sentry DSN (For error tracking)
  • Email Credentials (For sending system emails)

2. Database Setup

Initialize your PostgreSQL database tables with a single command:

npm run db:init

πŸ“œ Available Scripts

| Script | Description | | :--- | :--- | | npm start | Starts the production server. | | npm run dev | Starts the development server with hot-reloading (nodemon). | | npm test | Runs the test suite using jest. | | npm run db:init | Creates necessary database tables. |


πŸ“š Tech Stack


🀝 Contributing

We love contributions! If you have ideas for improvements or find a bug, please open an issue or submit a pull request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

Distributed under the MIT License. See LICENSE for more information.


Made with ❀️ by Tirth Gaudani