A modern, production-ready SaaS boilerplate built with Next.js 15, React 19, TypeScript, Prisma, and Tailwind CSS.
- Next.js 15 with Pages Router and React 19
- Authentication with NextAuth.js (Email, Google OAuth, Github OAuth support)
- Database with Prisma ORM and PostgreSQL
- Email with Nodemailer, React Email and Mailpit
- Storage with AWS S3 (compatible with MinIO for local development)
- Queue System with BullMQ and Redis
- UI Components with Radix UI and Tailwind CSS
- Form Handling with React Hook Form and Zod validation
- Code Quality with ESLint, Prettier, and Husky
- Testing with Jest and TypeScript
- Analytics with Plausible Analytics (optional)
For macOS users with Homebrew:
# Install Node.js with NVM
brew install nvm
nvm install 22
nvm use 22
nvm alias default 22
# Install required services
brew install redis
brew install postgresql@14
brew install minio
# Optional: Install MailHog for email testing
brew install mailhog- Fork the repository
Go to Github repo https://github.com/wizecore/boilerplate-saas and press "Use this template".
git clone https://github.com/<user>/boilerplate-saas.git
cd boilerplate-saas-
Install all packages via homebrew (MacOS)
brew install postgresql@14 redis minio mailpit
-
Install packages
npm install
-
Set up environment variables
cp .env.example .env.development
Edit
.env.developmentand fill in your configuration values. -
Initialize PostgreSQL database
npm run prepg
-
Start the development server
npm run dev
-
Run database migrations (in separate terminal)
npm run migrate
This will start:
- Next.js dev server on http://localhost:3000
- PostgreSQL database
- Redis server
- MinIO S3-compatible storage on http://localhost:9000
- Mailpit email testing server on http://localhost:8026
npm run dev- Start development server with all servicesnpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run format- Format code with Prettiernpm run test- Run testsnpm run migrate- Run database migrations
npm run pg- Start PostgreSQLnpm run redis- Start Redisnpm run minio- Start MinIO S3 storagenpm run mail- Start MailHog email servernpm run next- Start Next.js only
├── components/ # React components
├── lib/ # Utility functions and backend
├── pages/ # Page router pages and api routes
├── prisma/ # Database schema and migrations
├── public/ # Static assets
├── types/ # TypeScript type definitions
├── .env.example # Environment variables template
├── .env.development # Local development config (never add this to git!)
├── next.config.js # Next.js configuration
├── tailwind.config.js # Tailwind CSS configuration
└── tsconfig.json # TypeScript configuration
See .env.example for all available configuration options. Key variables include:
DATABASE_URL- PostgreSQL connection stringREDIS_URL- Redis connection stringNEXTAUTH_SECRET- NextAuth.js secret keyNEXTAUTH_URL- Application URLS3_*- S3/MinIO storage configurationSMTP_*- Email server configuration
When you change the Prisma schema:
npm run migrateThis will:
- Create a new migration
- Apply it to your database
- Regenerate the Prisma client
Run the test suite:
npm run testWatch mode for development:
npm run test:watch-
Build the application:
npm run build
-
Set production environment variables
-
Start the production server:
npm run start
This is a boilerplate template. Feel free to customize it for your needs.