展示HN:我开源了我的Go和Next.js B2B SaaS启动器(可在任何地方部署,MIT协议)
Show HN: I open-sourced my Go and Next B2B SaaS Starter (deploy anywhere, MIT)

原始链接: https://github.com/moasq/production-saas-starter

这是一个为认真创业者打造的企业级SaaS样板项目,利用Next.js 16、React 19、Go 1.25和TypeScript构建了一个强大且类型安全的基础。它提供了一个完整的起点,包括身份验证(Stytch)、计费(Polar.sh)和AI集成(OpenAI & Mistral AI),并配备RAG管道。 主要特性包括多租户与数据隔离、细粒度的基于角色的访问控制以及全面的审计日志。UI使用Tailwind CSS和shadcn/ui构建,以实现快速、响应式开发。数据管理使用PostgreSQL与pgvector,并通过SQLC实现类型安全的SQL。 该样板项目设计用于使用Docker & Docker Compose进行轻松的本地开发,并提供Webhook UI和高级分析等功能。还提供咨询服务,用于托管配置、自定义功能开发和代码审计。它采用MIT许可。

穆罕默德,一位技术创始人,开源了一个使用 Go 和 Next.js 构建的 B2B SaaS 全栈启动器,可在 GitHub 上找到 ([https://github.com/moasq/production-saas-starter](https://github.com/moasq/production-saas-starter))。该项目旨在解决其他 SaaS 启动器中常见的供应商锁定问题,允许部署在任何带有 Docker 的 Linux 系统上,避免对 Vercel 或 Supabase 等平台的依赖。 后端使用 Go 1.25,因为它体积小、具有并发性、类型安全(通过 SQLC)和可预测的性能。它的结构是“模块化单体”,以便清晰地分离 Auth、Billing 和 AI 等功能,同时保持单个可部署的二进制文件。 预构建的功能包括身份验证 (Stytch)、计费 (Polar.sh)、AI 管道 (OpenAI RAG 与 pgvector)、OCR (Mistral) 和文件存储 (Cloudflare R2)。该启动器正在驱动作者自己的产品 [apflow.co](https://apflow.co),他正在寻求反馈,特别是关于模块边界和生产环境下的 Docker 设置。
相关文章

原文

The Enterprise-Grade SaaS boilerplate for serious founders. Built with Next.js 16 and Go 1.25.

Go Report Card License: MIT

Dashboard Preview

  • Next.js 16 (v16.0.10) Modern React framework with App Router and API routes.
  • React 19 (v19.2.3) Latest React with improved performance and concurrent features.
  • TypeScript (v5.7.3) Type-safe JavaScript for enhanced developer experience.
  • Tailwind CSS (v3.4.17) Utility-first CSS framework for rapid UI development.
  • shadcn/ui + Radix UI Accessible component library with 29+ pre-built components.
  • TanStack Query (v5.90.5) Powerful data fetching and state management.
  • Zustand (v5.0.8) Lightweight state management for UI state.
  • react-hook-form + Zod Type-safe forms with schema validation.
  • Stytch Enterprise authentication with magic links, OAuth, and SSO.
  • Polar.sh Billing integration and subscription management.
  • Recharts Composable charting library for data visualization.
  • Go 1.25 High-performance, concurrent backend with excellent tooling.
  • Gin Fast HTTP web framework with middleware support.
  • PostgreSQL with pgvector Reliable relational database with vector similarity search.
  • SQLC Type-safe SQL compiler for Go (no ORM).
  • Stytch B2B Enterprise authentication, SSO, and RBAC.
  • Polar.sh Merchant of Record for subscriptions, invoicing, and global tax compliance.
  • OpenAI API LLM integration with RAG pipeline and vector embeddings.
  • Mistral AI OCR service for document data extraction.
  • Cloudflare R2 Object storage for file management.
  • Docker + Docker Compose Containerization for consistent environments.
  • Authentication: Sign in with Magic Link, Google OAuth, and Enterprise SSO.
  • Multi-Tenancy: Built-in Organization support with strict data isolation.
  • Roles & Permissions: Granular RBAC system with 3 roles (Member, Manager, Admin) and 7 permission types.
  • Billing & Subscriptions: Complete integration with Polar.sh for SaaS pricing models.
  • AI & RAG: Ready-to-use vector embeddings pipeline for AI features.
  • OCR Service: Extract structured data from valid documents instantly.
  • Team Management: Invite members, manage roles, and update settings.
  • Responsive Design: Mobile-first UI built with Tailwind CSS and shadcn/ui.
  • Type Safety: End-to-end type safety from database (SQLC) to frontend (TypeScript).
  • Audit Logs: Complete audit logging system for tracking user activities.
  • Webhooks UI: Customer-facing webhook configuration.
  • Advanced Analytics: Built-in charts and usage tracking.

Please follow these simple steps to get a local copy up and running.

  • Docker & Docker Compose
  • Go 1.25+
  • Node.js 20+ & pnpm

Run this command to configure your keys and start the infrastructure:

chmod +x setup.sh && ./setup.sh

Manual Start:

  1. Backend: cd go-b2b-starter && make dev
  2. Frontend: cd next_b2b_starter && pnpm dev
  3. Visit: http://localhost:3000

MIT License

👯 Consulting & Services

Although this kit is self-service, I help ambitious founders move faster.

I can help you with:

  1. Managed Config: I sets up your AWS/GCP production environment so you never touch DevOps.
  2. Custom Features: Need SAML SSO or complex RAG flows? I'll build them directly into your repo.
  3. Code Audits: Migrating from Node/Python? I'll review your architecture for scale.

[email protected]@foundmod

联系我们 contact @ memedata.com