A Cargo workspace hosting multi-app web experiences compiled to WASM. lotus-explorer explores the LOTUS natural products knowledge graph from Wikidata via SPARQL. lotus-api provides a native HTTP API for advanced search and export.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add wasm32-unknown-unknown
cargo install dioxus-cli --version 0.7.9 --lockeddx serve --package lotus-explorerTo also run the optional API:
cargo run -p lotus-apiThen open http://localhost:8080/?api_base=http://127.0.0.1:8787.
Without lotus-api, the explorer falls back to direct QLever/SPARQL queries.
dioxus-apps/
├── Cargo.toml ← workspace root
├── Makefile ← convenience targets
├── .github/ ← CI, deploy, governance
├── crates/
│ └── shared/ ← SPARQL client, LOTUS models
└── apps/
├── lotus-api/ ← OpenAPI service for LOTUS search and exports
├── lotus-explorer/ ← LOTUS Wikidata natural-product explorer
└── hello-world/ ← minimal template for new apps
dx serve --package lotus-explorer
cargo run -p lotus-apiThe API binds to 127.0.0.1:8787. Override with HOST and PORT env vars.
Open http://127.0.0.1:8787/docs for the Swagger UI.
| Scenario | api_base source |
API used |
|---|---|---|
| Codeberg Pages (public) | none | ✗ direct SPARQL |
| Local dev | auto-detected http://127.0.0.1:8787 |
✓ if server running |
| Build-time | LOTUS_API_BASE env var |
✓ |
| Runtime override | ?api_base=… query param |
✓ |
GET /healthGET /metricsPOST /v1/searchPOST /v1/export-urlGET /v1/export-file/{cache_key}/{format}GET /openapi.jsonGET /docs
make build APP=lotus-explorerOutput: target/dx/lotus-explorer/release/web/public/
Quality gate:
make qa
make supply-chainThe CI pipeline builds and pushes a container image on every push to main:
| Forge | Image |
|---|---|
| Codeberg | codeberg.org/adafede/lotus-api:latest |
| GitHub | ghcr.io/adafede/lotus-api:latest |
Self-host:
docker run -d --restart unless-stopped \
-e APP_ENV=production \
-e CORS_ALLOWED_ORIGINS=https://your-origin.example.org \
-p 8787:8787 \
codeberg.org/adafede/lotus-api:latestBuild-time WASM wiring:
LOTUS_API_BASE=https://your-server.example.org \
dx build --release --platform web -p lotus-explorercp -r apps/hello-world apps/my-new-app- Edit
apps/my-new-app/Cargo.toml--- changename - Edit
apps/my-new-app/Dioxus.toml--- changenameandtitle - Add
"apps/my-new-app"tomembersinCargo.toml dx serve --package my-new-app
lotus-explorer supports URL-driven execution and exports:
?execute=true--- run query on load?download=true&format=csv--- download CSV?download=true&format=json--- download SPARQL Results JSON?download=true&format=rdf--- download RDF (Turtle)
When both download and execute are present, download takes priority.
On every push to main:
cargo check --workspace --all-targetscargo test --workspace --all-targetscargo check -p lotus-explorer --target wasm32-unknown-unknowncargo clippy --workspace --all-targets -- -D warningscargo doc --workspace --no-depscargo deny check advisories bans licenses sourcescargo audit- Docker image build and push for
lotus-api
- Contributing:
.github/CONTRIBUTING.md - AI contributions:
.github/CONTRIBUTING_AI.md - Security:
.github/SECURITY.md - Release process:
.github/RELEASE_CHECKLIST.md - Change history:
CHANGELOG.md - License:
LICENSE(GNU AGPL v3.0)
A frozen version is archived on Zenodo: https://doi.org/10.5281/zenodo.5794106