Building

Musium is written in Rust and Purescript, so you need to have the build tools for these available. An easy way to get them is through the Nix package manager (version ≥2.10 for flake support). The following command enters a shell in which all of the required build tools are available:

nix develop --command $SHELL

This environment is also tested on CI. Nix is a convenience, not a requirement. You are free to source the build tools elsewhere, for example from your system package repositories.

The webinterface is written in Purescript. There is a basic makefile that calls purs and spago, which in turn needs esbuild:

make -C app
stat app/output/app.js

The server will serve app.js and other static files alongside the API. The server itself is written in Rust and builds with Cargo:

cargo build --release

The binary can then be found in target/release/musium.

The Rust code for database interactions is generated by Squiller from SQL files in src. The generated code is included in the repository so no additional step is needed for normal builds, but if you change the queries, regenerate the code:

make -C src