Skip to content

zeachco/cells-ai

Repository files navigation

Cells

Build and Deploy

Live Demo: https://zeachco.github.io/cells-ai/

A Rust-based cellular simulation that compiles to WebAssembly and runs in the browser.

Project Structure

This is a Rust project built with macroquad that compiles to WebAssembly for web deployment. While the core logic is written in Rust, the project uses npm scripts for convenient web development workflow.

Prerequisites

Setting up Rust for WebAssembly

# Add the WebAssembly target
rustup target add wasm32-unknown-unknown

# Install cargo-watch for development (optional)
cargo install cargo-watch

Getting Started

Installation

npm install

Development

Start the development server with hot-reloading:

npm run dev

This runs both:

  • A Rust watcher that rebuilds the WebAssembly on code changes
  • A Vite dev server at http://localhost:5173

Building for Production

npm run build

This compiles the Rust code to optimized WebAssembly and bundles everything with Vite.

Preview Production Build

npm run preview

Available Scripts

Command Description
npm run dev Start development server with hot-reloading
npm run build Build optimized production bundle
npm run build:wasm Compile Rust to WebAssembly (release mode)
npm run watch:wasm Watch Rust files and rebuild on changes
npm run preview Preview the production build locally

Rust Development

While npm provides convenient scripts, you can also use standard Rust/Cargo commands:

# Build for native (desktop)
cargo build

# Run natively
cargo run

# Build for WebAssembly
cargo build --release --target wasm32-unknown-unknown

Repository

github.com/zeachco/cells-ai

About

An experiments testing generational mutations and neural network. A rust survival simulation for cells

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors