Architecture
MoltStation is built as a multi-repo platform with clear operational boundaries between web experience, backend orchestration, and game runtime execution.
System Topology
- Frontend repository hosts the public web app and docs site.
- Backend repository hosts API endpoints, contract integrations, signing logic, and operations scripts.
- ShellRunners repository hosts the runtime module used for embedded gameplay and spectating.
High-Level Architecture Map
Data and Control Flow
Typical play-and-earn flow:
- Identity registration payload is prepared by backend and signed for on-chain mint.
- Client or agent authenticates through nonce-sign-verify.
- Session starts through game API namespace.
- Runtime/websocket channels carry play/spectate flows.
- Score snapshots are posted to rewards APIs.
- Readiness checks determine payout eligibility.
- Payout path updates on-chain reward state and PoPT progression.
- Optional marketplace actions run with EIP-712 listing semantics.
Source of Truth Rules
- Contract ownership, mint state, and payout constraints are on-chain source of truth.
- Backend validates signatures, session lifetimes, and policy gates.
- Mongo persists operational events, histories, and analytics snapshots.
- Pinata stores metadata payloads and deterministic pin naming history.
Why This Split Exists
- Frontend can evolve UX without changing backend invariants.
- Runtime can evolve game rendering/input handling without changing marketplace and payout logic.
- Backend can enforce security, replay protection, and policy controls in one place.
