- notecrumbs is a Nostr OpenGraph renderer built on
nostrdb,egui, andskia. - The HTTP server lives in
src/main.rs; rendering logic is split acrosssrc/render.rsandsrc/html.rs. - Static assets (fonts, default profile picture) are loaded from the repo root, so run binaries from this directory.
- Requires a Rust toolchain with Skia prerequisites installed (
clang,cmake, Python, build essentials). nostrdbstores data in the current working directory viaNdb::new(".", …).TIMEOUT_MSenvironment variable tunes remote fetch waits (default 2000 ms).
- Build:
cargo build --release(first run is slow while Skia compiles). - Tests:
cargo test(currently empty but should stay green). - Formatting:
cargo fmt; lint:cargo clippy -- -D warnings.
- Use
tracingmacros for logging. - HTML/attribute-escape user content before injecting into responses (
html.rshas helpers). - Rendering paths should avoid blocking the async runtime; reuse cached textures.
RenderData::completepairs nostrdb subscriptions with network fetches—keep it resilient to partially missing data.
- Add unit tests around pure helpers (e.g.,
abbrev.rs) when modifying them. - For nostrdb-heavy flows, prefer integration tests or mocked paths gated for CI.
- Manually spot-check PNG (
/<bech32>.png) and HTML (/<bech32>) outputs when touching rendering code.
- Consult
TODOfor active work (local relay model, formatting for unparsed notes). - README “Status” checklist highlights upcoming features like profile picture rendering/caching.
cargo fmt --checkcargo clippy -- -D warningscargo test- Optional: manual PNG/HTML smoke tests against representative notes/profiles.
- Make every commit logically distinct.
- Ensure each commit is standalone so it can be dropped later without breaking the build.
- Keep code readable and reviewable by humans—favor clarity over cleverness.