Skip to content
Open menu

Quickstart

Run Nexo Starter locally: clone, configure, migrate, seed, and start the app.

This guide takes you from an empty directory to a running instance with seeded data. It assumes Node.js 20 or newer, Docker, and a package manager of your choice. Examples use pnpm.

Requirements

  • Node.js 20+
  • Docker with Compose (for the local Postgres instance)
  • A free port on 3000, or set PORT to something else

Clone and install

git clone https://github.com/nexolabs/nexo-starter.git my-app
cd my-app
pnpm install

The repository ships with a lockfile. Do not regenerate it on first install; use pnpm install --frozen-lockfile in CI.

Environment file

Copy the example file and fill in the values you need for local work:

cp .env.example .env.local

The minimum set for a local run:

DATABASE_URL=postgres://nexo:nexo@localhost:5432/nexo
AUTH_SECRET=<generate with: openssl rand -base64 32>
AUTH_URL=http://localhost:3000

Email (Resend), uploads (S3-compatible), and billing (Stripe or Paddle) are optional for the first run. The app degrades cleanly: magic-link sign-in logs the link to the console when no email provider is configured, and uploads are disabled until storage is set.

Start Postgres

docker compose up -d db

This starts Postgres 16 on port 5432 with the credentials from .env.example. Data persists in a named volume. To reset, run docker compose down -v and start again.

Migrations and seed

pnpm db:migrate
pnpm db:seed

db:migrate applies the Drizzle migrations in drizzle/. db:seed inserts a demo organization, three users with different roles, a handful of sample records, and the audit log entries that go with them. The seed is idempotent; running it twice does not duplicate rows.

Seeded accounts use the addresses owner@example.com, admin@example.com, and member@example.com. With no email provider configured, request a magic link and read it from the terminal.

First run

pnpm dev

Open http://localhost:3000. The marketing site is the same application you just started; the demo at /demo is the same app running against seeded data. There is no separate demo deployment to keep in sync.

What to change first

Work through these in order. Each one is a small, contained change.

  1. Branding. Replace the wordmark and colors in app/(marketing)/layout.tsx and the Tailwind theme tokens in app/globals.css. Tailwind v4 reads tokens from CSS, so there is no config file to edit.
  2. Product copy. The marketing pages live under app/(marketing). Pricing is defined in lib/plans.ts; keep the plan identifiers stable if you have already created billing products.
  3. Auth providers. OAuth providers are declared in auth.ts. Add or remove providers there; the sign-in page renders what is configured.
  4. Billing. Pick one adapter (Stripe or Paddle) in lib/billing/index.ts and set the corresponding keys. See the Billing article before you touch webhooks.
  5. Seed data. Edit db/seed.ts to match your domain, then run pnpm db:reset to rebuild from scratch.

Verify the install

pnpm test

The suite runs 148 unit tests. All of them pass on a clean checkout without network access or a database.

If something fails, check that DATABASE_URL points at the Docker instance and that migrations ran before the seed. A missing AUTH_SECRET produces a startup error rather than a silent failure, by design.