EV-invest's shared libraries — a polyglot monorepo. Each library is opt-in, so a
consumer pulls in only what it asks for: a Cargo feature on the Rust side, a
package under ts/ on the TypeScript side.
| Path | What | Stack |
|---|---|---|
rust/ |
the crate — one library per Cargo feature | Rust |
ts/ |
TypeScript packages — one directory per library | TypeScript |
Each language lives in its own top-level directory so neither toolchain trips
over the other. A thin root Cargo.toml workspace anchors the crate (whose
sources live in rust/) at the repo root, where the shared CI and tooling run; a
consumer's git dependency still resolves the package by name. See
ARCHITECTURE.md.
Each library is a module behind a Cargo feature, so a consumer compiles only what it enables.
| Feature | What it is |
|---|---|
architecture |
I/O-free, wasm32-safe DDD tactical kernel: typed ids, entities, aggregate roots, repositories, gateways, the unit of work, domain events, specifications |
uikit |
dep-light Dioxus UI kit (mirrors @evinvest/uikit): 63 shadcn-semantics components on dioxus + tailwind_fuse, no @radix-ui/cva. Ships the shared design tokens (tokens.css) |
analytics |
PostHog product analytics (mirrors @evinvest/analytics): does network I/O, gated per-target — reqwest + serde/serde_json native, pure-Rust HTTP on wasm |
error_monitoring |
Sentry error monitoring (mirrors @evinvest/error-monitoring): does network I/O; the native sentry crate is native-only, wasm reports over pure-Rust HTTP |
experiments |
frontend-only A/B testing (mirrors @evinvest/experiments): reports exposure through an injected sink, never imports analytics |
wasm |
opt-in switch layering browser/js backends onto whatever features are enabled |
ev_lib = { git = "https://github.com/EV-invest/lib.git", default-features = false, features = ["architecture"] }For a target that also builds to wasm, enable wasm per-target so native
builds never link browser backends:
[target.'cfg(target_arch = "wasm32")'.dependencies]
ev_lib = { git = "https://github.com/EV-invest/lib.git", default-features = false, features = ["architecture", "wasm"] }cargo runs from the repo root (the workspace anchors the crate in rust/); pass
-p ev_lib because feature flags aren't allowed at a virtual-workspace root:
cargo test -p ev_lib --features architecture
cargo clippy -p ev_lib --features architecture --all-targets -- -D warnings
cargo check -p ev_lib --features "architecture wasm" --target wasm32-unknown-unknownTS packages live under ts/, one directory per library, each with its own
package.json: ts/architecture/ (the DDD kernel),
ts/uikit/ (the dep-light React UI kit mirroring the Rust uikit),
ts/analytics/ (PostHog), ts/error-monitoring/
(Sentry), and ts/experiments/ (A/B testing).
direnv allow (or nix develop) drops you into the flake shell: the Rust
(nightly) + Node toolchains, formatters, and pre-commit hooks. The .gitignore,
rustfmt.toml, CI workflows, and this README are generated on entry — don't
hand-edit generated files.
This repository follows my best practices and Tiger Style (except "proper capitalization for acronyms": (VsrState, not VSRState) and formatting). For project's architecture, see ARCHITECTURE.md. Licensed under Blue Oak 1.0.0
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.