A production-ready SaaS starter kit with authentication, payments, and modern UI components. Built with Next.js 14, Hono.js, PostgreSQL, and Stripe.
# Clone and setup
git clone <your-repo>
cd modern_saas_template
cp .env.example .env
# Start all services with hot reloading
docker-compose up --build
# Access your app
# Frontend: http://localhost:8080
# API: http://localhost:3001
# Database: localhost:5432# 1. Configure deployment
cd deploy
cp .env.example .env
# Fill in required secrets and project settings
# 2. Run the deployment script (provisions infra + deploys services)
./deploy-production.sh# Requires local PostgreSQL
bun install
bun run dev- Frontend: Next.js 14 (App Router), Tailwind CSS, Zustand
- Backend: Hono.js API with OpenAPI/Swagger docs
- Database: PostgreSQL with Drizzle ORM
- Auth: Clerk authentication
- Payments: Stripe with webhooks
- Email: Resend
- Monitoring: Sentry
- Analytics: PostHog
- Deployment: Google Cloud (gcloud CLI + Docker) / Vercel
- Runtime: Bun
- Monorepo: Turbo
βββ apps/
β βββ web/ # Next.js frontend
β βββ api/ # Hono.js backend
βββ packages/
β βββ db/ # Database schema & queries
β βββ ui/ # Shared UI components
β βββ auth/ # Auth utilities
βββ deploy/ # Docker deployment automation
βββ docker/ # Docker configuration
- Clerk-powered authentication
- Protected routes and middleware
- User profiles and account management
- Admin dashboard access
- Full Stripe integration
- Payment intents and webhooks
- Order management with sync capabilities
- Invoice and receipt generation
- Type-safe PostgreSQL queries with Drizzle
- RESTful API with comprehensive endpoints
- OpenAPI/Swagger documentation
- Provisional order handling
- Docker-first development
- Hot reloading across all services
- TypeScript throughout
- ESLint and Prettier configured
# Development
bun run dev:docker # Start Docker development
bun run dev:local # Start local development
# Database
bun run db:push # Push schema changes
bun run db:studio # Open Drizzle Studio
bun run db:seed # Seed database
# Docker management
bun run docker:up # Start services
bun run docker:down # Stop services
bun run docker:logs # View logs
# Utilities
bun run lint # Run linting
bun run build # Production buildCopy .env.example to .env and configure:
# Database
DATABASE_URL="postgresql://user:password@db:5432/saas_db"
# Auth (Clerk)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_test_..."
CLERK_SECRET_KEY="sk_test_..."
# Payments (Stripe)
STRIPE_SECRET_KEY="sk_test_..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
# Email (Resend)
RESEND_API_KEY="re_..."
# Monitoring (Sentry)
SENTRY_DSN="https://..."
# Analytics (PostHog)
NEXT_PUBLIC_POSTHOG_KEY="phc_..."- Swagger UI:
http://localhost:3001/docs - OpenAPI Spec:
http://localhost:3001/doc
Complete infrastructure and application deployment:
# Configure deployment variables and secrets
cd deploy
cp .env.example .env
# Fill in secrets and adjust config.sh if needed
# Provision infrastructure and deploy services (single environment)
./deploy-production.shFeatures:
- ποΈ Infrastructure provisioning via Google Cloud CLI scripts
- π³ Containerized deployment (Docker)
- ποΈ Automated Cloud SQL creation and migrations
- π Monitoring and logging hooks
- π° Cost-optimized ($15-25/month)
See deploy/PRODUCTION-GUIDE.md for detailed instructions on the dev environment deployment.
- Connect GitHub repository
- Set environment variables
- Deploy automatically on push
bun run build
bun run start/- Landing page/dashboard- User dashboard/profile- User profile management/products- Product catalog/admin- Admin dashboard/admin/order-sync- Order synchronization/sign-in,/sign-up- Authentication
- Fork the repository
- Create a feature branch
- Make changes and test
- Submit a pull request
MIT License - see LICENSE file for details.