Development Setup
Prerequisites
- Node.js 22+ (for TypeScript packages)
- pnpm 9+ (
npm i -g pnpm) - Rust 1.82+ (for the server)
- Docker (for PostgreSQL + Redis)
Clone and Install
bash
git clone https://github.com/ottercoders/klaxon.git
cd klaxon
pnpm installStart Infrastructure
bash
docker compose up -dThis starts PostgreSQL (port 5432) and Redis (port 6379).
Run the Server
bash
cargo runThe server starts on http://localhost:3000, connects to Postgres, and applies migrations automatically.
Run the Web App
bash
pnpm --filter @klaxon/web devOpens at http://localhost:5173.
Run the Desktop App
bash
pnpm --filter @klaxon/ui devOpens at http://localhost:1420.
Run the Mobile App
bash
cd apps/klaxon-mobile
npx expo startRun Tests
bash
# All tests
pnpm test
# TypeScript only (protocol + common)
pnpm test:ts
# Rust only (requires DATABASE_URL)
pnpm test:rust
# Single package
pnpm --filter @ottercoders/klaxon-common test
pnpm --filter @ottercoders/klaxon-protocol test
# Single test file
pnpm --filter @ottercoders/klaxon-common exec vitest run src/__tests__/MainWidget.test.tsxLint & Format
bash
pnpm lint # ESLint
pnpm format:check # Prettier
pnpm lint:rust # Clippy
pnpm format:rust:check # rustfmt
# Full CI check
pnpm ciUseful Commands
bash
# Typecheck all packages
pnpm -r typecheck
# Cargo check (faster than full build)
cargo check
# Run server in worker mode
cargo run -- --worker
# Build Docker image
docker build -f crates/klaxon-server/Dockerfile -t klaxon-server .