.io Game
TODO
Tech Stack
Backend
- Backend written in Elixir
- Phoenix
- Phoenix Channels for communication between the frontend + backend
Messaging + Serialization
- WebSocket-based communication between the backend and the frontend using Phoenix channels
- Binary message serialization using Protcol Buffers.
- All messages are tagged with a UUID that corresponds to some entity.
- The "universe" can be an entity for general messages as well (UUID 0000-0000...?)
Frontend
- Built with Rust and compiled into WebAssembly
- Uses the Phoenix channels JS client library as a wrapper to connect to the backend and relay data to the WebAssembly code that powers the game.
Installation
Backend
- Install Elixir with
brew install elixir - Install all deps within
backendwithmix deps.get - Compile and start server with
mix phx.server
Frontend
- You'll need to install Rust in order to build the frontend. I suggest using Rustup.
- Run
rustup toolchain install nightlyto install the nightly toolchain - Run
rustup default nightlyto make the nightly toolchain default. - Run
rustup target add wasm32-unknown-unknown --toolchain nightlyto add the WebAssembly target. - Run
cargo install wasm-bindgen-clito install thewasm-bindgen-cliwhich is used to generate JS wrapper code and TypeScript definitions from WebAssembly files.