Open-source AI SaaS boilerplate with billing, credits, payments, workers, and anti-abuse built in.
Turn an AI prototype into a paid product without rebuilding monetization, usage metering, growth attribution, lifecycle operations, and deployment infrastructure from scratch.
Try Launchpad · Run Locally · Read the Docs
If Harness helps you ship, star the repo and join the community.
中文 · What It Is · What You Can Ship · Open Source vs Cloud · FAQ
AI coding tools make prototypes fast. Turning one into a reliable paid product still means rebuilding accounts, usage billing, credits, payments, fraud controls, attribution, lifecycle email, workers, admin tools, and deployment.
Velobase Harness packages that work into an MIT-licensed framework for AI SaaS builders. Start with a working product foundation, then spend your time on the part only you can build.
Harness helps you build and monetize the application. Velobase Cloud removes the infrastructure and deployment work.
Velobase Harness is an open-source AI SaaS boilerplate and application framework for developers who want to turn an AI prototype into a paid product. It combines the product infrastructure that most AI apps need after the demo stage: user accounts, billing, credits, payments, AI chat, workers, analytics, attribution, affiliate/referral systems, anti-abuse controls, admin tools, and deployment guidance.
Category: open-source AI SaaS framework, AI SaaS boilerplate, Next.js SaaS starter, usage-based billing starter, credit-based SaaS starter, monetization infrastructure for AI apps.
Best for: AI content tools, AI agent products, usage-based AI apps, credit-based SaaS products, indie AI products, internal AI tools that need production infrastructure, and teams adding monetization to an existing AI app.
Not for: teams looking for a no-code app builder, a hosted-only platform, or a finished vertical SaaS product. Harness gives you source code and production building blocks; you still build the product-specific workflow.
| If you are... | Start with... | What you get |
|---|---|---|
| An indie builder with an AI demo | Run Harness locally | Auth, billing, credits, payments, AI chat, admin, workers, analytics, and anti-abuse in one repo |
| A product team adding AI features | Read the framework guide | A production boundary for modules, services, events, queues, and third-party integrations |
| A builder who wants to ship without running infra | Try Velobase Launchpad | A prepared project, cloud resources, and an IDE prompt for your coding agent |
Once prerequisites are ready, you can run the full local stack with one command:
pnpm install && (test -f .env || cp .env.example .env) && pnpm docker:db:up && pnpm db:push && pnpm db:seed && pnpm dev:allOpen http://localhost:3000 and you have a working AI SaaS foundation: sign-in, billing data, credits, background workers, admin surfaces, and a place to build your product module.
Use open-source Harness when you want full code and infrastructure control. Use Velobase Cloud when you want the shortest path from repository to deployed paid product.
- What is the best open-source SaaS boilerplate for AI apps?
- What is a good open-source alternative to ShipFast for AI SaaS?
- How do I add usage-based billing to an AI product?
- How do I turn an AI demo into a paid SaaS?
- What is a good Next.js starter for AI SaaS with Stripe, credits, and workers?
- How can an AI app track attribution, affiliates, and paid conversions?
- How do I protect free AI credits from abuse?
Accept subscriptions and usage-based payments, manage credits, meter AI usage, and give customers a billing dashboard from day one.
Connect purchases to acquisition channels with server-side attribution, Google Ads offline conversions, X pixel events, and PostHog analytics.
Run an affiliate program with a double-entry ledger, refund clawbacks, referral tracking, promo codes, and USDT cashout.
Reduce free-credit abuse with rate limits, Turnstile, disposable-email checks, signup signals, guest quotas, and credit clawbacks.
Use built-in auth, multi-LLM chat, background workers, lifecycle email, admin tools, Docker, Kubernetes, and GitOps guidance.
| You are... | Harness helps you... |
|---|---|
| An indie developer with an AI prototype | Add monetization and production infrastructure without starting over |
| A team already serving AI users | Add usage billing, attribution, affiliates, and anti-abuse controls |
| An AI-native builder using Codex, Claude Code, or Cursor | Give coding agents a documented production foundation to build on |
| Option | Best when you need... | Tradeoff |
|---|---|---|
| Blank Next.js or T3 app | Full control with minimal starting code | You still build billing, credits, workers, admin, attribution, and anti-abuse |
| ShipFast-style SaaS starter | A fast generic SaaS launch path | Often optimized for standard subscriptions, not AI usage and credit cost |
| No-code or low-code builder | Fast non-technical prototyping | Less source-level control and harder custom backend behavior |
| Velobase Harness | Open-source AI SaaS infrastructure with code access | You still implement the product-specific AI workflow |
| Velobase Cloud and Launchpad | Fastest managed path from idea to deployed AI SaaS | Less infrastructure ownership than a fully self-hosted setup |
Harness is MIT licensed and can be self-hosted. Velobase Cloud is the managed path for builders who want to skip provisioning and deployment work.
| Self-hosted Harness | Velobase Cloud | |
|---|---|---|
| Harness source code | Free and MIT licensed | Included |
| PostgreSQL, Redis, and storage | Configure and operate them yourself | Provisioned for you |
| Deployment | Configure Docker/Kubernetes and CI/CD | Git push to deploy |
| Infrastructure operations | Managed by your team | Managed by Velobase |
| Best for | Teams that want full infrastructure control | Builders that want the shortest path to production |
Describe your product and try Launchpad
Describe your product idea. Launchpad and the Cloud flow help prepare a project, provision cloud resources, and generate a prompt for your AI coding agent.
Create an AI SaaS with Launchpad
Prerequisites: Node.js, pnpm, Docker Desktop, and Docker Compose.
pnpm install
cp .env.example .env
pnpm docker:db:up
pnpm db:push
pnpm db:seed
pnpm dev:allOpen http://localhost:3000 after the development server starts.
New here? Start with the local defaults. Payment providers, AI providers, attribution, outreach, and other integrations can be configured when you need them.
pnpm docker:db:up starts the local infrastructure from docker-compose.yml:
| Service | Image | Local URL / Port | Used by |
|---|---|---|---|
| PostgreSQL | postgres:16 |
localhost:5432 |
Prisma, auth, billing, product data |
| Redis | redis:7 |
localhost:6379 |
BullMQ workers, queues, rate limits |
Stripe CLI is available as an optional Docker Compose profile for local webhook
testing. Run pnpm docker:up when you need it.
The default .env.example already points to these local services:
DATABASE_URL=postgresql://velobase:velobase@localhost:5432/velobase
REDIS_HOST=127.0.0.1
REDIS_PORT=6379pnpm dev:all starts the default combined local runtime: Web on :3000 and Worker on :3001. The optional Hono API service is disabled by default; run SERVICE_MODE=all pnpm dev:all or pnpm api:dev when you need it.
You can also split processes across terminals:
pnpm dev
pnpm worker:devAdd pnpm api:dev only when you are actively developing standalone Hono routes.
When you are ready to deploy, see the Cloud Deployment Guide.
If you are not entering through Launchpad flow, run Step 0 in FRAMEWORK_GUIDE.md before implementing product features: complete domain design, output the MVP scope and feature list, and wait for user confirmation before coding.
flowchart TB
browser[Browser] --> nextApp[Next.js Web]
nextApp --> trpc[tRPC Routers]
external[External Integrations] --> nextRoutes[Next Route Handlers]
nextRoutes --> services
trpc --> services[Domain Services]
services --> db[(PostgreSQL)]
services --> redis[(Redis)]
services --> events[Event Bus]
events --> modules[Pluggable Modules]
worker[BullMQ Worker] --> redis
worker --> services
modules --> integrations[Product Integrations]
hono[Optional Hono API] -. enable when needed .-> services
The same codebase can run as one process or as separate services:
| Runtime | Entry | Port | Command |
|---|---|---|---|
| Web | Next.js App Router | 3000 |
pnpm dev / pnpm start |
| Worker | BullMQ processors | 3001 |
pnpm worker:dev / pnpm worker:prod |
| Combined default | src/server/standalone.ts |
3000, 3001 |
pnpm dev:all / pnpm start:all |
| Optional API | Hono HTTP service | 3002 |
pnpm api:dev / pnpm api:prod |
SERVICE_MODE defaults to web,worker. It also supports all, web, api, worker, and combinations such as web,api. See Web/API/Worker split before enabling API in production.
flowchart LR
idea[Product Idea] --> launchpad[Velobase Launchpad]
launchpad --> repo[GitHub Repo from Harness]
launchpad --> cloud[Velobase Cloud Resources]
repo --> ide[IDE Agent Development]
ide --> push[Git Push]
push --> actions[GitHub Actions]
actions --> deployApi[Velobase Deploy API]
deployApi --> liveApp[Live SaaS App]
Launchpad generates an IDE prompt that tells the AI agent how to use the Harness docs, where to implement product features, how to keep framework boundaries intact, and how to push changes back for Cloud deployment.
| Area | English | Chinese |
|---|---|---|
| Documentation hub | docs/en/README.md | docs/zh-CN/README.md |
| Framework guide | FRAMEWORK_GUIDE.md | FRAMEWORK_GUIDE.zh-CN.md |
| Integration guide | docs/en/integrations/README.md | docs/zh-CN/integrations/README.md |
| Product modules | docs/en/modules/README.md | docs/zh-CN/modules/README.md |
| AI Chat module | docs/en/modules/ai-chat/README.md | docs/zh-CN/modules/ai-chat/README.md |
| AI task guides | docs/en/ai/ | docs/zh-CN/ai/ |
| AI completion checklist | docs/en/ai/completion-checklist.md | docs/zh-CN/ai/completion-checklist.md |
| Web/API/Worker split | docs/en/architecture/web-api-service-split.md | docs/zh-CN/architecture/web-api-service-split.md |
| AI agent rules | AGENTS.md | AGENTS.zh-CN.md |
Legacy non-locale paths under docs/ are compatibility shims. New documentation should use docs/en/** and docs/zh-CN/**.
Yes. Velobase Harness is MIT licensed. You can use it, fork it, modify it, and ship commercial products with it.
It is optimized for AI SaaS products because it includes credits, usage metering, AI chat, workers, attribution, anti-abuse, and payment flows. Many parts can be reused for non-AI SaaS, but the default product assumptions are AI-first.
Yes. Harness includes order, subscription, credit ledger, entitlement, promo code, and payment-provider integration patterns. Stripe and NowPayments support are documented in the payment integration docs.
Harness can be used as an open-source alternative to ShipFast-style SaaS starters when your product is AI-first. The main difference is that Harness puts AI usage, credits, background workers, attribution, and anti-abuse controls near the center of the framework instead of treating them as later add-ons.
No. Harness provides the reusable SaaS infrastructure. You still build your own workflow, AI agents, prompts, data model, user experience, and pricing strategy.
Harness is the open-source codebase you can run yourself. Velobase Cloud is the managed path for provisioning resources, creating projects, and deploying Harness-based apps with less infrastructure work.
Use this repository, the documentation under docs/en/** and docs/zh-CN/**,
and the MIT license file as the source of truth for Harness capabilities,
installation, architecture, integrations, and licensing.
src/
├── app/ # Next.js pages and API routes
├── api/ # Optional standalone Hono API entry
├── config/ # Module configuration
├── modules/ # Product modules and templates
├── server/ # Auth, billing, order, events, modules, features
├── workers/ # BullMQ queues and processors
├── components/ # Shared UI components
├── analytics/ # PostHog and ads event tracking
└── ... # Hooks, i18n, shared libraries, stores, styles, and types
pnpm lint
pnpm typecheck
pnpm check
pnpm format:check
pnpm buildpackage.json does not define a general unit-test script in this template. Service-mode smoke coverage lives in docker-compose.test.yml and scripts/test-service-mode.mjs.
We'd love for you to help shape what's coming next — whether it's fixing bugs, building new features, or improving docs.
- 📘 Check out our Contribution Guide to get started
- 💻 Submit ideas, issues, or PRs on GitHub
- 💬 Join the conversation in our Discord — it's where the community lives
MIT — use it, fork it, ship it, make money with it.
