Email magic link and OAuth
Passwordless sign-in through Resend, plus OAuth providers configured in a single adapter file. Callback URLs, state checks, and error surfaces are handled in the route handlers rather than scattered across components.
Everything in Nexo Starter 1.4.0 is wired end to end: auth, teams, billing, admin, and the tooling around them. Each section below names the primitives you inherit, not the outcomes you hope for.
Auth.js v5 with email magic links and OAuth providers. Sessions are database-backed, rotated on privilege change, and every token has an explicit expiry you can tune per environment.
Passwordless sign-in through Resend, plus OAuth providers configured in a single adapter file. Callback URLs, state checks, and error surfaces are handled in the route handlers rather than scattered across components.
Cookie sessions carry a short-lived JWT that rotates on refresh. Rotation invalidates the previous token, so a stolen cookie stops working after the next legitimate request from the real client.
A typed `requireUser` helper wraps server components, route handlers, and server actions. Unauthenticated calls redirect or return 401 depending on the caller, so you do not hand-roll checks per route.
Email verification, session revocation on password or email change, and a delete-account flow that cascades through Drizzle relations. Each step is a server action with a test covering the failure path.
A membership table with an explicit RBAC matrix. Roles are owner, admin, member, and viewer; permissions are checked through one function that both the UI and the server call.
Permissions live in a single typed matrix keyed by role and action. Adding a role means editing one object; the compiler flags every call site that needs a new branch.
Invites are signed tokens with an expiry, sent through Resend, and consumed once. Seat counts are enforced at invite time against the plan record, not at sign-up.
Membership changes, role edits, billing events, and admin actions append to an audit table with actor, target, and a JSON diff. Reads are paginated and scoped to the team.
Stripe and Paddle adapters behind one interface. Webhooks are idempotent by event id, tax is delegated to the provider, and subscription state is reconciled on every read.
A `BillingProvider` interface covers checkout, portal, and subscription reads. Stripe and Paddle implement it; swapping providers is a config change plus a migration for stored customer ids.
Every event is inserted into a processed-events table by provider event id inside the same transaction that mutates subscription state. Replays are no-ops; ordering gaps are reconciled by a scheduled pull.
Tax calculation and invoice PDFs are handled by the provider. The kit stores the tax id and billing address on the customer record and exposes them in the billing settings page.
Entitlements are derived from the active subscription row, not from client state. Server components read entitlements through a cached loader that invalidates on webhook write.
An admin console for users, teams, and subscriptions, backed by the same Drizzle schema. Structured logs and request ids make production incidents traceable without a separate stack.
Search users, inspect memberships, and adjust subscriptions. Every mutation goes through the same server actions as the product, so the audit log records admin activity identically.
Request ids propagate from middleware into logs and error reports. Log lines are JSON with route, user id, and duration, ready for whatever collector you already run.
A health route checks database connectivity and migration state. Route-level error boundaries render a stable fallback and report the digest, so users never see a blank screen.
TypeScript strict across the repo, Drizzle migrations checked in, seed data for local work, and 148 unit tests. Docker self-host is a compose file and a documented env contract.
Schema changes ship as ordered SQL migrations generated by drizzle-kit. A seed script populates teams, users, and subscriptions so the demo and local environments match.
Strict mode with no implicit any, plus 148 unit tests over auth guards, the RBAC matrix, webhook handlers, and billing adapters. Tests run against a disposable Postgres instance.
Message catalogs for English, German, and Spanish, with typed keys so a missing translation fails the build. Locale is resolved from the URL segment and persisted on the user record.
A compose file runs the app and Postgres with a documented env contract. Migrations run on boot behind a lock, and the image is a standard Next.js standalone build.
Nexo Starter is a starting point, not a platform. These are deliberate omissions so the codebase stays readable and you keep control of the parts that are specific to your product.