Back to articles
engineering

From Open SaaS to the Epic Stack to TanStack Start: how I ended up building my own SQLite template

By Daniel Chavez

When I started building my own products in October of last year, all I really wanted was a SQLite database and Stripe, and it took me three stacks to get there.

Why SQLite?

I always thought of SQLite as the database you put in a mobile app, and then I read Aaron Francis's posts and the ones from Turso and Glauber Costa, and they showed me how WAL mode and tuning a few PRAGMAs could make SQLite scale to levels I had never even thought of. No database server to run or pay for, and a file I can back up, so I decided every product I build would run on it.

Why not Open SaaS?

I started with Open SaaS, the template built on Wasp, and to be honest it was overkill for me, a lot of architecture and a lot of things I didn't need when I really only wanted Stripe. Wasp has its own compiler that takes your Wasp file and your code and generates the client, the server and the deployment code, and I didn't like that magic, building the project felt tedious and I never really knew what the generated code was doing. On October 11 I switched its database from Postgres to SQLite, and the next day I found out Wasp wouldn't let me use SQLite in production, so after about 20 commits I gave up on it.

I looked at the other templates too, the Next.js SaaS Starter, BoxyHQ, Saasfly and ixartz's SaaS Boilerplate, and all of them were Postgres only or Postgres by default.

Why the Epic Stack?

The Epic Stack was the only one that treated SQLite as a first-class database in production, and Kent C. Dodds was openly arguing for SQLite in production, which is a big part of why I went for it. On October 13 I rebuilt WeatherDestination on it, Remix and Prisma on SQLite, and that's really where I started to believe in this setup.

So why did I leave?

In January I started RunMist as a TanStack Start app in the same monorepo, and over the next months the monorepo got worse to work in, especially with AI writing a lot of the code. I ended up in what I call Bun mock hell: mocks leaking from one test file into another, tests passing in one place and failing in CI, and it took me about 60 commits over four months to get out of it. Features would just be broken all the time, and the AI made a lot of mistakes in that monorepo because the architecture and the way I tested features weren't good enough.

The embarrassing part is that I was mocking the database instead of testing against it, on SQLite, where a real database in a test is just a file.

What did I do instead?

In May I started over with a template built for coding with AI, WarpKit, on TanStack Start, Drizzle and one SQLite database per user. Its testing rule is the first thing an agent reads: use a real database, mocks are a code smell. Every feature test gets its own SQLite database, so when something breaks the test breaks with it.

In August I moved WeatherDestination off the Epic Stack onto WarpKit, so every product I run is on the same stack now, and it's funny because this week Kent himself moved from Remix to TanStack Start.

I'm still grateful to the Epic Stack, because it's what convinced me SQLite belongs in production. If you want the technical side of why I picked TanStack Start, I wrote that up on warpkit.dev, and the template itself is WarpKit.