Getting started
Install the monorepo, start the platform, and find your first change.
Prerequisites
- Node.js 20 or newer
- pnpm 10
- Docker
Start the platform
Install dependencies
pnpm installStart PostgreSQL and Redis
pnpm db:up
pnpm queue:upConfigure the environment
Copy .env.example to .env, then provide the required authentication and
email credentials.
cp .env.example .env
pnpm db:migrateStart all applications
pnpm devThe web application runs at http://localhost:3001, the API at
http://localhost:3000, and this documentation site at
http://localhost:3002.
Run only the docs
pnpm exec turbo dev --filter=@linea/docsConfigure the docs assistant
The right-side Ask Linea Docs sheet uses the first configured AI provider
key. Set DOCS_AI_MODEL to choose a specific registered model:
DOCS_AI_MODEL="gpt-5-mini"
OPENAI_API_KEY="your-key"Provider credentials are read only by the server-side route. Questions are
grounded through a searchDocs tool, and answers link back to its sources.
In production, the assistant requires a trusted client IP from Vercel or a
reverse proxy that overwrites X-Real-IP or appends to X-Forwarded-For.
Without one, the assistant returns 503 rather than sharing a rate-limit bucket
among all visitors.
For production semantic search, create an Upstash Vector index with a hosted embedding model and set its REST credentials:
UPSTASH_VECTOR_REST_URL="your-index-url"
UPSTASH_VECTOR_REST_TOKEN="your-index-token"Ingest the MDX documentation after configuring those variables:
pnpm --filter @linea/docs ingestThe command writes to a new namespace and prints the
DOCS_VECTOR_NAMESPACE value to deploy. This keeps the active index intact if
ingestion fails. Without Upstash credentials, local development uses the
built-in documentation search.
Verify a change
Run the same checks used by CI before opening a pull request:
pnpm lint
pnpm typecheck
pnpm format:checkFor a first code change, use the repository map to find the owner, then follow the contribution guide for tests, contracts, and pull-request expectations.
See the contribution guide for repository conventions and the documentation workflow.