Skip to content

Navigation Menu

Sign in
Sign up

Repository files navigation

dioxus-apps

AGPL-3.0 license Tests clippy: 0 warnings WASM cargo deny machete

A Cargo workspace for reproducible Dioxus web apps, pinned by rust-toolchain.toml.

  • index is the accessible landing page. json-count-rs counts non-null fields in uploaded JSON files.
  • lotus-explore-rs explores the LOTUS compounds knowledge graph from Wikidata via SPARQL.
  • lotus-api provides a native HTTP API for advanced search and export.
  • mgf-precursor-erro-rs analyzes uploaded MGF files and reports precursor mass errors in Da and ppm.
  • lipid-selecto-rs classifies and filters lipid mass-spec data using LIPID MAPS-aligned SMARTS rules.
  • cxsmiles-yoga generates CX-SMILES from lists of related structures by collapsing positional isomers (m: blocks) and variable-length repeats (Sg:n: blocks).
  • smellfish-rs scores natural-product-like structures with literature-backed features and RDKit.js chemistry descriptors.

Prerequisites

rustup toolchain install 1.97 --profile minimal
rustup target add wasm32-unknown-unknown
cargo install dioxus-cli --version 0.7.10 --locked

The repo pins Rust 1.97, clippy, rustfmt, and wasm32-unknown-unknown in rust-toolchain.toml.

Structure

dioxus-apps/
├── Cargo.toml ← workspace root
├── rust-toolchain.toml ← pinned compiler, components, target
├── prek.toml ← repo hooks and quality gate
├── .github/ ← CI, deploy, governance
├── apps/
│ ├── index/ ← accessible landing page (WASM)
│ ├── json-count-rs/ ← upload a JSON file and count non-null values (WASM)
│ ├── lipid-selecto-rs/ ← lipid classification and filtering via SMARTS (WASM)
│ ├── mgf-precursor-erro-rs/← MGF precursor mass-error analysis (WASM + lib)
│ ├── lotus-api/ ← OpenAPI service for LOTUS search and exports (native)
│ ├── lotus-explore-rs/ ← LOTUS Wikidata natural-product explorer (WASM)
│ ├── smellfish-rs/ ← NP-likeness scoring, RDKit.js integration (WASM + lib)
│ └── cxsmiles-yoga/ ← CX-SMILES generation from related structures (WASM + lib)
└── crates/
 ├── lotus/ ← SPARQL client, LOTUS models, transport, export
 ├── upload/ ← shared file-upload, progress, and blob utilities
 └── ui/ ← shared accessibility-focused UI helpers (DocumentHead, etc.)

Apps marked (WASM + lib) have a lib.rs alongside main.rs to enable cargo test --lib. Apps without extensive unit tests use main.rs only.

Running apps locally

dx serve --package lotus-explore-rs
dx serve --package cxsmiles-yoga
cargo run --locked -p lotus-api
dx serve --package json-count-rs
dx serve --package index
dx serve --package lipid-selecto-rs
dx serve --package mgf-precursor-erro-rs
dx serve --package smellfish-rs

Building for production

dx build --release --package lotus-explore-rs
dx build --release --package cxsmiles-yoga
dx build --release --package json-count-rs
dx build --release --package index
dx build --release --package lipid-selecto-rs
dx build --release --package mgf-precursor-erro-rs
dx build --release --package smellfish-rs

Output lands under target/dx/<package>/release/web/public/.

Quality gate and local checks

Install the repo hooks once:

cargo install prek --locked
prek install

Run the repo quality gate manually:

prek run cargo-qa

The cargo-qa hook chain runs the following checks (matching CI):

prek run cargo-fmt-check # rustfmt --all -- --check
prek run cargo-check # cargo check --workspace --all-targets --locked
prek run cargo-clippy # cargo clippy --workspace --all-targets --locked -- -D warnings
prek run cargo-test # cargo test --workspace --all-targets --locked --quiet
prek run cargo-check-wasm-all # cargo check for all 5 WASM apps
prek run cargo-doc # cargo doc --workspace --no-deps --locked
prek run cargo-machete # cargo machete check --workspace
prek run cargo-audit # cargo audit
prek run cargo-deny # cargo deny check advisories bans licenses sources
prek run cargo-readme-panache # cargo-readme sync + panache lint

Adding a new app

  1. Copy an existing app directory (e.g. apps/index) as a starting point.
  2. Edit Cargo.toml and Dioxus.toml to set name and title.
  3. Add "apps/my-new-app" to members in the workspace Cargo.toml.
  4. Add a cargo check line to the wasm job and a dx build line to the wasm-build job in .github/workflows/ci.yml.
  5. dx serve --package my-new-app

Continuous integration

On every push to main:

  • cargo fmt --all -- --check
  • cargo check --workspace --all-targets --locked
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo test --workspace --all-targets --locked
  • cargo check for all 7 WASM apps (cxsmiles-yoga, index, json-count-rs, lipid-selecto-rs, lotus-explore-rs, mgf-precursor-erro-rs, smellfish-rs)
  • cargo doc --workspace --no-deps --locked
  • cargo machete check --workspace
  • cargo audit
  • cargo deny check advisories bans licenses sources
  • WASM build and deploy artifact for all 7 WASM apps (with Ketcher fetch for lotus-explore-rs)

MCP

A project-level MCP config lives at .mcp/mcp.json --- the canonical mcpServers convention (read by Claude Code / Cline). It registers a read-only filesystem MCP server exposing the AI collaboration guides (.github/ai/) and the lotus-explore architecture docs (apps/lotus-explore-rs/docs/) as MCP resources, so agent tooling can read them through the Model Context Protocol. In-page web agents instead use the page's JSON-LD / llms.txt / .well-known/ discovery.

Governance

About

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /