Development Guide

March 18, 2026 · View on GitHub

Detailed development workflow for Prismer.AI contributors. For quick-start contribution guidelines, see CONTRIBUTING.md.

Prerequisites

  • Node.js 18+ (recommended: Node 20 LTS via nvm)
  • Docker (for agent container)
  • Git

Environment Setup

# 1. Clone and enter web directory
git clone https://github.com/Prismer-AI/Prismer.git
cd Prismer/web

# 2. Install dependencies
npm install

# 3. Configure environment
cp .env.docker.example .env
# Edit .env and set your OPENAI_API_KEY

# 4. Initialize database (SQLite for local dev)
npm run db:generate
npm run db:push

# 5. Start dev server
npm run dev

Open http://localhost:3000.

With Agent Container (optional)

To enable the full agent experience (LaTeX compilation, Jupyter, Prover):

# In a separate terminal
docker compose -f docker/docker-compose.dev.yml up

This starts the OpenClaw agent container on port 16888. The frontend connects to it via CONTAINER_GATEWAY_URL=http://localhost:16888 in .env.

Environment Variables

Required

VariableDescriptionDefault
OPENAI_API_KEYLLM provider API key
DATABASE_URLDatabase connection stringfile:./prisma/dev.db

Optional: LLM Configuration

VariableDescriptionDefault
OPENAI_API_BASE_URLLLM API base URLhttps://api.openai.com/v1
AGENT_DEFAULT_MODELServer-side default modelgpt-4o
NEXT_PUBLIC_OPENAI_API_KEYClient-side AI key (PDF reader)
NEXT_PUBLIC_OPENAI_API_BASE_URLClient-side API base URLhttps://api.openai.com/v1
NEXT_PUBLIC_AGENT_DEFAULT_MODELClient-side default modelgpt-4o-mini

Optional: Data Source

VariableDescriptionDefault
USE_REMOTE_PAPERSEnable remote paper databasefalse
REMOTE_MYSQL_HOSTMySQL host for paper data
REMOTE_MYSQL_PORTMySQL port3306
REMOTE_MYSQL_USERMySQL user
REMOTE_MYSQL_PASSWORDMySQL password
REMOTE_MYSQL_DATABASEMySQL database name

Optional: Storage & CDN

VariableDescriptionDefault
AWS_ACCESS_KEY_IDS3 access key
AWS_SECRET_ACCESS_KEYS3 secret key
AWS_REGIONS3 regionus-east-1
AWS_S3_BUCKETS3 bucket name
CDN_DOMAINCDN domain for paper assets

Optional: Agent Container

VariableDescriptionDefault
STATIC_AGENT_ENABLEDEnable static agent bindingtrue
STATIC_AGENT_IDAgent identifierdefault
STATIC_AGENT_CONTAINER_IDDocker container nameprismer-agent
CONTAINER_GATEWAY_URLContainer gateway URLhttp://localhost:16888

Optional: Dev

VariableDescriptionDefault
DEV_USER_EMAILDefault dev user emaildev@localhost

Available Scripts

Frontend (web/)

ScriptCommandDescription
devnext devDevelopment server with hot reload
buildprisma generate && next buildProduction build (standalone output)
startnext startProduction server
linteslintRun ESLint checks

Database (web/)

ScriptCommandDescription
db:generateprisma generateGenerate Prisma Client to src/generated/prisma/
db:pushprisma db pushPush schema changes to database
db:migrateprisma migrate devCreate and apply migration
db:studioprisma studioOpen Prisma visual database browser

Testing (web/)

ScriptCommandDescription
testvitest runRun all unit tests (single run)
test:unitvitest runAlias for test
test:watchvitestRun tests in watch mode
test:coveragevitest run --coverageRun tests with coverage report
test:e2eplaywright testRun all Playwright E2E tests
test:layer1playwright test --project=layer1E2E: container + plugin + API (real agent)
test:layer2playwright test --project=layer2E2E: mock frontend rendering + trace
test:layer3playwright test --project=layer3E2E: full end-to-end, no mocks + trace
test:reportplaywright show-report tests/output/reportsShow Playwright HTML report

Utility (web/)

ScriptCommandDescription
sync:servertsx scripts/sync-server.tsWebSocket agent sync server (port 3456)
verify:s3tsx scripts/verify-s3.tsVerify S3 connectivity
verify:allnpm run verify:s3Run all verification checks

SDK (sdk/typescript/)

ScriptCommandDescription
buildtsupBuild CJS + ESM + type declarations
devtsup ... --watchWatch mode build
testvitestRun SDK tests
linteslint src/Lint SDK source

Testing

Unit Tests (Vitest)

cd web

# Run all unit tests
npm test

# Run a specific test file
npx vitest run src/lib/sync/__tests__/SyncMatrixEngine.test.ts

# Run tests matching a pattern
npx vitest run -t "workspace"

# Watch mode
npm run test:watch

E2E Tests (Playwright)

E2E tests are organized in three layers with increasing scope:

  • Layer 1 — Container + Plugin + API: Tests with a real running agent container
  • Layer 2 — Mock frontend rendering: Tests UI rendering with mock data, captures traces
  • Layer 3 — Full E2E: Complete user flows with no mocks, captures traces
cd web

# Run all E2E tests
npm run test:e2e

# Run a single layer
npm run test:layer1

# View the HTML report
npm run test:report

Test output is written to tests/output/ (gitignored).

Docker Profiles

ProfileFileUse CaseExposed Ports
Devdocker-compose.dev.ymlAgent container only, frontend runs locally16888 (gateway)
Litedocker-compose.lite.ymlSingle container, all services16888, 18888 (Jupyter), 18080 (LaTeX)
Fulldocker-compose.openclaw.ymlFull OpenClaw setup with all services16888

Commit Convention

type(scope): description

Types: feat, fix, docs, style, refactor, test, chore

Example: feat(workspace): add agent template selection