Byteforge, SaaS boilerplates

Byteforge

The full-stack Python and Next.js starter kit for solo founders

Share

Next.js, FastAPI, PostgreSQL, and Stripe in one kit so you can ship a paid SaaS without assembling the stack yourself.

Starter Kit vs Pro

Same core stack. Pro adds 1500+ tests and legal templates.

IncludedStarter · $99Pro · $199
Next.js + FastAPI + PostgreSQL + Stripe
Auth, billing, and dashboard scaffold
Ship a working SaaS in days
1500+ tests
Legal templates

Starter Kit

Ship in days, not weeks. One-time.

$99

Buy Starter

Pro

1500+ tests and legal templates. One-time.

$199

Buy ProOr split in 3 × $66.34

See what you get

Screens from the kit: dashboard, usage, API keys, webhooks, billing and more.

Landing page screen of the SaaS kit

Landing page · 1 / 8

Demo: API metering and billing

Pick a plan and send simulated requests to see quotas, blocked calls, data overage and the projected invoice. Nothing is billed.

The real code behind it

Pricing: tiered overage, rounded once
backend/app/core/pricing.pyPython
@dataclass(frozen=True, slots=True)
class PricingTerms:
    """What prices a cycle: the included allowance (may be 0) and the overage tiers."""

    included_bytes: int
    tiers: tuple[PriceTier, ...]
    discount_percent: int = 0  # launch period: percent off the overage price (0..100)


def overage_numerator(billable_bytes: int, terms: PricingTerms) -> int:
    """Exact cost x GiB (unit: cent*byte/GiB). Python ints never overflow."""
    overage = max(billable_bytes - terms.included_bytes, 0)
    total = lower = 0
    for tier in terms.tiers:
        if overage <= lower:
            break
        upper = overage if tier.up_to_bytes is None else min(overage, tier.up_to_bytes)
        total += (upper - lower) * tier.cents_per_gb
        if tier.up_to_bytes is None:
            break
        lower = tier.up_to_bytes
    return total


def cost_cents(billable_bytes: int, terms: PricingTerms) -> int:
    """``f``: the cycle's overage cost in cents at ``billable_bytes``, rounded half up once. A
    discount scales the exact numerator, so it is applied before the single rounding."""
    kept = 100 - terms.discount_percent
    return (overage_numerator(billable_bytes, terms) * kept + 50 * GB) // (100 * GB)


def debit_cents(settled_bytes: int, call_bytes: int, terms: PricingTerms) -> int:
    """Cents to debit for a call of ``call_bytes`` settled at cumulative ``settled_bytes`` (>= 0)."""
    return cost_cents(settled_bytes + call_bytes, terms) - cost_cents(settled_bytes, terms)
Metering: cycle limit check
backend/app/services/metering.pyPython
def _check_cycle_limit_locked(ctx, terms, wallet, cycle, hold, reserve) -> None:
    """Refuse (402 ``cycle_limit_reached``) a call that would take the cycle past a limit the user set:
    billable data in bytes (the included data counts) or overage charged in cents."""
    limits = metering_settings.get(ctx.user_id)
    if limits is None:
        return
    over_bytes = limits.cycle_limit_bytes is not None and cycle.billable_bytes + hold > limits.cycle_limit_bytes
    over_cents = limits.cycle_limit_cents is not None and cycle.charged_cents + reserve > limits.cycle_limit_cents
    if over_bytes or over_cents:
        ...
        raise _denied(ctx, terms, 402, "cycle_limit_reached", message, reserve=reserve, wallet=wallet, cycle=cycle)
Metering: debit for a call
backend/app/services/metering.pyPython
def _debit_locked(user_id, wallet, cycle, terms, api_key_id, billable, now) -> int:
    """Price ``billable`` bytes from the cycle's position, debit the balance and add the debit to
    the open hourly bucket; returns the cents debited."""
    settled, included = cycle.billable_bytes, terms.included_bytes
    debit = debit_cents(settled, billable, terms.pricing)
    usage_cycles.update(cycle.id, billable_bytes=settled + billable, charged_cents=cycle.charged_cents + debit)
    # ... per-key and per-day totals, pending hourly bucket, wallet balance update ...
    return debit

What each kit includes

Both kits are Next.js, FastAPI, PostgreSQL and Stripe source code with deployment guides. Pro adds 1500+ CI tests and legal templates.

Starter Kit

Production-ready Next.js, FastAPI and PostgreSQL code with deploy guides

