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-nodeapi-backend

v2.0.0

Published

A powerful Node.js backend boilerplate with Express, MongoDB, Firebase, JWT auth, Nodemailer, cron jobs, input validation (Joi), and serverless support for Vercel. Scaffold a full-featured API backend in seconds.

Readme

create-nodeapi-backend

A simple boilerplate for quickly setting up a Node.js API with Express, MongoDB, JWT authentication, and more. This tool will help you generate a fully functional backend with minimal configuration.

Features

  • Express.js: RESTful API with Express for handling routes and middleware.
  • MongoDB: Database integration via Mongoose or Prisma ORM.
  • JWT Authentication: Secure user login, session management, and JWTs.
  • Nodemailer: Preconfigured SMTP mail sending utilities.
  • Firebase Integration: Ready-to-go Firebase client configuration.
  • Node-cron: Task scheduling out of the box.
  • Google OAuth: Complete authentication pipeline using Google OAuth 2.0.
  • Serverless Support: Preconfigured files for smooth Vercel deployments.
  • Input Validation: Robust Joi/Zod input validation.

Available Templates

When running the generator, you can choose from the following pre-configured project templates:

  1. JavaScript

    • Database & ODM: MongoDB with Mongoose
    • Bundler: Webpack
    • Features: A fully functional JavaScript backend with JWT Auth, OTP verification, password resets, Google OAuth, Sentry logging, and profile uploads.
  2. TypeScript

    • Database & ODM: MongoDB with Mongoose
    • Bundler: Rollup
    • Features: A clean, minimal TypeScript skeleton featuring Sentry, Firebase client, Nodemailer, and database retry logic.
  3. TypeScript with Prisma (MongoDB)

    • Database & ORM: MongoDB with Prisma ORM
    • Caching & Realtime: Redis integration and WebSockets (ws)
    • Bundler: Rollup and esbuild
    • Features: An advanced, production-ready CRM/Admin boilerplate. Features a custom Swagger UI documentation page (/api-docs), Sentry error handlers, roles & permissions (RBAC) middleware, email templating, and bulk emailing jobs.

How to Install

  1. Create a New Project:

    To launch the interactive generator, run the following command:

    npx create-nodeapi-backend@latest

    During the prompt wizard, you will be asked to choose:

    • A project name.
    • A template (JavaScript, TypeScript, or TypeScript with Prisma).
    • A package manager (npm, pnpm, or bun).
  2. Navigate to the Project Folder:

    cd your-project-folder

    ✅ Note: Dependencies are automatically installed by the CLI using the package manager you chose during setup.

  3. Setup Environment

    Before running the application, make sure to set up your environment variables.

    Copy the .env.sample file to .env:

    cp .env.sample .env

    Open the .env file and update the necessary fields with your credentials.

Example .env:

    JWT_SECRET=1111111111111111scscsdcsdc
    JWT_ACCESS_EXPIRATION_MINUTES=4200
    JWT_REFRESH_EXPIRATION_MINUTES=800
    NODE_ENV=dev

    PORT=3010
    SALT=10

    MONGODB_USERNAME=username
    MONGODB_PASSWORD=password
    MONGODB_DATABASE=dbstore
    MONGODB_URL=databaseurl

    ORIGIN=

    SMTP_SERVICE=gmail
    SMTP_MAIL=Mmail.com
    SMTP_PASSWORD=password
    EMAIL_FROM=me.com

    API_KEY=a
    AUTH_DOMAIN=a
    DATABASE_URL=a
    PROJECT_ID=a
    STORAGE_BUCKET=a
    MESSAGING_SENDER_ID=a
    APP_ID=a
    MEASUREMENT_ID=a

    SERVER_ORIGIN=localhost:3010
    FRONTEND_ORIGIN=localhost:3000

    GOOGLE_CLIENT_ID=your_client_id.apps.googleusercontent.com
    GOOGLE_CLIENT_SECRET=your_client_secret
    GOOGLE_CLIENT_URI=/v1/googleOauth/google/callback

How to Run in Development

1. Database Setup (Prisma Template Only)

If you chose the TypeScript with Prisma template, you must push your schema to the MongoDB database and seed it before starting:

# Push schema to MongoDB
npm run prisma:push

# Seed the database with default roles and admin users
npm run prisma:seed

Note: The seed script creates default users (e.g. [email protected] / password123) to help you get started.

2. Start the Development Server

For local development, you can start the server using nodemon for automatic restarts:

npm run dev

Once the server is running, you can access your API at:

http://localhost:3010

or any of your specified open port.

🔐 Google OAuth Endpoint

Use the following route to initiate Google OAuth login:

http://localhost:3010/v1/googleOauth/google

This will redirect the user to sign in via their Google account.

📖 API Documentation (Prisma Template Only)

When running the Prisma template, you can view the interactive Swagger API documentation:

http://localhost:3010/api-docs

How to Run in Production

  1. Build the Application:

    npm run build
  2. Start the Production Server:

    npm start

    Ensure your .env values are configured for the production environment.


🚀 Deploy to Vercel (Optional)

To deploy to Vercel, simply:

  1. Push your project to a GitHub repository.
  2. Go to Vercel and connect your GitHub account.
  3. Select the repository and follow the prompts.

Vercel will automatically detect your Node.js setup and deploy your project with minimal configuration.

Or deploy via CLI:

vercel --prod

License

MIT License. See the LICENSE file for details.