Menu

Local development

Stand up Lingo locally and walk the golden path — sign in, create keys, import JSON, invite a teammate, review — with no email provider required (magic-link and invite URLs print to the terminal).

Prerequisites

  • Node 20+ and pnpm 9 (corepack enable if needed)
  • Docker (for Postgres) — or any local Postgres 15+

1. Install dependencies

From the repo root:

pnpm install

2. Start Postgres

docker run --name lingo-pg \
  -e POSTGRES_PASSWORD=postgres \
  -e POSTGRES_DB=lingo \
  -p 5432:5432 -d postgres:16

This matches the DATABASE_URL in .env.example. (Already have the container? docker start lingo-pg.)

3. Configure env

cp app/.env.example app/.env

The defaults work as-is for local testing:

  • DATABASE_URL already points at the Docker Postgres above.
  • AUTH_SECRET — fine to leave as the placeholder locally (a dev fallback also exists); set a real one (openssl rand -base64 32) for production.
  • RESEND_API_KEY / EMAIL_FROM — leave unset. Magic-link + invite URLs print to the server terminal instead of being emailed.
  • AUTH_GITHUB_ID/SECRET — leave unset unless you want GitHub login.

app/.env is gitignored. Both pnpm dev and pnpm db:migrate read it.

4. Run migrations

pnpm --filter app db:migrate

Creates the app's database tables.

5. Start the app

pnpm --filter app dev

Open http://localhost:3000. Keep this terminal visible — sign-in and invite links print here.

6. (Optional) background worker

Needed for large imports (over 1000 writes are queued to the worker) and for webhook deliveries; small imports run inline without it. It also deletes usage statistics older than 90 days; without it they are kept.

pnpm --filter app worker

It connects to the same Postgres and self-creates its pg-boss schema on start.


End-to-end smoke test (the golden path)

  1. Sign in. Go to /signin, enter any email (e.g. you@example.com), submit. In the pnpm dev terminal you'll see:

    ────────── [auth] magic link ──────────
      to:   you@example.com
      url:  http://localhost:3000/api/auth/callback/email?...
    ───────────────────────────────────────
    

    Paste that url into the browser to complete sign-in.

  2. Onboard. The wizard creates your first organization (you're the owner).

  3. Create a project, then add one or more target languages and (optionally) a namespace under project settings.

  4. Create keys. Open the project → Open editor → add a key and type values per language.

  5. Import JSON. Project page → Import. Save this as en.json and drop it in (format auto-detects as JSON nested; pick a target language + namespace):

    {
      "home": { "title": "Welcome to Acme", "cta": "Get started" },
      "nav": { "pricing": "Pricing", "docs": "Docs" }
    }
    

    Click Preview changes, review the preview (new / conflict / unchanged), then Apply import. Changing a setting after the preview clears it, so preview again. Confirm the keys appear in the editor.

  6. Invite a teammate (no email needed). Org settings → Members → invite an email. Click Copy link on the pending invite, or read the invite URL from the terminal:

    ────────── [auth] invite ──────────
      to:   teammate@example.com
      url:  http://localhost:3000/invite/<token>
    ───────────────────────────────────
    

    Open that URL in an incognito window, sign in as teammate@example.com (its magic link also prints to the terminal), and accept. You now have two users in one org.

  7. Collaborate / review. As the translator, submit a value as a suggestion; as an admin/owner, review (accept/reject), comment, and assign reviewers.

  8. Export. Project page → Export → pick languages/format → download.

Teardown

docker stop lingo-pg && docker rm lingo-pg   # destroys the database

What changes without optional secrets

Unset varEffect
RESEND_API_KEYMagic-link + invite URLs print to the terminal instead of emailing.
AUTH_GITHUB_ID/SECRET"Continue with GitHub" is hidden; email (console) sign-in still works.
AUTH_SECRETA dev-only fallback secret is used (never in production).

Everything else — orgs, roles/permissions, projects, the editor, import/export, review — is fully functional against the local database.