
A modern, production-ready full-stack web application template
Built with Next.js 15, TypeScript, Tailwind CSS, Drizzle ORM, PostgreSQL, BetterAuth, and ShadCN UI
π Authentication & Authorization
- Secure Login/Registration: Email and password authentication with validation
- Email Verification: OTP-based email confirmation system
- Role-Based Access Control: Admin, user, and guest role management
- Password Reset: Secure password reset flow with email verification
- Session Management: JWT-based session handling
π¨ User Interface
- Modern Design System: Beautiful, accessible components with ShadCN UI
- Responsive Design: Mobile-first approach with Tailwind CSS
- Dark/Light Mode: Theme switching with persistent user preferences
- Loading States: Skeleton loaders and progress indicators
- Form Validation: Real-time validation with helpful error messages
π οΈ Developer Experience
- Type Safety: Full TypeScript coverage with strict mode
- Database Management: Type-safe queries with Drizzle ORM
- Code Quality: ESLint, Prettier, and pre-commit hooks
- Hot Reload: Instant feedback during development
- API Documentation: Auto-generated API docs
π Performance & Production
- Optimized Builds: Next.js optimizations for production
- Database Pooling: Connection pooling for better performance
- Caching Strategy: Built-in caching for API routes and pages
- Docker Ready: Production-ready containerization
- Health Checks: Built-in health monitoring endpoints
- Node.js β₯18 - Download
- pnpm (recommended) or npm - Install pnpm
- Docker & Docker Compose - Get Docker
- Git - Install Git
git clone https://github.com/CianCode/Saas-Template.git
cd Saas-Template
pnpm install
# or
npm install
cp .env.example .env
Update .env
with your configuration:
docker compose up -d
# Wait 10β15 seconds for database to be ready
# Push schema
pnpm db:push
# Or run migrations
pnpm db:migrate
pnpm db:seed
pnpm dev
Open http://localhost:3000 to see your app.
Saas-Template/
βββ app/ # Next.js App Router
β βββ (auth)/ # Authentication pages
β βββ api/ # API routes
β βββ dashboard/ # Protected pages
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
βββ components/ # Reusable components
βββ lib/ # Utilities (auth, db, validations)
βββ db/ # Drizzle schema, migrations, seeds
βββ hooks/ # Custom hooks
βββ types/ # TypeScript types
βββ public/ # Static assets
βββ docker-compose.yml # Docker config
βββ drizzle.config.ts # Drizzle ORM config
βββ next.config.js # Next.js config
βββ tailwind.config.ts # Tailwind CSS config
βββ tsconfig.json # TypeScript config
pnpm dev # Start development server
pnpm dev:debug # Start dev server in debug mode
pnpm dev:clean # Clean & start fresh dev server
pnpm build # Build app for production
pnpm start # Start production server
pnpm lint # Run linter
pnpm lint:fix # Lint & auto-fix issues
pnpm lint:strict # Lint in strict mode (no warnings)
pnpm db:generate # Generate Drizzle migrations
pnpm db:push # Push schema to DB
pnpm db:migrate # Run migrations
pnpm db:studio # Open Drizzle Studio
pnpm db:seed # Seed DB with initial data
pnpm db:reset # Reset DB & seed fresh data
pnpm ui:add # Add a new component
pnpm ui:update # Update components
See CONTRIBUTING.md.
- Fork the repository
- Create feature branch
- Add changes & tests
- Commit & push
- Open Pull Request
MIT License β see LICENSE
- β Star the repo
- π΄ Fork it
- π’ Share with others
- π Report bugs or suggest improvements
Built with β€οΈ by CianCode
Happy coding! π