Queries go through the query handler to the database (SQLite by default, or Postgres). Writes go through the procedure handler to the user's PDS, then HappyView indexes the record locally. Real-time record events stream in via Jetstream; historical records are backfilled in-process by discovering repos via the relay's listReposByCollection and fetching records directly from each PDS. Labelers are external services that emit content labels over a direct WebSocket connection — they operate out-of-band, outside the relay/repo system.
# Unit tests (no database needed)cargo test --lib# All tests including end-to-end (SQLite by default)cargo test# Or run against Postgresdocker compose -f docker-compose.test.yml up -dTEST_DATABASE_URL=postgres://happyview:happyview@localhost:5433/happyview_test cargo testdocker compose -f docker-compose.test.yml down
End-to-end tests use wiremock to mock external services (PLC directory, PDSes) and a real database for full integration coverage. By default tests use SQLite; set TEST_DATABASE_URL to a Postgres connection string to test against Postgres.