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

@boostengine/server

v1.0.1

Published

Plug-and-Play Headless eCommerce API Router for Express, Fastify, and Node.js. 1-line auto-mount for Payments, Logistics, Returns, Coupons, Phone Auth, and GST Invoicing.

Downloads

279

Readme

@boostengine/server

Plug-and-Play Headless eCommerce API Router for Express & Node.js
Mount all your eCommerce backend routes in 1 line of code.

npm version license


What is this?

When building an eCommerce backend, you need dozens of API routes:

  • Payment gateway (create order, verify, webhooks)
  • Shipping (create shipment, track, pincode check)
  • OTP authentication
  • Cart management
  • Coupon validation
  • Returns & refunds
  • GST Invoice generation
  • WhatsApp/Email/SMS notifications

Writing all of this from scratch takes weeks. @boostengine/server gives you all of these routes pre-built and ready to mount in your Express app.


Installation

npm install @boostengine/server express

Quick Start (30 seconds)

import express from 'express';
import { createBoostApiRouter } from '@boostengine/server';

const app = express();
app.use(express.json());

// 1. Create the router with your credentials
const boostRouter = createBoostApiRouter({
  razorpayKeyId:     process.env.RAZORPAY_KEY_ID,
  razorpayKeySecret: process.env.RAZORPAY_KEY_SECRET,
  shiprocketEmail:   process.env.SHIPROCKET_EMAIL,
  shiprocketPassword: process.env.SHIPROCKET_PASSWORD,
  fast2smsApiKey:    process.env.FAST2SMS_API_KEY,
  gstNumber:         process.env.GST_NUMBER,
  businessName:      'My Awesome Store',
});

// 2. Mount it — that's it!
app.use('/api', boostRouter);

app.listen(3001, () => {
  console.log('BoostEngine API running on http://localhost:3001');
});

Available API Routes

Once mounted at /api, you get these routes automatically:

💳 Payments (/api/payments)

| Method | Route | Description | |--------|-------|-------------| | POST | /api/payments/create-order | Create Razorpay order | | POST | /api/payments/verify | Verify payment signature | | POST | /api/payments/webhook | Handle Razorpay webhooks |

🚚 Shipping (/api/shipping)

| Method | Route | Description | |--------|-------|-------------| | POST | /api/shipping/create-shipment | Create Shiprocket shipment | | GET | /api/shipping/track/:awb | Track shipment by AWB | | POST | /api/shipping/check-pincode | Check pincode serviceability |

🔐 Authentication (/api/auth)

| Method | Route | Description | |--------|-------|-------------| | POST | /api/auth/send-otp | Send OTP via Fast2SMS | | POST | /api/auth/verify-otp | Verify OTP |

🛒 Cart (/api/cart)

| Method | Route | Description | |--------|-------|-------------| | GET | /api/cart | Get cart contents | | POST | /api/cart/add | Add item to cart | | PUT | /api/cart/update | Update item quantity | | DELETE | /api/cart/remove/:itemId | Remove specific item | | DELETE | /api/cart/clear | Clear entire cart |

🏷️ Coupons (/api/coupons)

| Method | Route | Description | |--------|-------|-------------| | POST | /api/coupons/validate | Validate a coupon code | | POST | /api/coupons/apply | Apply coupon to cart |

🔄 Returns (/api/returns)

| Method | Route | Description | |--------|-------|-------------| | POST | /api/returns/initiate | Initiate a return request | | GET | /api/returns/status/:returnId | Get return status |

🧾 Invoicing (/api/invoicing)

| Method | Route | Description | |--------|-------|-------------| | POST | /api/invoicing/generate | Generate GST invoice PDF |

🔔 Notifications (/api/notifications)

| Method | Route | Description | |--------|-------|-------------| | POST | /api/notifications/whatsapp | Send WhatsApp message | | POST | /api/notifications/email | Send email notification | | POST | /api/notifications/sms | Send SMS notification |

❤️ Health Check

| Method | Route | Description | |--------|-------|-------------| | GET | /api/health | Check server status & active modules |


Configuration

const boostRouter = createBoostApiRouter({
  // Payment Gateway (Razorpay)
  razorpayKeyId:      'rzp_live_XXXX',
  razorpayKeySecret:  'XXXX',

  // Logistics (Shiprocket)
  shiprocketEmail:    '[email protected]',
  shiprocketPassword: 'your_password',

  // OTP Auth (Fast2SMS)
  fast2smsApiKey:     'your_fast2sms_key',

  // GST Invoicing
  gstNumber:     '29ABCDE1234F1Z5',
  businessName:  'My Store Pvt. Ltd.',

  // Enable or disable specific modules
  enable: {
    payments:      true,
    shipping:      true,
    auth:          true,
    cart:          true,
    coupons:       true,
    returns:       true,
    invoicing:     true,
    notifications: false, // disable if not needed
  },

  // Add custom middleware (e.g., JWT auth check)
  middleware: [myAuthMiddleware],

  // Add a prefix to all routes
  prefix: '/v1',
});

Disable Specific Modules

Only need payments and shipping? Disable the rest:

const boostRouter = createBoostApiRouter({
  razorpayKeyId:     process.env.RAZORPAY_KEY_ID,
  razorpayKeySecret: process.env.RAZORPAY_KEY_SECRET,
  enable: {
    payments:      true,
    shipping:      true,
    auth:          false,
    cart:          false,
    coupons:       false,
    returns:       false,
    invoicing:     false,
    notifications: false,
  },
});

Add Authentication Middleware

Protect routes with your JWT or session middleware:

import jwt from 'jsonwebtoken';

function authGuard(req, res, next) {
  const token = req.headers.authorization?.split(' ')[1];
  if (!token) return res.status(401).json({ error: 'Unauthorized' });
  try {
    req.user = jwt.verify(token, process.env.JWT_SECRET);
    next();
  } catch {
    return res.status(401).json({ error: 'Invalid token' });
  }
}

const boostRouter = createBoostApiRouter({
  middleware: [authGuard],
  // ... other config
});

Health Check

Test that your server is running:

curl http://localhost:3001/api/health

Response:

{
  "success": true,
  "service": "@boostengine/server",
  "version": "1.0.0",
  "modules": {
    "payments": true,
    "shipping": true,
    "auth": true,
    "cart": true,
    "coupons": true,
    "returns": true,
    "invoicing": true,
    "notifications": true
  }
}

Used with create-boost-app

If you scaffold a backend project with create-boost-app --template backend-express, @boostengine/server is already wired up for you:

npx create-boost-app my-api --template backend-express
cd my-api
npm install
npm run dev

TypeScript Support

Full TypeScript support is built in:

import { createBoostApiRouter, BoostServerConfig, BoostMiddleware } from '@boostengine/server';

const config: BoostServerConfig = {
  razorpayKeyId: process.env.RAZORPAY_KEY_ID!,
  // ...
};

License

MIT © Boost Engine