Nexis is an open-source, engine-agnostic multiplayer backend platform with:
- a Rust data plane for realtime gameplay traffic
- a Bun + Elysia control plane for project/key/token management
- Drizzle-managed Postgres schema migrations for control-plane persistence
Gameplay traffic goes directly to the data plane (ws://...) and never through the control plane.
v0.1.0 release-ready MVP / Beta.
Current stack is production-minded and intentionally minimal.
- WebSocket transport with codec negotiation (
msgpackpreferred,jsonfallback) - HMAC auth with project/key token flow and configurable auth mode (
required/optional/disabled) - Room engine (
echo_room) + plugin rooms (counter_plugin_roomdemo) - Room plugin system (
RoomPlugintrait /register_room_plugin) for custom room types - Runtime-loaded WASM room plugins (
NEXIS_WASM_ROOM_PLUGINS) for no-rebuild room logic - RPC request/response correlation via
rid - Deterministic state diff/patch (
set/del) - Sequenced + checksummed state sync (
state.snapshot,state.patch,state.ack,state.resync) - Session resume with TTL
- Room discovery (
room.list) - Basic matchmaking queue (
matchmaking.enqueue,matchmaking.dequeue,match.found) - Logical reliable/unreliable channels over WebSocket
- Control-plane key revoke/rotate enforcement in data-plane handshake
- Basic observability endpoint (
GET /metrics)
nexis/
server/ # Rust data plane workspace
sdks/ts/ # TypeScript SDK
dashboard/control-api/ # Bun + Elysia + Postgres API
dashboard/ui/ # Dashboard UI
examples/web-demo/ # Counter room demo app
infra/ # Docker Compose + smoke checks
docs-site/ # Fumadocs documentation site
From repo root (dev local build):
docker compose -f docker-compose.yml -f docker-compose.dev.yml up --buildOr deploy with prebuilt GHCR images (no local build):
cp .env.example .env
docker compose up -dSet NEXIS_IMAGE_TAG=next in .env for preview builds.
Services:
- Postgres:
localhost:5432 - Control API:
http://localhost:3000 - Dashboard UI:
http://localhost:5173 - Data plane (WS):
ws://localhost:4000 - Data plane metrics:
http://localhost:9100/metrics - Web demo:
http://localhost:8080
Optional room plugin config (no code changes) for template-state custom room types:
NEXIS_ROOM_TYPE_PLUGINS='{"duel_room":{"hp":100},"lobby_room":{"players":[]}}'Optional WASM room logic plugins (no server rebuild required):
NEXIS_WASM_ROOM_PLUGINS='{"duel_room":"/app/plugins/duel_room.wasm"}'Then:
- Create project (or use seeded
demo-project) - Create key
- Mint token (unless running anonymous mode)
- Open web demo
- Connect + join
counter_plugin_room
Detailed step-by-step: https://triformine.github.io/nexis/docs/getting-started/quickstart/
Rust tests:
cd server
cargo testTS SDK tests:
cd sdks/ts
bun test
bunx tsc -p tsconfig.json --noEmitControl API tests:
cd dashboard/control-api
bun test
bunx tsc --noEmitDocs site (Fumadocs, Node 20+ recommended):
cd docs-site
bun install
bun run devEnd-to-end smoke:
bun infra/smoke.tsPerformance baseline:
k6 run infra/load/k6-ws.js- Protocol: https://triformine.github.io/nexis/docs/api-reference/protocol/
- Quickstart: https://triformine.github.io/nexis/docs/getting-started/quickstart/
- SDK TypeScript: https://triformine.github.io/nexis/docs/sdks/typescript/
- Infrastructure: https://triformine.github.io/nexis/docs/infrastructure/
- Room Plugins: https://triformine.github.io/nexis/docs/guides/plugins/
- GitHub Pages docs: https://triformine.github.io/nexis/
- Changelog: CHANGELOG.md
- Releasing process: RELEASING.md
- Contributing guide: CONTRIBUTING.md
- Security policy: SECURITY.md
Apache-2.0.