Getting started
lyrid is a web service: a Rust API over PostgreSQL, a React SPA, and this documentation site. At the foundation stage there is no deployment yet, so “getting started” means running the three pieces on your own machine.
What you need
Section titled “What you need”- Rust — at least the version in
rust-versioninCargo.toml.rustup update stableis enough. - Node LTS with pnpm —
corepack enableprovides pnpm. - Docker — only for the development database; nothing else runs in a container.
The database
Section titled “The database”The compose file brings up PostgreSQL alone, configured to match the example environment:
docker compose up -d dbCopy the example environment; its DATABASE_URL already points at that container:
cp .env.example .envThe API
Section titled “The API”cargo run -- serveserve is also what running the binary with no arguments does, which is what a container image or a service unit expects.
The server binds 0.0.0.0:8080 (override with LYRID_ADDR), applies any pending migrations on start, and serves /health:
curl http://127.0.0.1:8080/health{ "status": "ok", "version": "0.1.0", "database": "ok" }If the database is unreachable the same endpoint answers 503 with "status": "degraded" — the process is alive but cannot do its job, and the two cases are worth telling apart.
The universe
Section titled “The universe”An empty database is a sky with no stars. Filling it takes three imports, in this order:
cargo run -- import musicbrainz --dump ./mbdump.tar.bz2 # the starscargo run -- import listenbrainz --dump ./artist-credit-relations.tar.bz2 # the routes between themcargo run -- import discogs --masters ./discogs_masters.xml.gz \ --labels ./discogs_labels.xml.gz # what each star is made ofMusicBrainz comes first in every case: both later imports resolve against the canon it builds.
See Importing MusicBrainz, Importing similarity and Importing genres and labels. Everything else runs fine without them; there is simply nothing to look at yet.
The SPA
Section titled “The SPA”cd webpnpm installpnpm devVite serves the SPA on http://127.0.0.1:5173 and proxies /health and /api to the API, so the browser only ever talks to one origin and no CORS configuration is needed.
This site
Section titled “This site”cd docs/sitepnpm installpnpm devChecks before a commit
Section titled “Checks before a commit”The same gate CI runs:
cargo fmt --checkcargo clippy --all-targets -- -D warningscargo testcd web && pnpm lint && pnpm buildcd docs/site && pnpm build