- Solidity contracts:
src/, tests intest/with fixtures intest-resources/. - Rust workspace:
crates/*(e.g.,cli,common,bindings,js_api,quote,subgraph,settings,math,integration_tests). - JavaScript/Svelte:
packages/*—webapp,ui-components,orderbook(wasm wrapper published to npm). - Subgraph and tooling:
subgraph/,script/, helper scripts likeprep-all.sh.
- Bootstrap:
./prep-all.sh(installs deps and builds workspaces). - Rust:
cargo build --workspace; tests:cargo test. - Solidity (Foundry):
forge build; tests:forge test. - Webapp:
cd packages/webapp && npm run dev. - JS workspaces (top-level):
npm run test,npm run build:ui,npm run build:orderbook. - WASM bundle:
rainix-wasm-artifacts.
- Rust: format with
cargo fmt --all; lint withrainix-rs-static(preconfigured flags included). Crates/modules usesnake_case; typesPascalCase. - TS/Svelte:
npm run format,npm run lint,npm run checkin each package. ComponentsPascalCase.svelte; files otherwise kebab/snake as appropriate. - Solidity:
forge fmt; compilersolc 0.8.25(seefoundry.toml).
- Rust:
cargo test; integration tests live incrates/integration_tests. Preferinstasnapshots andproptestwhere helpful. - TS/Svelte:
npm run test(Vitest). Name files*.test.ts/*.spec.ts. - Solidity:
forge test(add fuzz/property tests where relevant).
- PRs must: describe scope/approach, link issues, include screenshots/GIFs for UI changes, update/ add tests, and pass CI.
- Quick preflight:
npm run lint-format-check:all && rainix-rs-static.
- Never commit secrets. Copy
.env.examplefiles (root,packages/webapp) and populatePUBLIC_WALLETCONNECT_PROJECT_IDas required.
- Prefer syntax-aware search with ast-grep: Rust
sg --lang rust -p '<pattern>'; TSsg --lang ts -p '<pattern>'. - Architecture context: when working in any directory, check for an
ARCHITECTURE.mdfile in the current working directory and read it first to understand local architecture before making changes.