How mylaana/aresexpedition works
Project Type and Purpose
• This is a full-stack, real-time, browser-based board-game application (“Ares Expedition”).
• Frontend: Angular SPA (v19) serving UI and handling game state via RxJS.
• Backend: Java Spring Boot (Java 23) exposing both REST endpoints and a STOMP-over-WebSocket API for two-way, low-latency game messaging.
• Auxiliary: A Python CSV parser to generate card and game data JSON files.
High-Level Components
A. Client/Browser (Angular SPA)
• UI Components (many card, game-event and layout components)
• Services:
– api.service (REST calls)
– rx-stomp.service (WebSocket connections)
– game-state.service (front-end model)
– event-pile (RxJS event bus)
• Models & DTO interfaces for mapping payloads
• Static assets: card data, images, styles
B. Backend (Spring Boot)
• Config: ApiConfig (REST), WebSocketConfig (STOMP endpoints)
• Controllers:
– ApiController (REST: create game, list cards)
– GameController (HTTP game-management calls)
– WsControllerInput / Output & InputRouter (STOMP message handling)
• Services & Factories: NewGameService, QueryMessageFactory, MessageOutputFactory
• Repository layer: JsonGameDataHandler reading/writing JSON “database”
• Domain Model: Game, PlayerState subclasses, DTOs and enums
C. Parser Script
• parser/parser.py reads CSV, emits JSON used by both front and back
D. Data Storage
• JSON files under back/data (database.json, save.json)
Interactions and Data Flows
• On page load the Angular app fetches initial config via REST GET.
• User actions (e.g., “Play card”, “Ready”) generate events in the front-end event pile → transformed into STOMP message payloads → sent to back via WebSocket.
• Backend receives STOMP messages → controllers route to services → update domain model → repository persists JSON → back emits STOMP broadcast messages to all subscribed clients.
• Some operations (e.g., create new game, load card metadata) use REST POST/GET from Angular to Spring Boot.
Architectural Patterns & Principles
• MVC on both sides:
• Frontend: Components (View/Controller), game-state service (Model)
• Backend: Controllers, Services (business logic), Repository (persistence)
• Event-Driven Architecture: RxJS event pile drives UI updates; STOMP for server-client events.
• Layered separation: UI → API layer (REST/WS) → Business layer → Data layer.
• DTOs isolate transport schemas from domain models.
Final Checklist
• Clear, human-readable labels for each component and protocol.
• Enough granularity: at least group by front-end app modules, REST controller vs WebSocket controller on backend, services, and JSON data store.