How armansiddiqui9/slumberbloom works
SlumberBloom is a local-first sleep-to-garden game: a player tucks in, returns after time away, claims a hashed Night Block, settles it at Dawn, verifies it with a Lantern proof, then tends the garden. The web app uses a local adapter and pure consensus engine; the C# mobile scaffold mirrors that loop with an in-device API. AI is an optional local feature, outside consensus. README documentation establishes further AI and server capabilities, but their runtime wiring is not shown in the excerpts.
Main entry points: index.ts Local adapter · night-block.ts Night Block minting · App.cs Mobile flow · IAiAgent.cs Agent interface
Components 22
Web game
- Game screens
apps/web/src/app/App.tsx - API composition
apps/web/src/api/game-api.ts
Local game API
- Local adapter
packages/adapters-local/src/index.ts - Game contracts
packages/contracts/src/index.ts - Local game state
packages/adapters-local/src/index.ts
Consensus engine
- Night Block minting
packages/engine/src/blocks/night-block.ts - Canonical encoding
packages/engine/src/encoding/canonical-json.ts - SHA-256 hashing
packages/engine/src/crypto/hash.ts - Merkle proofs
packages/engine/src/crypto/merkle.ts - Garden growth
packages/engine/src/garden/plant.ts
Mobile scaffold
- Mobile flow
mobile-game/src/App.cs - Screen model
mobile-game/src/UI/AppModel.cs - Game screens
mobile-game/src/UI/MorningDewScreen.cs - In-device API
mobile-game/src/Backend/LocalApi.cs - Mobile API contract
mobile-game/src/Contracts/GameApi.cs - Mobile crypto
mobile-game/src/Engine/Crypto/Merkle.cs - Mobile hashing
mobile-game/src/Engine/Crypto/Hash.cs
AI agents
- Agent interface
mobile-game/src/AI/IAiAgent.cs - On-device agent
mobile-game/src/AI/OnDeviceAgent.cs - Server agent
mobile-game/src/AI/ServerAgent.cs
Other components
- Player
- FastAPI server
server/main.py
Connections 21
- Player → Game screens: plays
- Game screens → API composition: calls game API
apps/web/src/app/App.tsx - API composition → Local adapter: creates
apps/web/src/api/game-api.ts - Local adapter → Local game state: reads and writes
packages/adapters-local/src/index.ts - Local adapter → Game contracts: implements
- Local adapter → Night Block minting: mints blocks
- Local adapter → Merkle proofs: builds proofs
- Local adapter → Garden growth: computes growth
- Night Block minting → Canonical encoding: encodes
packages/engine/src/blocks/night-block.ts - Night Block minting → SHA-256 hashing: hashes
packages/engine/src/blocks/night-block.ts - Merkle proofs → SHA-256 hashing: hashes nodes
packages/engine/src/crypto/merkle.ts - Player → Mobile flow: plays
- Mobile flow → Screen model: creates
mobile-game/src/App.cs - Mobile flow → Game screens: routes screens
mobile-game/src/App.cs - Screen model → Mobile API contract: calls API
mobile-game/src/UI/AppModel.cs - In-device API → Mobile crypto: verifies blocks
mobile-game/src/Backend/LocalApi.cs - Mobile crypto → Mobile hashing: hashes nodes
mobile-game/src/Engine/Crypto/Merkle.cs - In-device API → Agent interface: accepts optional agent
mobile-game/src/Backend/LocalApi.cs - On-device agent → Agent interface: implements
mobile-game/src/AI/OnDeviceAgent.cs - Server agent → Agent interface: implements
mobile-game/src/AI/ServerAgent.cs - Player → FastAPI server: opens game site