How kennethlove/hangry-games works
Main Components
a) User Interface Layer:
• Web GUI (Dioxus-based frontend)
• CLI Interface
Both should be represented as separate entry points
b) Core Application Layer:
• Game Engine
• Simulation Logic
• Event System
c) Data Layer:
• PostgreSQL Database
• Diesel ORM Interface
Key Architectural Elements
[User Interface Layer]
[Application Layer]
[Data Access Layer]
[Database Layer]
Component Relationships
a) Frontend Components:
• Components hierarchy from src/gui/components/
• Router.rs to individual components
• State management (states.rs)
b) Core Game Logic:
• Models/ directory components
• Relationship between tributes/, events/, and games/ modules
• Action flow from user input to game state changes
Specific Implementation Details
• Blue rectangles: User interface components
• Green rectangles: Core game logic
• Yellow diamonds: Data models
• Red rectangles: Database components
Key Flows to Highlight
a) Game Creation Flow:
CLI/GUI → Game Engine → Models → Database
b) Simulation Flow:
Game Engine → Events → Actions → State Updates → Database
Important Subsystems
• Tribute management system (src/tributes/)
• Event handling system (src/events.rs)
• Area management (src/areas.rs)
• Item system (src/items.rs)
Database Schema Relationships
Entity relationships between:
• Games
• Tributes
• Areas
• Actions
• Items
• Events
• Logs
Technical Stack Indicators
• Rust
• Dioxus
• PostgreSQL
• Diesel ORM
• Tailwind CSS
Remember to show the development environment setup (Docker/devcontainer) as a separate supporting component, as indicated by the .devcontainer directory.
This architecture should emphasize the event-driven nature of the game simulation while showing clear separation of concerns between UI, business logic, and data persistence layers.