BoilerplateHub

Nuxt + Neon + Better Auth + Polar

Nuxt with Neon, Better Auth and Polar is the low-obligation version of the Vue subscription stack. Polar holds the authoritative billing record, Neon holds a rebuildable projection of it, and Better Auth holds identity in that same database. It suits a founder who wants to sell globally without starting a tax project.

Nuxt NeonBetter AuthPolar

Database

Neon

The interesting property of this combination is how little the database has to hold. Neon stores Better Auth's tables, your product data, and a projection of Polar's grants, and branching lets you rebuild that projection experimentally. Because Polar keeps the authoritative record, a damaged mirror is recoverable by replaying from their API into a fresh branch and promoting it, which is not true of a stack where your own tables are the ledger.

Authentication

Better Auth

Better Auth gives Nuxt a session and gives Polar a stable customer reference, and those are its two jobs here. The schema in Neon can be extended with a customer column without waiting on any vendor, and the organization plugin covers the case where a company pays while several people sign in. Resolve all of it in Nitro server middleware so a rendered page and an API route never return different answers about entitlement.

Payments

Polar

Polar removes tax and invoicing from a Nuxt codebase that likely has no other accounting concerns in it. Checkouts are created server-side and events arrive at a Nitro handler, both a few lines of work. The tradeoff worth stating plainly is intermediation: the customer's relationship for refunds and receipts is with Polar, so your support flow needs to know when to hand off rather than pretend it can adjust a charge.

What to watch out for

Nuxt serialises server-rendered data into the page payload, so an entitlement resolved during render is shipped to the browser and cached by whatever route rules you configured. Cache a page for anonymous speed and you can hand a free visitor a payload claiming they hold a paid benefit. Mark anything entitlement-dependent as uncached, and keep the real check on the server route that serves the protected resource.

Boilerplates close to this stack

Matched on Nuxt plus the parts of this stack our catalog tags. Each card shows which pieces actually line up, so you can see how much you would still wire yourself.

A CLAUDE.md for this stack

The rules that matter for this combination specifically, including who owns entitlement state. Adapt the commands to your repository before committing it.

CLAUDE.md
# CLAUDE.md

This project is a Nuxt SaaS on Neon, Better Auth and Polar.

## Stack

- Framework: Nuxt
- Database: Neon
- Auth: Better Auth
- Payments: Polar

## Boundaries

- Never edit a migration that has already run. Write a new one.
- Never hardcode Polar price or product identifiers in components. They belong in config.
- Never trust a client-supplied user id. Read the session from Better Auth on the server.
- Treat webhook handlers as idempotent. The same event will arrive twice.

## Entitlements

- Polar is the source of truth for what a customer paid for.
- The database mirrors that state; it never decides it.
- Any check for "can this user do X" reads the mirrored entitlement, not a live API call.

## Before you say a change is done

- The app builds.
- Tests pass.
- No secret, key or webhook signing secret appears in a committed file.

Related stacks