Acme SaaS

Adapting this boilerplate

How to turn the boilerplate into your product

This app is a template meant to be cloned per product. The typical flow:

1. Clone and rebrand

git clone <boilerplate-repo> my-product
cd my-product
cp .env.example .env   # fill in secrets
docker compose up -d
pnpm install && pnpm db:migrate && pnpm db:seed
pnpm dev

Then edit the two config files that define your product:

  • src/config/site.ts — name, description, support email, links.
  • src/config/plans.ts — plans, credits, prices and provider price/plan ids.

Marketing copy and all UI strings live in messages/en.json and messages/pl.json. Service pages live under src/app/[locale]/(marketing)/services/.

2. Pick a payment provider

Set BILLING_PROVIDER=stripe or whop in .env, fill the matching keys and map your price/plan ids in src/config/plans.ts. See the README for webhook setup.

3. Build your product logic

Consume credits from your feature code with:

import { consumeCredits } from "@/lib/billing/credits";

await consumeCredits({ userId, amount: 5, reason: "usage", note: "site audit" });

It is transactional and throws InsufficientCreditsError when the balance is too low.

4. Pull upstream improvements (optional)

git remote add upstream <boilerplate-repo>
git fetch upstream
git merge upstream/master

Customizations kept inside src/config/, messages/ and your own feature modules rarely conflict with upstream changes.

On this page