https://github.com/mist941/b3s23-engine
Conway's Game of Life (B3/S23) simulation engine in Go with a WebSocket streaming API and web UI
https://github.com/mist941/b3s23-engine
cellular-automata conways-game-of-life docker game-of-life golang simulation typescript
Last synced: about 10 hours ago
JSON representation
Conway's Game of Life (B3/S23) simulation engine in Go with a WebSocket streaming API and web UI
- Host: GitHub
- URL: https://github.com/mist941/b3s23-engine
- Owner: mist941
- License: mit
- Created: 2026-06-10T14:51:53.000Z (19 days ago)
- Default Branch: main
- Last Pushed: 2026-06-11T08:56:10.000Z (18 days ago)
- Last Synced: 2026-06-11T10:11:10.044Z (18 days ago)
- Topics: cellular-automata, conways-game-of-life, docker, game-of-life, golang, simulation, typescript
- Language: Go
- Homepage:
- Size: 119 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# b3s23-engine
[](https://github.com/mist941/b3s23-engine/actions/workflows/ci.yml)
[](https://hub.docker.com/r/mist941/b3s23-engine)
[](https://hub.docker.com/r/mist941/b3s23-engine/tags)
[](https://hub.docker.com/r/mist941/b3s23-engine/tags)
[](https://github.com/mist941/b3s23-engine/blob/main/LICENSE)
Conway's Game of Life (B3/S23) as a self-contained service: a Go simulation
core with a REST + WebSocket streaming API and a React/WebGL2 UI — all shipped
in a single small distroless container. State lives in SQLite, so the world
survives restarts.
## Demo

## Features
- **Interactive editing** — draw cells with the mouse (paint, erase, toggle)
or stamp classic patterns (glider, LWSS, R-pentomino, acorn, diehard,
pulsar, pentadecathlon, Gosper glider gun) with a live ghost preview.
- **WebGL2 renderer** — bit-packed frames are unpacked on the GPU; smooth pan
and zoom even on large grids.
- **REST + WebSocket API** — full control surface (play/pause/step, reseed,
resize, tick rate, cell editing) plus binary frame streaming with
per-client backpressure.
- **Persistent** — the grid is snapshotted to SQLite and restored on restart.
- **Compact engine** — bit-packed toroidal grid (1 bit per cell) up to
16384×16384, stepped in parallel across CPU cores.
- **Easy to run** — one small distroless Docker image (amd64 + arm64), no
configuration required, health check included.
## Run
### Docker
```sh
docker run -d --name b3s23 -p 8050:8050 -v b3s23_data:/data mist941/b3s23-engine:latest
```
Open — the UI and the API are served from the same
port. The `/data` volume holds the SQLite database (plus its WAL sidecars), so
the simulation survives container restarts.
### Docker Compose
Clone the repo, then:
```sh
docker compose up -d # pulls the published image
docker compose up -d --build # or build it from source
```
### From source
Engine (Go ≥ 1.26, no CGO):
```sh
cd engine
go run ./cmd/engined # API on :8050
go test ./... # -race needs gcc; CI runs it on Linux
```
UI dev server (Node ≥ 24) with hot reload, proxying `/api` to the engine:
```sh
cd ui
npm install
npm run dev
```
Or serve the built UI straight from the engine binary:
```sh
cd ui && npm install && npm run build
cd ../engine && go run ./cmd/engined -static ../ui/dist
```
Run `engined -help` for all flags (grid size, tick rate, DB path, CORS, …).
## License
[MIT](https://github.com/mist941/b3s23-engine/blob/main/LICENSE)