UI Flows¶
Prescriptive end-to-end flows for both the player-client (services/player-client/) and the admin-ui (services/admin-ui/). Names every page/component the user touches and the action that drives them to the next screen.
This is the target experience. For implementation tech stacks see player-client.md and admin-ui.md. For the realtime layer see realtime.md.
Source files referenced throughout:
- services/player-client/src/components/pages/ — top-level player pages.
- services/player-client/src/components/first-login/, galaxy/, trading/, combat/, planetary/, spacedock/, ai/.
- services/admin-ui/src/components/pages/ — top-level admin pages.
1. Player-client journey¶
1.1 High-level flow¶
flowchart TD
A[LoginPage.tsx] -->|JWT auth| B{First login?}
B -->|yes| C[FirstLoginContainer.tsx]
B -->|no| D[GameDashboard.tsx]
C -->|dialogue + ship pick| D
D -->|click Galaxy| E[GalaxyMap.tsx]
D -->|click Dock| F[SpaceDockInterface.tsx]
D -->|click Trade| G[TradingInterface.tsx]
D -->|click Planet| H[Planetary components]
D -->|click Combat| I[Combat components]
D -->|click ARIA| J[AI chat panel]
E -->|select sector| K[SectorView]
K -->|warp/move| E
K -->|enter port| F
F -->|buy/sell| G
G -->|exit| D
H -->|manage colony| D
I -->|combat resolved| D
J -->|return| D
1.2 Step-by-step¶
Login → Dashboard¶
- Player lands on
LoginPage.tsx(components/pages/LoginPage.tsx). - Submits credentials via
AuthContext→ gameserver issues JWT + refresh token. - On success, the router checks
Player.first_login.completed. If false → first-login flow. If true →GameDashboard.tsx.
First-login flow (one-time per character)¶
FirstLoginContainer.tsx(components/first-login/) orchestrates a four-step ARIA-driven sequence:DialogueExchange.tsx— multi-turn AI conversation. Trust is shown byTrustMeter.tsx.ShipSelection.tsx— picks the starter ship type.OutcomeDisplay.tsx— confirms the outcome (ship, credits, starting sector).- On completion →
Player.first_login = { completed: true }server-side, redirect toGameDashboard.tsx.
Main dashboard¶
GameDashboard.tsx(components/pages/GameDashboard.tsx) is the central hub. It shows:- Current ship status (hull, shields, cargo, turns, credits).
- Current sector and dock state.
- Quick actions: Galaxy Map, Dock/Undock, Trade (if docked), Planet (if landed), Combat status, ARIA.
- Live activity feed via
WebSocketContext. - From here the player branches into one of five sub-flows.
Galaxy map flow¶
- Click "Galaxy Map" →
GalaxyMap.tsx(components/pages/GalaxyMap.tsx). - Renders a 3D star field via
Galaxy3DRenderer.tsx+SectorNode3D.tsx+ConnectionPath3D.tsx+PlayerMarker3D.tsx(components/galaxy/). - Click a sector node → sector detail panel shows distance, contents (stations, planets, hostile presence), and a "Move here" button.
- Move → server validates
turn_cost, updatesPlayer.current_sector_id, returns updated state via WebSocket. Map redraws with new player position.
Dock and trade flow¶
- From dashboard or sector view, click "Dock" at a station →
SpaceDockInterface.tsx(components/spacedock/). - SpaceDock screen shows: Trade, Repair, Upgrade, Equipment, Insurance buttons.
- Click Trade →
TradingInterface.tsx(components/trading/). Shows commodity buy/sell prices for this station, with current cargo and credit balance. - Submit buy or sell → server runs
trading_service.calculate_dynamic_price(economy/trading.md), commits transaction, returns updated cargo/credits. - (Optional) Click Upgrade → ship-upgrade panel listing available
UpgradeTypelevels with costs (driven byship_upgrade_service.get_upgrade_info). - Click Undock → return to
GameDashboard.tsx.
Planet management flow¶
- When the player's ship is at a sector with an owned planet, the dashboard exposes a "Land" action.
- Click → planetary management view (
components/planetary/). Shows population, production, defences, build queue, terraforming state. - Player can: queue colonist transport from station, install planetary defences, initiate terraforming, build citadels.
- "Take off" → return to
GameDashboard.tsxwith ship in sector orbit.
Combat flow¶
- When the player enters a sector with a hostile, the dashboard surfaces a combat alert banner.
- Click → combat interface (
components/combat/,components/tactical/). Shows attacker/defender ship cards with hull, shields, drone counts. - Each combat round uses
attack_turn_costfromShip.attack_turn_cost(see combat.md). Round-by-round results stream over WebSocket. - On resolution: winner returns to dashboard with loot; loser returns in escape pod (
ship_service._ensure_escape_pod).
Fleet operations¶
- From dashboard, click "Fleet" (📐 Design-only top-level button) → fleet management view.
- Lists all owned ships, their current sector, status, assigned route. Player can:
- Reassign a ship to a different sector.
- Set up an automated trade route between two stations.
- Designate a flagship (
Ship.is_flagship). - Status: 📐 Design-only —
Fleetmodel exists (models/fleet.py) andfleet_service.pyis shipped, but the management UI is unbuilt.
ARIA chat¶
- From any screen, an ARIA panel toggle is available (
components/ai/). - Click → conversational panel showing recent ARIA messages, market intelligence summaries, and a free-text input.
- ARIA's responses incorporate
Player.aria_consciousness_level,aria_relationship_score, and the player's recent activity (see aria.md).
Subscription / settings¶
- Profile menu → subscription management →
SubscriptionResult.tsxfor post-PayPal-redirect handling. - Subscription create button kicks off the PayPal flow described in monetization.md. On return,
SubscriptionResult.tsxdisplays activation confirmation. - PayPal-related UI lives in
components/paypal/.
2. Admin-ui journey¶
2.1 High-level flow¶
flowchart TD
A[LoginPage.tsx] -->|JWT + MFA| B[AdminDashboard.tsx]
B -->|Universe| C[UniverseEditorPage.tsx]
B -->|Users| D[UsersManager.tsx]
B -->|Economy| E[EconomyDashboard.tsx]
B -->|Security| F[SecurityDashboard.tsx]
B -->|Multi-regional| G[RegionalGovernorDashboard.tsx]
B -->|Combat| H[CombatOverview.tsx]
B -->|Colonization| I[ColonizationManagement.tsx]
B -->|First-login| J[FirstLoginConversations.tsx]
B -->|Permissions| K[PermissionsDashboard.tsx]
B -->|Teams| L[TeamManagement.tsx]
B -->|Analytics| M[AdvancedAnalytics.tsx]
C -->|edit sector| N[SectorEditModal]
C -->|edit planet| O[PlanetDetail]
C -->|edit station| P[StationDetail]
D -->|edit player| Q[player editor]
G -->|select region| R[CentralNexusManager.tsx]
2.2 Step-by-step¶
Login + MFA¶
- Operator visits the admin URL →
LoginPage.tsx(admin-uicomponents/pages/). - Submits credentials. If MFA is enabled (
auth/MFAVerification.tsx), prompts for TOTP code. - Server validates against
models/admin_credentials.pyandmodels/mfa.py. JWT issued.
Admin dashboard¶
- Lands on
AdminDashboard.tsx— the operator hub. Displays: - System health, active player count, recent audit events.
- Sidebar navigation (
components/layouts/Sidebar.tsx) with the 12+ top-level admin sections.
Universe editor¶
- Sidebar → "Universe" →
UniverseEditorPage.tsxorUniverse.tsx/UniverseManager.tsx. - Renders the universe (regions → clusters → sectors → planets → stations) in a navigable tree.
- Click a sector →
SectorEditModal(components/universe/). - Click a planet →
PlanetDetailmodal. Adjust biome, population, owner, defences. - Click a station →
StationDetailmodal. Adjust commodities, prices, base values, station class. - Click a colony →
ColonyDetailModal. - All edits route through the gameserver admin API (
services/admin/) and are audited.
User management¶
- Sidebar → "Users" →
UsersManager.tsx. - Search / filter users. Click a user → player editor (
components/admin/). - Editor lets operator: grant credits, modify rank, reset turns, suspend account, view audit history, force logout.
Economy dashboard¶
- Sidebar → "Economy" →
EconomyDashboard.tsx(components/pages/, CSS ineconomy-dashboard.css). - Shows: total credits in circulation, inflation indicators, top trading ports, wealth distribution, market liquidity, health score.
- Drill-down into per-region or per-commodity views.
- Levers exposed (📐 Design-only): adjust commodity base prices, production rates, regional tax rates without DB shell access. See FEATURES/economy/lifecycle.md §5.
Security / audit¶
- Sidebar → "Security" →
SecurityDashboard.tsx. - Sub-views:
AuditLogViewer(components/security/), permission matrix, recent suspicious events. - Sidebar → "Permissions" →
PermissionsDashboard.tsxwithPermissionMatrix+RoleManagement(components/permissions/).
Multi-regional governor¶
- Sidebar → "Multi-Regional" →
RegionalGovernorDashboard.tsx(components/pages/). - Lists all regions with: type (central_nexus / terran_space / player_owned), owner, citizen count, tax rate, status, governance type.
- Click a region → drill into governance tools: edit
tax_rate(within 5–25%), adjustgovernance_type, force-suspend, view treasury balance. - Sidebar → "Central Nexus" →
CentralNexusManager.tsxfor managing the 5,000-sector central hub specifically.
Combat overview¶
- Sidebar → "Combat" →
CombatOverview.tsxwithCombatFeed+DisputePanel(components/combat/). - Real-time feed of all active combat events. Operator can review disputes (suspected exploits) and reverse outcomes if justified.
Colonization¶
- Sidebar → "Colonization" →
ColonizationOverview.tsx/ColonizationManagement.tsx. - Per-planet view of colony health, terraforming progress, genesis device deployment status.
First-login conversations¶
- Sidebar → "First-Login" →
FirstLoginConversations.tsx. - Lists every player's first-login dialogue with filters and detail modal (
components/first-login/). Used for QA, content tuning, and identifying ARIA misbehaviour.
Teams¶
- Sidebar → "Teams" →
TeamManagement.tsxwithAllianceNetwork+TeamAdminPanel(components/teams/). - View team membership, alliance graph, intervene in team disputes.
Analytics¶
- Sidebar → "Analytics" →
AdvancedAnalytics.tsx,PlayerAnalytics.tsx,AnalyticsReports.tsx. - Build custom reports, view performance metrics, surface predictive analytics.
AI trading dashboard¶
- Sidebar → "AI Trading" →
AITradingDashboard.tsx. - Monitors AI provider health (
ai_provider_service.py), recent ARIA conversations, market prediction accuracy.
Event management¶
- Sidebar → "Events" →
EventManagement.tsx. - Schedule and trigger universe-wide events (sales, faction wars, anomalies).
3. Key cross-cutting UX rules¶
3.1 Auth gating¶
Every authenticated page in both apps wraps in AuthContext (player-client) or ProtectedRoute (admin-ui components/auth/). Unauthenticated requests redirect to LoginPage.tsx.
3.2 Real-time updates¶
Both apps maintain a single WebSocket connection (WebSocketContext). Server pushes:
- Sector arrivals (other players entering / leaving).
- Combat events.
- Market price changes.
- Admin audit events.
- ARIA messages.
See realtime.md.
3.3 i18n¶
All visible strings flow through i18next (services/admin-ui/src/i18n.ts, services/player-client/src/i18n.ts). Language switcher available on LoginPage.tsx and the user profile menu. See i18n.md.
3.4 Error states¶
- Network failure: toast banner, retry-with-backoff. No silent failures.
- Auth expiry: redirect to login.
- Server-side validation failure: inline form error.
3.5 Mobile responsiveness¶
The player-client targets a desktop-first 3D experience but degrades for tablet (the galaxy map switches from 3D to 2D minimap, dashboards stack to single-column). The admin-ui is desktop-only.
4. Cross-references¶
- player-client.md — tech stack and project layout for the player app.
- admin-ui.md — tech stack and project layout for the admin app.
- aria.md — the ARIA chat experience.
- realtime.md — WebSocket topology.
- i18n.md — internationalization.
- monetization.md — subscription UI flow.
- multi-regional.md — region governor experience.
- FEATURES/gameplay/player-journey.md — when in the lifecycle each UI flow becomes important.