Building a SaaS template means making hundreds of architectural decisions that will affect every project built on top of it. Here is why we chose what we chose.
Why Next.js App Router
The App Router is not just a new way to organize routes — it fundamentally changes how you think about data fetching and rendering. Server Components let us keep sensitive logic on the server while shipping minimal JavaScript to the client. Layouts provide shared UI without re-rendering. And the built-in caching layer gives us performance without complexity.
Database Strategy
For local development, we use PGlite — an embedded PostgreSQL that requires zero setup. For production, we use PostgreSQL because it is reliable, scalable, and widely supported by hosting providers. The schema is managed through migrations via PayloadCMS, so you always have a clear history of changes.
Authentication with Better-Auth
Authentication is often the most security-critical part of any SaaS application. Better-Auth gives us session management, OAuth providers, passkeys, and email verification out of the box. It integrates seamlessly with Next.js middleware for route protection and supports multi-tenancy patterns.
Component Architecture
Our UI layer is built on shadcn/ui — not a component library, but a collection of accessible, customizable components you own. Combined with Tailwind CSS, this gives you complete design freedom without fighting a framework. Every component is typed, accessible, and easy to modify.
What We Deliberately Left Out
Just as important as what we included is what we did not. We skipped GraphQL in favor of simple REST endpoints. We avoided complex state management libraries — React Server Components and URL state handle most cases. We did not add a CSS-in-JS runtime because Tailwind compiles to static CSS. Every omission was intentional.