This is an open-source B2B SaaS starter kit featuring a Go backend and a Next.js frontend, both Dockerized and designed for self-hosting on any Linux server. The creator emphasizes avoiding vendor lock-in and unpredictable scaling costs often associated with other SaaS starters. It uses a modular monolith architecture to simplify development and integrate well with AI coding tools.
A starter prompt for Claude Code, what you'll need, and how to reach them.
You are an expert full-stack developer specializing in Go, Next.js (App Router, React 19), Tailwind v4, Docker, and PostgreSQL. Your task is to build a production-grade B2B SaaS starter kit, similar to the `production-saas-starter` by moh_quz, but with a focus on ease of deployment to a generic Linux VPS using `docker-compose`. The core problem this solves is vendor lock-in and unpredictable costs of cloud-specific SaaS starters. Here’s what to build: 1. **Go Backend:** Develop a Go backend API service (using the `gin-gonic/gin` framework for REST endpoints) for core SaaS features: authentication (email/password, JWTs), user management, and a placeholder for basic 'item' CRUD operations (e.g., managing client projects). Use `gorm.io/driver/postgres` with `gorm.io/gorm` for ORM, connecting to a Neon Postgres database. Implement a modular monolith structure where auth, users, and items are distinct Go packages with explicit interfaces, but compile into a single binary. Ensure it's Dockerized with a minimal `Dockerfile`. 2. **Next.js Frontend:** Create a Next.js 16 App Router frontend with React 19 and Tailwind v4. This frontend should consume the Go backend APIs for user registration, login, and displaying/managing the 'item' CRUD operations. Use `react-query` for data fetching and caching. Ensure it's Dockerized for static asset serving or SSR via `next start`. 3. **Docker Compose:** Provide a `docker-compose.yml` file that orchestrates both the Go backend and Next.js frontend containers, along with a `postgres` service (for local development/testing) and `nginx` as a reverse proxy/load balancer. 4. **Configuration:** Implement a robust configuration system (e.g., using environment variables) for database connections, JWT secrets, and API endpoints, making it easy to deploy to different environments. 5. **Initial Schema:** Define a basic PostgreSQL schema for users and items. **MVP Slice to Ship First:** * A fully functional Go backend with user registration, login, and JWT-based authentication. * A Next.js frontend with public landing page, registration form, login form, and a protected dashboard page that displays the logged-in user's email. * A working `docker-compose.yml` that brings up both services locally and connects them. **Build and Verify Gate:** * All services start successfully via `docker-compose up`. * Users can register, log in, and access the protected dashboard. * Code is clean, well-commented, and adheres to Go and Next.js best practices. * The Docker images are optimized for size and build speed.
This starter targets developers building SaaS products, a segment that might be interested in a robust base for products like LMS platforms or certification engines, or in tools like forge-kit for automating their operations.
Hi HN, I'm Mohammed, a technical founder who loves shipping and giving back to the community. I'm open-sourcing the full-stack engine that powers my B2B product, apflow.co. What it is: A production B2B starter with a Go backend and Next.js frontend. Both are fully Dockerized with separate containers. No Vercel. No Supabase. Deploy the whole thing on a $6 VPS, or split frontend and backend across different providers. You own the infrastructure. The problem I was solving: Every SaaS starter I evaluated had the same issue: they locked me into someone else's platform. Vercel for hosting. PlanetScale for the database. Serverless functions billing per invocation. Fine for prototypes, but costs become unpredictable at scale and migrating away is painful. I wanted something I could deploy on any Linux box with docker-compose up. Something where I could host the frontend on Cloudflare Pages and the backend on a Hetzner VPS if I wanted. No vendor-specific APIs buried in my code. Why Go for the backend: Go gives me exactly what I need for a SaaS backend: Tiny footprint. The backend idles at ~50MB RAM. On a cheap VPS, that headroom lets me run more services without upgrading. Co
Reply in the Hacker News thread to Mohammed (@moh_quz)
“I'm genuinely impressed by your `production-saas-starter` and its focus on vendor lock-in avoidance. I've used AI coding tools to rapidly build a similar Go/Next.js/Docker-based MVP, adhering to your modular monolith principles. I'd love to contribute or discuss how we might collaborate on further enhancements or a specialized version for certain niches, perhaps building out a more complete billing integration or specific AI module examples.”
Open the original ↗