How joostory/boardgame works
High-Level Architecture Components
The system should be represented with these main components:
a. Frontend Layer (Client-Side)
• Next.js Application
• React Components
• State Management (Recoil - evident from atom directory)
• UI Components Library
b. API Layer (Server-Side)
• Next.js API Routes
• Game Logic Handlers
• Data Storage
Detailed Component Breakdown
a. Core Game Modules:
• Memory Game Module
• Modoo (Monopoly) Game Module
b. State Management:
• Recoil Atoms (memory-atom.ts, modoo-atom.ts)
• Local Storage Integration (modoo-storage.ts)
c. Data Layer:
• JSON Data Sources (building.json, command.json, land.json)
• Domain Models (memory.ts, modoo.ts)
Interaction Flows
Key interactions:
a. Game Flow:
• Start Game → Player Management → Asset Management
• Command Processing → State Updates → UI Updates
b. Data Flow:
• Client State ↔ Local Storage
• API Routes ↔ Game Logic
• UI Components ↔ State Management
Use these visual elements:
• Rectangles: UI Components
• Hexagons: API Endpoints
• Rounded Rectangles: Game Logic Modules
• Blue: Frontend Components
• Green: API Layer
• Yellow: State Management
• Gray: Data Storage
• Purple: Shared Utilities
┌─ UI Layer ─────────────────────┐
• Components (Memory & Modoo) │
• UI Elements & Forms │
• State Management ─────────────┤
• Recoil Atoms │
• Local Storage │
• Business Logic ──────────────┤
• Game Rules & Calculations │
• API Layer ──────────────────┤
• Next.js API Routes │
• Data Layer ─────────────────┘
Key Relationships to Highlight
• Component Hierarchy:
• SubPageLayout → Game Components
• Game Components → Shared Components
• UI Components → State Management
• Data Flow:
• API Routes → Game Logic → State
• User Actions → Commands → State Updates