Skip to content

Development Setup

Prerequisites

Clone and Install

bash
git clone https://github.com/ottercoders/klaxon.git
cd klaxon
pnpm install

Start Infrastructure

bash
docker compose up -d

This starts PostgreSQL (port 5432) and Redis (port 6379).

Run the Server

bash
cargo run

The server starts on http://localhost:3000, connects to Postgres, and applies migrations automatically.

Run the Web App

bash
pnpm --filter @klaxon/web dev

Opens at http://localhost:5173.

Run the Desktop App

bash
pnpm --filter @klaxon/ui dev

Opens at http://localhost:1420.

Run the Mobile App

bash
cd apps/klaxon-mobile
npx expo start

Run 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.tsx

Lint & Format

bash
pnpm lint          # ESLint
pnpm format:check  # Prettier
pnpm lint:rust     # Clippy
pnpm format:rust:check  # rustfmt

# Full CI check
pnpm ci

Useful 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 .