How munt-dropjes/aandelenspel works
Aandelen Spel is a Vue dashboard over a PHP/MySQL game-economy API. Users authenticate, then the dashboard loads companies, valuations, and history while periodically saving snapshots. Admins record one-shot task outcomes; companies trade stocks, transfer money, and negotiate offers. Vue components call the routed PHP controllers, which delegate to domain services and database repositories. The tree confirms the major routes and sampled task/offer persistence; some controller-to-service details are inferred only from the repository structure.
Components 23
Vue Client
- App Shell
ui/src/App.vue - Auth State
ui/src/composables/useAuth.js - Game Engine
ui/src/composables/useGameEngine.js - API Client
ui/src/services/api.js - Task UI
ui/src/components/Tasks.vue - Market UI
ui/src/components/StockDivider.vue - Offers UI
ui/src/components/TradeOffers.vue - History Graph
ui/src/components/Graph.vue
HTTP API
- API Router
api/public/index.php - Auth Controller
api/controllers/AuthController.php - User Controller
api/controllers/UserController.php - Game Controllers
api/controllers - Market Controllers
api/controllers
Game Services
- Auth Service
api/services/AuthService.php - Game Service
api/services/GameService.php - Task Service
api/services/TaskService.php - Stock Service
api/services/StockService.php - Offer Service
api/services/TradeOfferService.php - History Service
api/services/HistoryService.php
Persistence
- Repositories
api/repositories - MySQL Database
Other components
- Player
- Game Admin
Connections 35
- Player → Auth State: logs in
- Game Admin → Auth State: logs in
- Auth State → API Client: submits credentials
- API Client → API Router: sends requests
- API Router → Auth Controller: dispatches login
- API Router → User Controller: dispatches users
- API Router → Game Controllers: dispatches game
- API Router → Market Controllers: dispatches economy
- Auth Controller → Auth Service: authenticates
- Auth Service → Repositories: reads accounts
- Auth Controller → Auth State: returns JWT
- App Shell → Auth State: initializes auth
- App Shell → Game Engine: starts engine
- App Shell → API Client: polls offers
- Game Engine → API Client: loads data
- Game Engine → History Graph: feeds history
- Game Engine → API Client: saves snapshots
- Task UI → API Client: submits results
- Task UI → Game Engine: refreshes companies
- Market UI → API Client: trades shares
- Offers UI → API Client: manages offers
- Game Controllers → Game Service: controls game
- Game Controllers → Task Service: records tasks
- Game Controllers → History Service: handles history
- Market Controllers → Stock Service: executes trades
- Market Controllers → Offer Service: handles offers
- Market Controllers → Repositories: records transfers
- User Controller → Auth Service: checks identity
- Auth Service → Repositories: reads settings
- Game Service → Repositories: reads game state
- Task Service → Repositories: persists attempts
- Stock Service → Repositories: persists holdings
- Offer Service → Repositories: swaps atomically
- History Service → Repositories: stores snapshots
- Repositories → MySQL Database: reads and writes