Series · 40 parts
Full Stack SaaS Masterclass
A build-it-for-real series taking a multi-tenant SaaS from empty folder to production: stack choice, monorepo, and the Next.js and NestJS foundations.
Choosing the Right Tech Stack for Your SaaS (Without Overthinking It)
More SaaS projects die from stack decisions than from bad ideas. The least glamorous but most consequential choice in the build: what you actually build on.
Part 1 of 40 · Full StackSetting Up a Monorepo with Turborepo
Why a full-stack TypeScript SaaS wants a monorepo, and how to set one up with Turborepo: the workspace layout, shared types that can't drift, the turbo.json pipeline, and caching.
Part 2 of 40 · Full StackSetting Up Your Next.js App the Right Way
Building Next.js for a SaaS meant to live for years inside a monorepo: the setup decisions that actually matter, and the ones people agonize over that don't.
Part 3 of 40 · Full StackSetting Up NestJS the Right Way
The NestJS API half of the SaaS monorepo: turn on the few things a production API genuinely needs in apps/api, and resist the enterprise patterns you won't touch for months.
Part 4 of 40 · BackendSetting Up PostgreSQL the Right Way
The NestJS API from last time can validate a request and return a typed User, but right now that user lives nowhere. It's time to give the app a memory.
Part 5 of 40 · Full StackChoosing Prisma or TypeORM for Your NestJS API
Last time, setting up PostgreSQL the right way, I left one thing unresolved on purpose: the database has a schema and a connection string, but nothing in the API talks to it yet.
Part 6 of 40 · Full StackSetting Up Docker for Local Development
The Prisma or TypeORM article settled how the API talks to Postgres. What's still missing is the thing that makes all of it reproducible.
Part 7 of 40 · Full StackManaging Environment Variables and Secrets
Last time, in Setting Up Docker for Local Development, we got Postgres and Redis running the same way on every machine on the team. That solved "works on my machine" for the infrastructure.
Part 8 of 40 · Full StackA Folder Structure That Scales for Full Stack SaaS
Your .env files are validated and out of Git by now, thanks to the last article on managing environment variables and secrets. The app boots with the right config in every environment.
Part 9 of 40 · Full StackA Git Workflow for Small Teams
The last few articles set up the folder structure that scales for a full stack SaaS: where the frontend and backend live, how a monorepo shares types, where config sits.
Part 10 of 40 · Full StackJWT Authentication in NestJS
Last time in this series, I covered A Git Workflow for Small Teams, because a codebase without a sane branching model falls apart before the product does.
Part 11 of 40 · Full StackRefresh Tokens Done Right
In JWT Authentication in NestJS I covered issuing and verifying access tokens: signing a JWT, putting a guard in front of your routes, and reading the claims off req.user.
Part 12 of 40 · Full StackRole-Based Access Control (RBAC) in a SaaS
In Refresh Tokens Done Right we got a user safely authenticated and kept them signed in without leaking long-lived credentials.
Part 13 of 40 · Full StackAdding OAuth and Social Login
In Role-Based Access Control (RBAC) in a SaaS we sorted out what a user is allowed to do once they're inside your app.
Part 14 of 40 · Full StackMulti-Factor Authentication (MFA)
Last time in this series, I covered Adding OAuth and Social Login, which let users sign in with an identity they already trust instead of yet another password.
Part 15 of 40 · Full StackSession Management and Token Storage
In Multi-Factor Authentication (MFA) I covered proving who a user is at login: passwords plus a second factor, verified once, at one moment in time.
Part 16 of 40 · Full StackOrganization and Multi-Tenant Authentication
In the previous article we settled how a session gets created, stored, and refreshed. That covers a single user proving who they are.
Part 17 of 40 · Full StackSecuring Your SaaS API
In Organization and Multi-Tenant Authentication we got a user logged into the right organization and made sure their session carries a tenant context that every downstream check can rely on.
Part 18 of 40 · Full StackBuilding a Notification System
In Securing Your SaaS API we locked down who can call your endpoints and what they can touch once they're in. That closes out Module 2.
Part 19 of 40 · Full StackSending Transactional Emails
In Building a Notification System we built a generic pipeline for telling users things happened: in-app, push, and a placeholder for email.
Part 20 of 40 · Full StackAdding Full-Text Search
Emails are going out reliably now, thanks to the queue and templating work from Sending Transactional Emails.
Part 21 of 40 · Full StackHandling File Uploads Securely
In Adding Full-Text Search, we let users search across their own data. File uploads are the natural next feature request.
Part 22 of 40 · Full StackDesigning the SaaS Dashboard
In Handling File Uploads Securely we made sure users can safely get files into the system.
Part 23 of 40 · Full StackProduct Analytics and Event Tracking
In Designing the SaaS Dashboard we built the surface that shows customers their own usage: charts, tables, and summary cards backed by real queries against their own data.
Part 24 of 40 · Full StackAccepting Payments with Stripe
In Product Analytics and Event Tracking we wired up the pipeline that tells us what users actually do inside the product. That data only matters if the product eventually makes money.
Part 25 of 40 · Full StackSubscription Billing and Plans
Last time, in Accepting Payments with Stripe, I covered the part everyone assumes is the hard bit: taking a card and moving money. It isn't, really. Stripe does the hard part.
Part 26 of 40 · Full StackOrganizations, Teams, and Invitations
In Subscription Billing and Plans we wired up the part of the product that collects money.
Part 27 of 40 · Full StackMulti-Tenancy Architecture for SaaS
In Organizations, Teams, and Invitations we got people into the right organization: memberships, roles, invite flows, all the plumbing that decides who belongs where.
Part 28 of 40 · Full StackSetting Up CI/CD for a Full Stack Monorepo
In Multi-Tenancy Architecture for SaaS we worked through how a single deployment serves many organizations without their data or traffic bleeding into each other.
Part 29 of 40 · Full StackMonitoring a SaaS in Production
In the last article, I set up a pipeline that builds, tests, and deploys the monorepo automatically. That solves getting code out safely and repeatably.
Part 30 of 40 · Full StackStructured Logging for Node.js
In Monitoring a SaaS in Production we wired up metrics and alerts so the team knows something is wrong within minutes of it happening. Metrics tell you a spike exists.
Part 31 of 40 · Full StackAudit Logs You Can Trust
In Structured Logging for Node.js, I covered how to turn scattered console.log calls into structured, queryable events. That solves the "what happened in the system" problem.
Part 32 of 40 · Full StackFeature Flags and Safe Rollouts
In Audit Logs You Can Trust, we built a system that answers "who changed what, and when." Feature flags answer a related question: "who gets to see this, and how much of it." Once you trust
Part 33 of 40 · Full StackDeploying a Full Stack SaaS
The previous article in this series covered feature flags: how to decouple deploying code from releasing it, so a bad idea can be turned off without a rollback.
Part 34 of 40 · Full StackScaling a SaaS Beyond One Server
In Deploying a Full Stack SaaS, I got the app running in production on a single instance: Docker images, a CI/CD pipeline, one NestJS container and one Postgres database behind it.
Part 35 of 40 · Full StackDisaster Recovery and Backups
In the last article, I walked through what changes when a SaaS grows past a single server: load balancers, stateless app instances, a database that starts to strain under real concurrency.
Part 36 of 40 · Full StackCaching Strategies for a SaaS
In Disaster Recovery and Backups, we made peace with the database disappearing entirely: accept it can happen, and make recovery boring and rehearsed.
Part 37 of 40 · Full StackA Production Security Checklist
We spent the last article making the app fast. This one is about making sure it's still standing when someone tries to break it.
Part 38 of 40 · Full StackPerformance Tuning Before Launch
In A Production Security Checklist, I walked through what to lock down before opening the doors to real users. Security is a pass/fail gate: you either did the work or you're exposed.
Part 39 of 40 · Full StackThe Production Readiness Checklist
In the last article, I walked through finding and fixing the slow parts of a SaaS before launch: N+1 queries, missing indexes, unbounded payloads, the usual suspects.
Part 40 of 40 · Full Stack