# Python backend
uv sync --all-extras
# Frontend
cd frontend && npm installAll must pass before committing:
uv run pytest # Tests
uv run ruff check src/ tests/ # Linting
uv run ruff format src/ tests/ # Formatting
uv run mypy src/ # Type checking (strict)cd frontend && npx vite buildOutput lands in src/tessera/static/dist/ (hashed filenames with [\w-]+ pattern). The backend's _build_asset_map() auto-discovers bundles at runtime with a 5-minute TTL cache.
# Backend (with hot reload)
uv run uvicorn tessera.app:create_app --factory --reload --port 8780
# Frontend dev server (separate terminal)
cd frontend && npm run devNote: requires access to Technitium instances (or mock them in tests).
Tests use FastAPI's TestClient with DI overrides. Engines are mocked via conftest.py fixtures.
# Run specific test file
uv run pytest tests/test_failover.py -v
# With coverage
uv run pytest --cov=tessera --cov-report=term-missing- Read operations: Use
request()— no auth required - Write operations: Use
adminRequest()— sendsAuthorization: Bearer <token> - Backend:
require_admindependency on write endpoints checksTESSERA_ADMIN_API_KEY
Each page is a standalone Preact island — one entry point in vite.config.ts, one render() call per page. No client-side routing.
- Signals for global state (toasts, modals, ping, auth token)
poll()helper withconsecutiveErrors+lastUpdatedtrackingshowConfirm()for destructive actionsisAuthCancelled()guard in all catch blocks to suppress toast on auth cancel
set -euo pipefail— strict error handling|| trueon grep patterns that may not match (preventsset -eexit)- Dual health checks: HTTP primary, DHCP secondary (nmap optional)
DHCP_TIMEOUTseparate fromCHECK_TIMEOUTfor independent tuning
- Engines: subclass
Engine, declaredepends_on, register indeps.py - API routes: under
src/tessera/api/v1/, Pydantic schemas inschemas.py - Frontend pages: one Preact island per route in
frontend/src/pages/ - Signals: use
@preact/signalsfor global state, not component state - Types: strict typing everywhere — mypy must pass with zero errors
- Errors:
ValidationErrorfor 400s,AppErrorhierarchy for domain errors