{ rust → wasm → js } galaxy generation simulation. Gravitational physics
(Newton's law on a cell grid) computed in Rust, compiled to WebAssembly via
wasm-pack, rendered in the browser
with React + D3.
make install # cargo build + wasm-pack + npm install + playwright browsers
make dev # rust/wasm watcher + webpack-dev-server (dual auto-reload)
make test # rust unit tests + Playwright E2E
See the makefile for the full set of targets and AGENTS.md for the conventions.
src/rust/galaxy.rs — core simulation (Galaxy + Cell structs, cell
types Gas / Star / Planet / White Hole, gravity, seeding, tick). Unit
tests live in mod tests_* blocks at the bottom of the file.src/rust/lib.rs — crate root; re-exports galaxy.pkg/ — wasm-pack output: .wasm + .js + .d.ts. Gitignored; linked
into node_modules/galaxy_gen_backend by npm install ./pkg.src/js/lib/galaxy.ts — Frontend class; the JS ↔ WASM boundary.src/js/lib/application.tsx — React UI (inputs, buttons, data-testids).src/js/lib/dataviz.tsx — D3 scatter plot into #dataviz.src/js/lib/styles.css — Tailwind v4 + custom coilysiren palette.e2e/galaxy.spec.ts — Playwright end-to-end tests.dist/ — production webpack build output (gitignored).cargo check / cargo test / cargo fmt / cargo clippy.wasm-pack build compiles Rust to WebAssembly. The dev server
watches pkg/**/* and hot-reloads on rebuild (via cargo watch).eslint.config.mjs) + Prettier.cargo test; browser end-to-end via
Playwright (npm run test:e2e).rust, js, and e2e jobs on every push/PR
to main.Open-source galaxy / n-body / WASM-sim projects worth studying. Surfaced with admiration.
External contributors are welcome. One non-obvious prerequisite: the pre-commit pipeline includes a coily-trailer hook that calls coily, a CLI used to audit and trail commits across this workspace. Install it before your first commit, or the hook will fail.
Deployed to galaxy-gen.coilysiren.me.
Served through Caddy on k3s on kai-server. Redeploys are pull-side
from kai-server, not pushed from CI.
Dev commands are declared in .coily/coily.yaml. Run them as coily exec <verb>.
Cross-reference convention from coilysiren/agentic-os#59.
$ claude mcp add galaxy-gen \
-- python -m otcore.mcp_server <graph>