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

@chinturai/one-stack

v1.0.2

Published

Modular backend accelerator utilities for Express.js, built for flexibility, security, and production readiness.

Readme

one-stack

Build your complete backend using only a single stack , i.e : one-stack

Create full Express app , MongoDB models, Set up Auth, CRUD Routes all in one line using one-stack

one-stack is not a replacement , its a lightweight Express backend accelerator built for developers who want fast, secure, and maintainable APIs without sacrificing control.

Whether you're building an MVP, launching a prototype, or scaffolding a production-ready API, one-stack gives you the essentials in a composable and transparent package.

Why use one-stack?

one-stack is designed for developers who want:

  • clean Express setup with no hidden framework behavior
  • native Mongoose model creation with optional password hashing
  • ready-to-use auth routes and JWT protection
  • auto-generated CRUD endpoints with filters, pagination, and search
  • production-ready defaults with error handling and logging

What it includes

  • createApp() — Express app starter with JSON parsing, CORS, security headers, and request logging
  • connectDB() — Mongoose MongoDB connection with retries and connection logging
  • createModel() — native Mongoose model creation with timestamps and optional password hashing
  • setupAuth() — built-in auth routes plus JWT protection middleware
  • createCRUDRoutes() — auto-generated REST resources with pagination, sorting, filtering, and search
  • AppError + centralized error handler for consistent API responses
  • CLI scaffolding for quick project and model generation

Installation

npm install @chinturai/one-stack

Quick Start

const {
  createApp,
  connectDB,
  createModel,
  setupAuth,
  createCRUDRoutes
} = require('@chinturai/one-stack');

const app = createApp();
connectDB(process.env.MONGO_URI);

const User = createModel(
  'User',
  {
    name: { type: String, required: true },
    email: { type: String, required: true, unique: true },
    password: { type: String, required: true }
  },
  { hashPassword: true }
);

setupAuth(app, {
  userModel: User,
  jwtSecret: process.env.JWT_SECRET,
  routes: ['register', 'login', 'me']
});

createCRUDRoutes(app, '/users', User);
app.listen(3000);

Usage Overview

createApp(options)

Creates an Express app with sensible defaults.

const app = createApp({
  trustProxy: true,
  cors: { origin: '*' },
  logRequests: true
});

connectDB(uri, options)

Connects to MongoDB with retry logic.

connectDB(process.env.MONGO_URI, {
  retries: 5,
  retryDelay: 3000
});

createModel(name, schemaDefinition, options)

Builds a native Mongoose model and hides common boilerplate.

const User = createModel(
  'User',
  {
    name: String,
    email: { type: String, required: true, unique: true },
    password: { type: String, required: true }
  },
  {
    hashPassword: true,
    timestamps: true
  }
);

setupAuth(app, config)

Adds auth endpoints and JWT handling.

setupAuth(app, {
  userModel: User,
  jwtSecret: process.env.JWT_SECRET,
  routes: ['register', 'login', 'me'],
  tokenExpiry: '2h',
  routePrefix: '/auth'
});

Supported routes:

  • POST /auth/register
  • POST /auth/login
  • GET /auth/me
  • POST /auth/logout

protect(role)

Protect routes with JWT authentication.

const { protect } = require('@chinturai/one-stack');

app.get('/protected', protect(), (req, res) => {
  res.json({ success: true, user: req.user });
});

Use protect('admin') to enforce role-based access.

createCRUDRoutes(app, basePath, model, options)

Auto-generates RESTful endpoints for a model.

createCRUDRoutes(app, '/users', User, {
  beforeCreate: (req) => {
    // custom logic before creation
  },
  afterDelete: (doc) => {
    // cleanup after delete
  }
});

Generated routes:

  • GET /users
  • GET /users/:id
  • POST /users
  • PUT /users/:id
  • DELETE /users/:id

Query options include:

  • page and limit
  • sort
  • search
  • field filters

CLI

npx @chinturai/one-stack init
npx @chinturai/one-stack generate model User
npx @chinturai/one-stack generate crud User

Recommended workflow

  1. npm install @chinturai/one-stack
  2. const app = createApp()
  3. connectDB(process.env.MONGO_URI)
  4. const User = createModel(...)
  5. setupAuth(app, { userModel: User, jwtSecret: process.env.JWT_SECRET })
  6. createCRUDRoutes(app, '/users', User)

Get started quickly

one-stack is best for developers who want a fast, secure Express backend with minimal boilerplate.

If you want, add route protection, custom model hooks, or override auth handlers to match your application requirements.