How teceer/pipsim works
Pipsim is a polyglot, event-driven world simulation. The main user workflow is browser join and live-world viewing: the gateway obtains authoritative world state from sim-core, while the browser renders updates and can predict locally with the shared Rust/WASM simulation. Separately, the gateway discovers workplaces and drives hiring and work; the bank books money movements. Broadcast is documented as a fan-out tier, but the README says it is not yet real, so its links reflect only the sampled stream and PubSub behavior. Several peripheral services are contracts or skeletons; uncertain wiring is omitted.
Main entry points: gateway.go World gateway · main.ts Browser client · driver.go Economy driver · bankapi.go Bank API
Components 19
Client and fan-out
- Browser client
web/src/main.ts - WASM predictor
services/sim-core/crates/wasm/src/lib.rs - Broadcast service
services/broadcast/lib/broadcast/application.ex - Stream fan-out
services/broadcast/lib/broadcast/gateway_client.ex - World channels
services/broadcast/lib/broadcast/world_channel.ex - BFF and jobs
services/bff/src/index.ts
Simulation runtime
- World gateway
services/world-gateway/internal/gateway/gateway.go - Simulation server
services/sim-core/crates/server/src/main.rs - Deterministic core
services/sim-core/crates/sim/src/lib.rs
Work and economy
- Bank API
services/bank/internal/bankapi/bankapi.go - Ledger store
services/bank/internal/ledger/postgres.go - Economy driver
services/world-gateway/internal/economy/driver.go - Farm workplace
services/workplaces/farm/internal/farm/farm.go - Tavern workplace
services/workplaces/tavern/lib/tavern/workplace.ex - Workshop workplace
services/workplaces/workshop
Service contracts
- Protobuf contracts
proto/pips/world/v1/world.proto
Other components
- Player
- Kafka fact log
- RabbitMQ offers
Connections 21
- Player → Browser client: uses
- Browser client → World gateway: joins and streams
- Browser client → WASM predictor: predicts locally
- World gateway → Simulation server: requests world state
- Simulation server → Deterministic core: steps world
- Simulation server → Kafka fact log: publishes facts
- World gateway → Economy driver: drives economy
- Economy driver → Farm workplace: calls workplace
- Economy driver → Tavern workplace: calls workplace
- Economy driver → RabbitMQ offers: publishes offers
- RabbitMQ offers → Farm workplace: delivers offers
- RabbitMQ offers → Tavern workplace: delivers offers
- World gateway → Bank API: calls bank
- Bank API → Ledger store: reads and writes
- Bank API → Kafka fact log: publishes money facts
- Kafka fact log → Bank API: delivers lifecycle and purchases
- Broadcast service → Stream fan-out: starts client
- Stream fan-out → World gateway: streams world
- Stream fan-out → World channels: publishes deltas
- Browser client → World channels: subscribes
- BFF and jobs → RabbitMQ offers: schedules jobs