Skip to main content

Welcome to Refract 👋

Hey — glad you’re here. You just saved yourself months of boilerplate work and a lot of hard-learned lessons about what breaks when your business changes fast. This is the documentation for Refract — a TypeScript SaaS boilerplate built from years of production billing experience at big-tech companies. Every abstraction, every boundary, every test exists because I’ve seen what happens without it. The goal of these docs is simple: get you from zero to productive as fast as possible, without leaving you guessing.

You’re 6 steps away from a running SaaS foundation

StepWhat you’ll doTime
1. PrerequisitesInstall Docker, gather credentials5 min
2. InstallationClone the repo, set up your config5 min
3. ConfigurationFill in your development.ts5 min
4. First runmake fresh-start, verify everything works2 min
5. ExploreTour the admin, understand what’s running5 min
6. AI developmentSet up Cursor, start building with AI5 min
Total: ~25 minutes from zero to running.

Going deeper

Once you’re up and running, here are the areas worth exploring next: Architecture — Understanding how the pieces fit together will save you a lot of time when you start building. The Monorepo page explains the workspace layout, GraphQL walks through the full resolver → codegen → frontend hook workflow, and Migrations covers how to evolve the database schema safely. Tooling — Refract’s external services (queue, logger, cache, mailer, metrics) are all pluggable. The Tooling System explains how swapping an implementation is just a config change. Quality — The Testing page covers how Jest and Vitest are set up, coverage thresholds, and the mocking patterns you’ll use daily. Continuous Integration explains what runs on every PR and how coverage diffing works.

A few things worth knowing upfront

The entire stack runs in Docker. You don’t need Node.js, pnpm, or any runtime installed on your machine. If Docker is running, you’re ready. One command gets you started. make fresh-start builds containers, runs migrations, seeds data, and starts everything. That’s it. The code is yours. You own it outright. These docs, the patterns, the architecture — all yours to extend, modify, and ship with.

Lost or stuck?

If something isn’t working, the Troubleshooting section has you covered. If you can’t find what you need, come find me on Discord or drop me a message at the contact page — I read every message personally. Now let’s get you running. → Start with Step 1: Prerequisites