How I Built a Production Micro-SaaS in Node.js With 0 npm Dependencies

How I Built a Production Micro-SaaS in Node.js With 0 npm Dependencies

Every time I kicked off a small SaaS or paid API, the first weekend disappeared into the same ritual: Installing 600+ npm packages Fighting ORM migration drift Waiting 35 seconds for a bundler to rebuild Paying for a managed Postgres instance before having a single paying user Modern Node.js (22.5+) quietly changed the rules of the game. Out of the box, Node now ships: node:sqlite — synchronous, fast, embedded SQLite with WAL mode node:crypto — scrypt, timingSafeEqual, HMAC-SHA256, random tokens Native fetch — no massive SDK needed to call Stripe's REST API node:test — built-in test runner with zero config I wanted to see how far you can push a zero-dependency Node.js backend for a real, monetized Micro-SaaS (auth, Stripe subscriptions, metered API keys, rate limiting, and an admin MRR dashboard). Here are the 3 core patterns that made it surprisingly clean — and fast ( kv.split('=').map((s) => s.trim())) ); const timestamp = Number(parts.t); if (!Number.isFinite(timestamp)) return false; // Reject replay attacks outside the 5-minute window if (Math.abs(Math.floor(Date.now() / 1000) - timestamp) > toleranceSec) return false; const expected = crypto .createHmac('sha256', secret) .update(`${timestamp}.${rawBody}`, 'utf8') .digest('hex'); const sigBuf = Buffer.from(parts.v1 || '', 'utf8'); const expBuf = Buffer.from(expected, 'utf8'); return sigBuf.length === expBuf.length && crypto.timingSafeEqual(sigBuf, expBuf); } Enter fullscreen mode Exit fullscreen mode Important gotcha: always verify against the raw UTF-8 request body before calling JSON.parse(), and store processed event.id values in a UNIQUE SQLite column so duplicate Stripe retries are safely ignored. Live Demo & Full Starter Kit I wrapped all of this — auth, CSRF, rate limiting, Stripe Checkout & webhooks (plus a local demo billing mode), SHA-256 hashed API keys, monthly quota metering, an Admin MRR dashboard, Docker/Fly.io/Render configs, and an end-to-end node --test suite — into a clean starter kit called ShipCore Pro. Try the live interactive demo (includes a 1-click Admin login & live API playground): https://shipcore-pro-demo.onrender.com/ Full architecture & commercial starter kit: https://shipcore-pro.netlify.app/ (use code LAUNCH30 for 30% off) Are you already using node:sqlite in production, or still sticking to Postgres/Prisma for small projects? Curious to hear your setup in the comments!

Original Source

Read the full article at Dev →

KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.