- Node.js >= 24
- pnpm >= 9
- PostgreSQL (if using database features)
- OpenAI-compatible API key with vision model access
The fastest way to get the full stack running:
cp .env.example .env
# Edit .env — set your AI_INTEGRATIONS_OPENAI_API_KEY at minimum
docker compose upThis starts the app (API + frontend) on port 8080 and a PostgreSQL database on port 5432. Open http://localhost:8080 to use the app.
To also run a local LLM via Ollama (requires an NVIDIA GPU):
docker compose --profile local-llm uppnpm installCopy the example environment file and fill in your values:
cp .env.example .envRequired variables:
| Variable | Description |
|---|---|
PORT |
API server port (default: 8080) |
AI_INTEGRATIONS_OPENAI_API_KEY |
Your OpenAI API key |
AI_INTEGRATIONS_OPENAI_BASE_URL |
OpenAI API base URL (default: https://api.openai.com/v1) |
OPENAI_MODEL |
Vision model for annotation detection (default: gpt-4o) |
DFM_MODEL |
Text model for DFM review — no vision needed (default: gpt-4o-mini) |
DATABASE_URL |
PostgreSQL connection string. Omit to use SQLite fallback (see below) |
POSTGRES_USER |
PostgreSQL username — used by Docker Compose (default: cad_user) |
POSTGRES_PASSWORD |
PostgreSQL password — used by Docker Compose (required, no default in production) |
POSTGRES_DB |
PostgreSQL database name — used by Docker Compose (default: cad_annotator) |
CORS_ORIGIN |
Allowed frontend origin for CORS, e.g. https://app.example.com (required in production) |
Frontend-specific (set in each artifact's .env):
| Variable | Description |
|---|---|
PORT |
Dev server port |
BASE_PATH |
URL base path (default: /) |
pnpm --filter @workspace/api-spec run codegenStart the API server and frontend in separate terminals:
# Terminal 1: API server
pnpm --filter @workspace/api-server run dev
# Terminal 2: Frontend
pnpm --filter @workspace/cad-annotator run devpnpm run buildThis runs type checking across all packages, then builds each artifact:
- API server →
artifacts/api-server/dist/index.mjs - Frontend →
artifacts/cad-annotator/dist/public/
# API server
node --enable-source-maps artifacts/api-server/dist/index.mjs
# Frontend (serve the static build with any HTTP server)
npx serve artifacts/cad-annotator/dist/publicWhen DATABASE_URL is not set, the database layer automatically falls back to SQLite, storing data in a local cad-annotator.db file. No PostgreSQL setup required.
# Just run the dev server — SQLite is used automatically
pnpm --filter @workspace/api-server run devWhen DATABASE_URL is set (e.g., via Docker Compose or manually), PostgreSQL is used instead. The db interface is identical in both modes — no code changes needed.
An LLM backend is always required — either an external API (OpenAI, Azure, etc.) or a local model server. The system is compatible with any OpenAI-compatible API.
| Use Case | Recommended Model | Notes |
|---|---|---|
| Annotation detection | LLaVA | Must support vision/image input |
| DFM review | Any chat model | Text-only — Llama, Mistral, etc. work |
-
Install Ollama and pull a vision model:
ollama pull llava
-
Start the full stack with the local LLM profile:
docker compose --profile local-llm up
This starts Ollama alongside the app and database. GPU passthrough is configured for NVIDIA GPUs.
-
If running Ollama outside Docker, point the base URL to it in your
.env:AI_INTEGRATIONS_OPENAI_BASE_URL=http://localhost:11434/v1 AI_INTEGRATIONS_OPENAI_API_KEY=ollama
-
Start LM Studio and load a compatible model
-
Enable the local server (LM Studio exposes an OpenAI-compatible endpoint)
-
Update your
.env:AI_INTEGRATIONS_OPENAI_BASE_URL=http://localhost:1234/v1 AI_INTEGRATIONS_OPENAI_API_KEY=lm-studio
| Variable | Description | Default |
|---|---|---|
AI_INTEGRATIONS_OPENAI_API_KEY |
API key for the LLM provider | (required) |
AI_INTEGRATIONS_OPENAI_BASE_URL |
Base URL for OpenAI-compatible API | https://api.openai.com/v1 |
OPENAI_MODEL |
Vision model for annotation detection | gpt-4o |
DFM_MODEL |
Text model for DFM review | gpt-4o-mini |
DATABASE_URL |
PostgreSQL connection string (omit for SQLite) | (unset — SQLite fallback) |
| Script | Description |
|---|---|
pnpm run build |
Type-check and build all artifacts |
pnpm run typecheck |
Run TypeScript type checking across the workspace |
pnpm --filter <package> run dev |
Start a specific artifact in dev mode |
pnpm --filter @workspace/api-spec run codegen |
Regenerate API client from OpenAPI spec |
pnpm --filter @workspace/db run push |
Push database schema changes |