A production-ready SaaS codebase built with modern technologies: a Next.js frontend with Tailwind CSS, a Python FastAPI backend, PostgreSQL setup and Stripe payments integration, all tested and documented. Launch faster by skipping months of boilerplate work. The codebase follows best practices, includes API documentation, and comes with step-by-step deployment guides.

What's included

  • Next.js frontend with Tailwind CSS
  • FastAPI backend with authentication patterns
  • Stripe payments: checkout sessions, subscriptions, billing portal and webhook handling
  • PostgreSQL schema and migrations
  • Deployment guides
  • Full API documentation
  • Environment configuration templates
  • Ready-to-use project structure

Pro

Launch your SaaS in days: full-stack code, 1500+ tests, legal templates

A production-ready SaaS boilerplate that eliminates months of setup work. This complete package includes a clean Next.js frontend with Tailwind CSS styling, a Python FastAPI backend, and PostgreSQL database setup, all tested and documented, plus Stripe payments integration, 1500+ tests for reliability, comprehensive documentation, and all the legal templates your business needs to launch. Focused on developers who want to launch quickly without reinventing infrastructure. Skip the boilerplate grind and focus on your unique product.

What's included

  • Everything in Starter Kit
  • 1500+ CI tests
  • Legal templates (terms of service, NDA, data privacy, cookies agreement, etc)

Terms of sale & no-warranty waiver

Applies to: Both the Starter Kit and Pro

Provided “AS IS”, without warranty of any kind, express or implied, including merchantability, fitness for a particular purpose, and non-infringement. By purchasing, you agree that:

  1. NO SUPPORT: no technical support, installation help, bug fixes, or future updates.
  2. NO REFUNDS: due to the digital nature of source code, all sales are final.
  3. DEPLOYMENT: you are solely responsible for configuring, securing, and maintaining your own infrastructure and third-party accounts (e.g., OpenAI, Stripe, PostgreSQL hosting).

SOFTWARE LICENSE AGREEMENT

1. GRANT OF LICENSE: The Seller grants the Buyer a non-exclusive, perpetual, worldwide, non-transferable license to use, modify, and build upon this source code framework for personal or commercial projects. The Buyer is strictly prohibited from reselling, redistributing, or sub-licensing this codebase as a template, boilerplate, or starter kit.

2. INTELLECTUAL PROPERTY RESTRAINT: This license applies solely to the localized customer portal framework, user interface layout, and billing configuration blocks included in this package. It grants no rights, title, or interest in any proprietary backend logic, distinct trade secrets, or parent systems operated by the Seller or its affiliates.

3. 'AS-IS' WARRANTY & LIABILITY WAIVER: THIS SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS, COPYRIGHT HOLDERS, OR SELLER BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The stack you actually ship with

  • Next.js for the product UI
  • FastAPI for the Python API
  • PostgreSQL for data
  • Stripe for payments

Questions

Each answer is tagged with the kit it comes from.

Is this a subscription?Both

No. Both kits are a one-time purchase in USD or BRL. Pro can also be paid in 3 monthly installments.

What is the difference between the Starter Kit and Pro?Both

Both include Next.js, FastAPI, PostgreSQL, and Stripe. Pro adds 1500+ CI tests and legal templates.

What's included in the codebase?Both

A complete Next.js frontend, Python FastAPI backend, PostgreSQL setup, API documentation, deployment guides, and production-ready project structure with best practices.

What languages and frameworks are included?Pro

Next.js frontend, Python FastAPI backend, PostgreSQL databases.

Can I use this for my own SaaS product? (Starter Kit)Starter Kit

Yes, the codebase is yours to customize and deploy. Modify it freely to build your own SaaS application or service, respecting the License terms that come with it.

Can I use this for my own SaaS product? (Pro)Pro

Yes, you get full access to customize and deploy the boilerplate for your own SaaS. The included legal templates cover your business needs, respecting the License terms that come with it.

How do I deploy this?Both

The project includes instructions in its README files.

How quickly can I get started?Pro

With deployment guides included, most developers launch within days. The 1500+ tests ensure stability, so you can focus on product features instead of debugging fundamentals.

Is this suitable for beginners?Both

Intermediate developers will find this most helpful. You should be familiar with React, Python, and databases to customize and maintain the codebase effectively.

Is this suitable for non-technical founders?Pro

This is designed for developers and technical founders. If you're non-technical, partner with a developer to set up and customize the boilerplate for your needs.