05/05#bsis-0005/052026Sole engineer
Basis: Boilerplate, shipped
TypeScript SaaS boilerplate: rotating-token auth, Stripe billing and a one-origin Docker deploy, built once.
How it works, in 4 steps
- Sign-in issues a short-lived JWT and a refresh token, stored httpOnly and hashed at rest.
- Refresh tokens rotate on every use; replay a retired one after 30 s and they are all revoked.
- Billing is Stripe: subscriptions, one-time purchases, the Customer Portal, live prices.
- Dockerized, single origin, migrations applied on deploy; built to run on Railway.
Notes
Basis is a full-stack SaaS starter — the parts every product needs and nobody wants to build again. Clone it and you have working auth, billing and email rather than an empty repository.
Auth is email and password: 15-minute JWT access tokens, and refresh tokens that rotate on every use, travel in an httpOnly cookie and are stored only as a SHA-256 hash. A retired refresh token replayed after a 30-second grace window is treated as theft, and every refresh token the user holds is revoked. Billing is Stripe, covering subscriptions and one-time purchases, the Customer Portal, and pricing read live from Stripe rather than hardcoded. Transactional email runs through Resend, with optional S3 uploads and an admin panel for users and roles.
Node, Express and TypeScript on Postgres via Prisma; React, Vite and Tailwind on the front. Helmet, CORS, rate limiting and Zod validation throughout. Dockerized, single origin, migrations applied on deploy, and set up to run on Railway.
Built with
- TypeScript
- Express
- Postgres
- Prisma
- React
- Stripe
- Docker