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

create-node-forge

v0.3.0

Published

Scaffold robust, production-ready Node.js backend applications with TypeScript, Express, and best practices. A powerful CLI to quickly bootstrap your next API project.

Readme

🚀 Create Node Forge

npm version License: MIT Node.js TypeScript

A powerful CLI tool to scaffold robust, production-ready Node.js backend applications with TypeScript, Express, and industry best practices. Get your API project up and running in seconds!

✨ Features

  • 🎯 Production-Ready Template - Full-featured Node.js backend with TypeScript, Express, and MongoDB
  • 🏗️ Clean Architecture - Layered structure with Controllers, Services, Repositories, and Models
  • 🔐 Security First - JWT authentication, bcrypt hashing, helmet, CORS, and rate limiting
  • 📝 Input Validation - Comprehensive Joi validation schemas
  • 🧪 Testing Suite - Jest setup with unit and integration tests
  • 📊 API Documentation - Auto-generated Swagger/OpenAPI docs
  • 🔧 Developer Tools - ESLint, Prettier, Husky git hooks, and lint-staged
  • 🐳 Docker Ready - Optional Docker and docker-compose configuration
  • 📈 Observability - Winston logging with structured output
  • Performance - Response compression and optimized middleware setup

🚀 Quick Start

Using npm (Recommended)

npm create node-forge my-api
# or
npx create-node-forge my-api

Using yarn

yarn create node-forge my-api

Interactive Setup

The CLI will guide you through the setup process:

🚀 Node.js Monolithic Template Project Creator 🚀

? What is the name of your new project? my-awesome-api
? A short description for your project: My awesome API built with best practices
? Author's name: John Doe <[email protected]>
? Install Node.js dependencies now (npm install)? Yes
? Initialize a Git repository (git init)? Yes
? Include Docker setup (Dockerfile, docker-compose.yml)? Yes
? Include Jest unit and integration tests (__tests__/ folder)? Yes
? Include Swagger API documentation setup? Yes

📂 Generated Project Structure

my-awesome-api/
├── src/
│   ├── api/              # API router aggregation
│   ├── config/           # App configuration & constants
│   ├── controllers/      # Request handlers
│   ├── middleware/       # Express middleware
│   ├── models/           # Mongoose schemas
│   ├── repositories/     # Data access layer
│   ├── routes/           # Route definitions
│   │   └── validations/  # Joi validation schemas
│   ├── services/         # Business logic layer
│   ├── types/            # TypeScript type definitions
│   ├── utils/            # Helper functions
│   ├── app.ts           # Express app setup
│   └── server.ts        # Server entry point
├── __tests__/           # Test files
│   ├── unit/            # Unit tests
│   └── integration/     # Integration tests
├── public/              # Static assets
├── logs/                # Application logs
├── .env.example         # Environment variables template
├── .env                 # Your environment variables
├── docker-compose.yml   # Docker compose configuration
├── Dockerfile           # Docker configuration
└── package.json         # Dependencies and scripts

🛠️ What's Included

Core Technologies

  • Node.js 18+ with TypeScript
  • Express.js - Fast, minimalist web framework
  • MongoDB with Mongoose ODM
  • JWT authentication with refresh tokens
  • bcryptjs for secure password hashing

Development Tools

  • TypeScript - Static type checking
  • ESLint - Code linting with Airbnb config
  • Prettier - Code formatting
  • Husky - Git hooks for quality gates
  • lint-staged - Run linters on staged files
  • ts-node-dev - Fast development server

Testing & Quality

  • Jest - Testing framework
  • Supertest - HTTP testing library
  • Test database setup and teardown
  • Code coverage reporting

Security & Performance

  • Helmet - Security headers
  • CORS - Cross-origin resource sharing
  • Rate limiting - Prevent abuse
  • Request compression - Optimize responses
  • Input sanitization - Prevent injection attacks

Documentation & Deployment

  • Swagger/OpenAPI - Interactive API documentation
  • Docker support with multi-stage builds
  • Environment-based configuration
  • Structured logging with Winston

🎯 Getting Started with Your Project

After creating your project:

cd my-awesome-api

# If you didn't auto-install dependencies
npm install

# Set up your environment
cp .env.example .env
# Edit .env with your configuration

# Start development server
npm run dev

# Run tests
npm test

# Build for production
npm run build

# Start production server
npm start

Available Scripts

npm run dev          # Start development server with hot reload
npm run build        # Build TypeScript to JavaScript
npm start            # Start production server
npm test             # Run all tests
npm run test:watch   # Run tests in watch mode
npm run test:coverage # Run tests with coverage report
npm run lint         # Check code style
npm run lint:fix     # Fix linting issues
npm run format       # Format code with Prettier

🔧 Configuration

Environment Variables

Your project comes with a comprehensive .env.example file. Key variables include:

NODE_ENV=development
PORT=3000
MONGODB_URI=mongodb://localhost:27017/your-app
JWT_SECRET=your-super-secret-jwt-key
JWT_ACCESS_EXPIRATION_MINUTES=30
JWT_REFRESH_EXPIRATION_DAYS=30

API Endpoints

The generated project includes these example endpoints:

  • GET /api/health - Health check
  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • GET /api/users/me - Get current user profile
  • PUT /api/users/me - Update user profile

API documentation is available at /api-docs when running in development.

📚 Project Architecture

The generated project follows clean architecture principles:

  • Controllers - Handle HTTP requests/responses
  • Services - Contain business logic
  • Repositories - Handle data access
  • Models - Define data structures
  • Middleware - Handle cross-cutting concerns
  • Utils - Reusable helper functions

This structure promotes:

  • ✅ Separation of concerns
  • ✅ Easy testing and mocking
  • ✅ Maintainable and scalable code
  • ✅ Clear dependency flow

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

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

📄 License

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

🙏 Acknowledgments

  • Inspired by create-react-app and other scaffolding tools
  • Built with the amazing Node.js and TypeScript ecosystems
  • Uses industry-standard libraries and best practices

📞 Support


Made with ❤️ by Ankit

Happy coding! 🚀