Node.js · Express · MongoDB · Production-ready
JWT auth with refresh tokens, Stripe subscriptions with full webhook handling, plan-gated endpoints, admin API, rate limiting, validation, logging — everything wired up and tested.
Before vs after
| Feature | Typical DIY | This boilerplate |
|---|---|---|
| JWT auth | —Access token only, no expiry | ✓Access (15m) + refresh (7d), rotation, revocation |
| Password reset | —Rarely implemented correctly | ✓Expiring tokens, no email enumeration, revoke all sessions |
| Stripe webhook | —// TODO: verify signature | ✓4 events handled: upgrade, downgrade, update, payment_failed |
| Input validation | —if (!email) return res.send("error") | ✓Joi schemas, structured errors, unknown fields stripped |
| Error handling | —try/catch in every route | ✓asyncHandler + global handler covers Mongoose, JWT, Stripe |
| Rate limiting | —None | ✓Global + auth (brute force) + API — all configured |
| Admin API | —None | ✓Paginated user list, filter, stats, activate/deactivate |
| Tests | —None | ✓11 Jest + Supertest integration tests |
| Logging | —console.log | ✓Winston structured logs, Morgan HTTP, colorized in dev |
Features
Full auth flow
Register · login · logout · refresh · verify email · forgot/reset password
Subscriptions
Checkout · Billing Portal · 4-event webhook handler · auto customer create
Feature gates
requirePlan() · checkUsageLimit() · free/pro/enterprise tiers
User management
Paginated list · filter · stats · update role/plan · delete
Joi validation
Schema on every endpoint · structured errors · unknown fields stripped
Security layers
Helmet · CORS · 3-tier rate limiting · NoSQL injection prevention
Email flows
Nodemailer · HTML templates for verify + reset · console mock in dev
Dev experience
asyncHandler · apiResponse · Winston · centralized config · seed script
Example
All the middleware is already written. You just compose it.
Pricing
ONE-TIME · INSTANT DOWNLOAD · MIT LICENSE
30-day money-back guarantee · no questions asked
FAQ
What Node version do I need?
Node 18+ recommended. The Dockerfile uses Node 20 LTS.
Does it work without Stripe?
Yes. Auth, plans, and admin work fine without Stripe keys. The billing endpoints return 503 if not configured.
Can I use this for client projects?
Yes — MIT license. Use it in commercial SaaS, client work, or internal tools. No attribution required.
Can I add PostgreSQL instead of MongoDB?
Yes. The architecture is modular — swap Mongoose for Prisma/Sequelize and the middleware/routes stay the same.
Is TypeScript supported?
This boilerplate is JavaScript. If you need TypeScript, check our Express + TypeScript + Prisma boilerplate.
Refund policy?
30-day full refund, no questions asked.