Procedural galaxy simulation - Rust compiled to WASM, rendered in the browser. Live at https://galaxy-gen.coilysiren.me
  • TypeScript 55.7%
  • Rust 31.9%
  • Makefile 4.3%
  • JavaScript 2.8%
  • Dockerfile 2.4%
  • Other 2.9%
Find a file
example-bot ec3835a120
All checks were successful
build-publish-deploy / test (push) Successful in 18s
fix(deploy): add pod Caddy skillsmp shortcut
closes #35
2026-07-10 22:31:03 +00:00
.agents/skills chore: retire coily refs and route through ward 2026-07-09 00:23:23 +00:00
.cargo Fix wasm build by configuring getrandom 0.3 for wasm_js backend 2026-04-13 09:09:44 -07:00
.claude Merge branch 'issue-32' 2026-07-10 21:55:28 +00:00
.forgejo/workflows chore(ci): add Telegram main-failure alerts 2026-07-10 09:02:46 +00:00
.github/workflows chore(ci): add Telegram main-failure alerts 2026-07-10 09:02:46 +00:00
.vscode wasm build working 2023-11-23 22:09:16 -05:00
.ward chore: retire coily refs and route through ward 2026-07-09 00:23:23 +00:00
benches chore: clean up code-comments violations + bump agentic-os to v0.2.8 2026-05-25 20:54:38 -07:00
deploy fix(deploy): add pod Caddy skillsmp shortcut 2026-07-10 22:31:03 +00:00
docs fix(deploy): add pod Caddy skillsmp shortcut 2026-07-10 22:31:03 +00:00
e2e chore: clean up code-comments violations + bump agentic-os to v0.2.8 2026-05-25 20:54:38 -07:00
src chore: retire coily refs and route through ward 2026-07-09 00:23:23 +00:00
.agentic-os.toml chore: retire coily refs and route through ward 2026-07-09 00:23:23 +00:00
.gitignore chore: track .claude/settings.json and lockdown-deny.sh 2026-05-03 21:00:18 -07:00
.pre-commit-config.yaml chore(pre-commit): bump agentic-os pin to current suite (v0.193.0) 2026-07-04 17:51:38 +00:00
.prettierignore Add Playwright E2E pipeline, modernize tooling, restyle UI 2026-04-20 23:33:12 -07:00
.prettierrc Add Playwright E2E pipeline, modernize tooling, restyle UI 2026-04-20 23:33:12 -07:00
AGENTS.md chore: retire coily refs and route through ward 2026-07-09 00:23:23 +00:00
Cargo.lock bump rand 0.9 → 0.10 + getrandom 0.3 → 0.4 2026-04-23 03:00:26 -07:00
Cargo.toml chore: fix Cargo.toml SPDX license 2026-07-10 22:18:54 +00:00
CLAUDE.md Convert CLAUDE.md symlink to @AGENTS.md import 2026-04-23 13:35:44 -07:00
development.md workflow: match eco-spec-tracker byte-for-byte (drop custom env/steps) 2026-04-21 02:04:30 -07:00
Dockerfile feat(deploy): serve dist from stock caddy:2-alpine + mounted bundle 2026-06-05 20:16:07 -07:00
eslint.config.mjs Add Playwright E2E pipeline, modernize tooling, restyle UI 2026-04-20 23:33:12 -07:00
LICENSE Create LICENSE 2018-05-14 01:20:53 -07:00
makefile chore: retire coily refs and route through ward 2026-07-09 00:23:23 +00:00
Makefile chore: retire coily refs and route through ward 2026-07-09 00:23:23 +00:00
package-lock.json deps: drop crypto-browserify polyfill, override uuid -> 14, fixes #29 2026-04-24 18:43:42 -07:00
package.json deps: drop crypto-browserify polyfill, override uuid -> 14, fixes #29 2026-04-24 18:43:42 -07:00
playwright.config.ts chore: clean up code-comments violations + bump agentic-os to v0.2.8 2026-05-25 20:54:38 -07:00
postcss.config.js Add Playwright E2E pipeline, modernize tooling, restyle UI 2026-04-20 23:33:12 -07:00
README.md chore: retire coily refs and route through ward 2026-07-09 00:23:23 +00:00
tsconfig.json feat: WebGPU compute-shader module (webgpu.ts) 2026-04-23 03:03:57 -07:00
webpack.config.js chore: clean up code-comments violations + bump agentic-os to v0.2.8 2026-05-25 20:54:38 -07:00

galaxy-gen

{ 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.

Quick start

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.

Architecture

  • 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.tsFrontend 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 palette.
  • e2e/galaxy.spec.ts — Playwright end-to-end tests.
  • dist/ — production webpack build output (gitignored).

Tooling

  • Rust: cargo check / cargo test / cargo fmt / cargo clippy.
  • WASM: wasm-pack build compiles Rust to WebAssembly. The dev server watches pkg/**/* and hot-reloads on rebuild (via cargo watch).
  • JS: webpack 5 + babel (React + TypeScript presets). Tailwind v4 via PostCSS.
  • Lint/format: ESLint flat config (eslint.config.mjs) + Prettier.
  • Tests: Rust unit tests via cargo test; browser end-to-end via Playwright (npm run test:e2e).
  • CI: GitHub Actions runs rust, js, and e2e jobs on every push/PR to main.

Similar projects

Open-source galaxy / n-body / WASM-sim projects worth studying. Surfaced with admiration.

  • andrewdcampbell/galaxy-sim - real-time browser N-body, Three.js + WebGL, runtime controls and free-orbit camera.
  • magwo/fullofstars - the original real-time N-body galaxy toy this project's art direction takes after. Pure JS + WebGL, no build step.
  • simbleau/nbody-wasm-sim - 2D N-body, Rust + wgpu, force kernel runs as a WebGPU compute shader.
  • MichaelJCole/n-body-wasm-webvr - browser universe in WebVR, physics in a Web Worker, AssemblyScript -> WASM.
  • someguynamedmatt/gravity - compact gravity sim on the same Rust + wasm-bindgen toolchain. Bare-surface reference.
  • zotho/rust_n_body - Rust N-body with native + WASM builds from one crate. Integrator-focused.
  • aestuans/blob - Rust -> WASM showcase, 2D fluid + gravity in one sim, renders WebGL from the WASM side.
  • DrA1ex/JS_ParticleSystem - 1M particles in real time. Hierarchical spatial-tree O(N log N) + pluggable CPU/GPGPU backends + record-replay.
  • davrempe/webgl-nbody-sim - 3D N-body in vanilla WebGL, no build step.
  • holmgr/gemini - sci-fi trading-and-smuggling over a procedurally generated galaxy. Terminal UI over a Rust core.

Contributing

External contributors are welcome. The pre-commit pipeline includes the ward lockdown checks and audit trail hooks that guard this workspace. Run them before your first commit, or the hook will fail.

Deployment

Deployed to galaxy-gen.coilysiren.me. Served through a stock Caddy on k3s on kai-server. A push to main runs CI tests only. Redeploys happen through the pull-side updater, with ward exec deploy as the manual fallback. See docs/deploy.md for the current deploy paths and host prerequisites.

Commands

Dev commands are declared in .ward/ward.yaml. Run them as ward exec <verb>.

See also

Cross-reference convention from agentic-os#59.