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 enableif 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_URLalready 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)
-
Sign in. Go to
/signin, enter any email (e.g.you@example.com), submit. In thepnpm devterminal you'll see:────────── [auth] magic link ────────── to: you@example.com url: http://localhost:3000/api/auth/callback/email?... ───────────────────────────────────────Paste that
urlinto the browser to complete sign-in. -
Onboard. The wizard creates your first organization (you're the
owner). -
Create a project, then add one or more target languages and (optionally) a namespace under project settings.
-
Create keys. Open the project → Open editor → add a key and type values per language.
-
Import JSON. Project page → Import. Save this as
en.jsonand 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.
-
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. -
Collaborate / review. As the translator, submit a value as a suggestion; as an admin/owner, review (accept/reject), comment, and assign reviewers.
-
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 var | Effect |
|---|---|
RESEND_API_KEY | Magic-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_SECRET | A 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.