Welcome! This is a robust, full-stack SaaS boilerplate built around Next.js.
I built this because I love shipping products, but I hate configuring the same infrastructure over and over again. It’s not "the ultimate" boilerplate, it’s just a really solid foundation standing on the shoulders of giants. It combines a strictly typed backend with a fully integrated Admin Dashboard and Blog system in a single application.
Want to see what it looks like? Click on this link!
We use Docker to keep the environment consistent.
Copy the example environment file and fill in your secrets.
cp .env.example .envStart the application and the database.
docker compose up -d --build- App: http://localhost:3000
- Admin Dashboard: http://localhost:3000/admin
I have written detailed documentation to help you (or your AI assistant) understand the architecture.
If you are using an LLM (Cursor, Windsurf, ChatGPT) to help you code, feed it docs/LLM.md first.
- docs/LLM.md: Start here. The master context file containing architecture, patterns, and coding rules.
- docs/API.md: How tRPC works, how to add endpoints, and authentication logic.
- docs/DB.md: Database schema, Drizzle ORM usage, and migration workflows.
A quick look at where things live:
src/
├── app/ # Next.js App Router
│ ├── (admin)/ # Internal Admin Dashboard
│ ├── (app)/ # Main SaaS Application
│ └── blog/ # Public Blog Routes
├── components/ # Shared UI (Shadcn)
├── lib/ # Singleton clients (Stripe, Auth)
├── server/ # Backend Logic
│ ├── api/ # tRPC Routers
│ ├── db/ # Drizzle Schema
│ └── services/ # Business Logic (The "Service Layer")
Since this project is fully Dockerized, you can technically host it anywhere (AWS, VPS, DigitalOcean). However, I have strong preferences when it comes to shipping without headaches.
I personally use and love Dokploy. It gives you the Heroku/Vercel experience on your own VPS (Hetzner, AWS, etc.), giving you full control over your infrastructure and costs.
If you are not comfortable with setting this up, I wrote a simple, bite-sized article to guide you through it: 👉 How to deploy a Compose stack with Dokploy
You can also check the official Dokploy documentation, which is crystal clear.
Before switching to self-hosting, I was a heavy user of Railway. It is a good platform that handles everything for you.
While I prefer the full control Dokploy offers today, Railway is a fantastic alternative if you don't want to manage a server at all. A tutorial to deploy this boilerplate on Railway is coming soon.
This project wouldn't exist without the incredible open-source community. A huge shout-out and thanks to the maintainers of these packages. If you use this boilerplate, please consider starring their repos:
- Framework: Next.js 15 (App Router & Server Actions)
- API Layer: tRPC v11 (End-to-end type safety)
- Database: PostgreSQL & Drizzle ORM
- Auth: Better-Auth
- Editor: PlateJS (Headless Rich Text)
- UI/UX: Tailwind CSS v4 & Shadcn/UI
- Payments: Stripe
- Deployment: Ready for Dokploy
If you like this boilerplate, please consider giving it a star ⭐. It helps me know that this work is valuable to the community!
Made with many 🥜