Player Client¶
Status: ๐ง Partial โ Core surfaces (first-login, galaxy 3D, trading-interface, subscriptions) are real. Re-verified 2026-08-21 vs tip
46bce720: Tip delta from prior1a40ce1aincludes Admin Soft-ORDER honesty + GS #710 medal collection GET โ #710/#789-class deltas โ PC Soft-HOLD unlock. Soft-ORDER #789/#788 remain tip-PRESENT; PC Soft-HOLDs unchanged.contexts/has 7 tsx files (Auth, Autopilot, FirstLogin, Game, Settings, WebSocket, WindshieldFlight);services/has 11 ts files.components/pages/has 5 tsx โ noGalaxyMap.tsxorDashboard.tsxon tip (App.tsx/game/mapisRedirectToGame; 3D map isgalaxy/Galaxy3DRenderer.tsxinside GameDashboard / cockpit NAV). Combat on tip isCombatInterface+NpcCombatBanneronly. Soft-HOLD tip-pending (not tip-complete): Fibril#1210/#1209i18n ยท#1445Gatewrighttoll_statsยท#1364beacon popup ยท#1180combat history browse ยท#1097landing-rights whitelist/denylist ยท#1179PlayerNamePlate medals โ see ยง Soft-HOLD tip residuals below. Tip-PRESENT this stamp:#1178bounty board (#838/#839);#1207Leaderboards medal column (#865).
The player-facing web app at services/player-client/.
1. Tech stack¶
From services/player-client/package.json on tip 9dc7ed12:
| Layer | Choice |
|---|---|
| Framework | React 19.2 + TypeScript 7.0 |
| Build | Vite 8.2 |
| Routing | react-router-dom 7.18 |
| HTTP | axios 1.19 |
| 3D | three 0.185, @react-three/fiber 9.7, @react-three/drei 10.7 |
| Animation | react-spring 10.0 (no framer-motion on tip) |
| Icons | lucide-react 1.28 |
| Sanitization | isomorphic-dompurify 3.21 (XSS prevention for AI chat) |
| Utility | lodash.debounce, lodash.throttle |
| i18n | i18next 26.3 + react-i18next 17.0 + browser-languagedetector + http-backend |
| Tests | Vitest 4.1 (npm test); Playwright 1.62 (E2E) |
State management: React Context (AuthContext, AutopilotContext, FirstLoginContext, GameContext, SettingsContext, WebSocketContext, WindshieldFlightContext).
Default ports: player-client on 3000, gameserver on 8080.
2. Project layout¶
services/player-client/src/
โโโ App.tsx, main.tsx, i18n.ts
โโโ components/
โ โโโ ai/ AIAssistant, AIAssistantButton, EnhancedAIAssistant (ARIA chat)
โ โโโ analytics/ AchievementTracker, GoalManager, Leaderboards, PlayerAnalytics, ProgressVisualizer
โ โโโ auth/
โ โโโ combat/ CombatInterface, NpcCombatBanner (only โ no CombatLog / CombatAnalytics / DroneManager / FleetBattlePanel / FormationControl / SiegeInterface / TacticalPlanner on tip)
โ โโโ common/ shared UI (LanguageSwitcher, etc.)
โ โโโ first-login/ FirstLoginContainer, DialogueExchange, ShipSelection,
โ โ OutcomeDisplay, NicknameConfirm
โ โโโ galaxy/ Galaxy3DRenderer, SectorNode3D, PlayerMarker3D,
โ โ ConnectionPath3D, StarField, CourseConfirmPopup
โ โโโ layouts/
โ โโโ market-intelligence/ MarketAnalyzer, PricePredictor, RouteOptimizer, CompetitionMonitor
โ โโโ pages/ 5 tsx pages (see Section 3) โ no GalaxyMap.tsx / Dashboard.tsx
โ โโโ paypal/ PayPalSubscription
โ โโโ planetary/ 15 tsx (PlanetManager, BuildingManager, ColonistAllocator,
โ โ ColonySpecialization, DefenseConfiguration, GenesisDeployment,
โ โ SiegeStatusMonitor, CitadelManager, CitadelStructure, GridManager,
โ โ LandingRightsControl, PioneerOfficeVenue, PopulationCenterInterface,
โ โ SpecializationDrawer, TerraformingPanel) โ no ProductionDashboard.tsx on tip
โ โโโ ranking/ RankDisplay, RankProgress, Leaderboard, MedalShowcase
โ โโโ ships/ InsuranceManager, MaintenanceManager, ModuleGridInterface,
โ โ ShipRegistryPanel, ShipSelector
โ โโโ spacedock/ SpaceDockInterface
โ โโโ tactical/ SectorViewport, NavigationMap, PlanetCard, PlanetPortPair,
โ โ StationCard, TacticalCard
โ โโโ teams/ TeamManager, TeamChat, ResourceSharing, MissionPlanner
โ โโโ trading/ TradingInterface, MarketIntelligenceDashboard, SmartTradingAutomation
โโโ contexts/ Auth, Autopilot, FirstLogin, Game, Settings, WebSocket, WindshieldFlight (7 tsx)
โโโ services/ api.ts, apiClient.ts, websocket.ts, aiTradingService.ts,
โ deckNavBus.ts, intrasystemFlight.ts, marketStream.ts, resourceCatalog.ts,
โ routeOptimizerService.ts, teleprinterBus.ts, warpCinematicBus.ts (11 ts)
โโโ styles/, themes/, types/, utils/
โโโ utils/security/ XSS / sanitization helpers (separate from common utils)
A shared API layer lives in services/api.ts plus services/apiClient.ts. Real-time traffic flows through services/websocket.ts (the multiplayer protocol client).
3. Pages¶
components/pages/ has 5 tsx pages on tip 9dc7ed12 โ not 7, and not GalaxyMap.tsx:
| Page | Purpose |
|---|---|
LoginPage.tsx |
Auth |
GameDashboard.tsx |
Player landing / cockpit (galaxy 3D, NAV, gameplay decks) |
SubscriptionResult.tsx |
PayPal subscription confirmation |
DebugPage.tsx, TestAuthPage.tsx |
Dev / QA tools |
There is no Dashboard.tsx and no GalaxyMap.tsx anywhere under services/player-client on this tip. App.tsx routes /game/map (and several sibling paths) to RedirectToGame; the Three.js map is galaxy/Galaxy3DRenderer.tsx inside the GameDashboard cockpit, not a standalone page.
Most actual gameplay UI happens inside GameDashboard via the feature modules above rather than dedicated pages.
4. Key features¶
First-Login AI dialogue¶
first-login/FirstLoginContainer.tsx orchestrates the AI guard interrogation. DialogueExchange.tsx renders the conversation, ShipSelection.tsx is the ship picker, OutcomeDisplay.tsx shows the resolution, NicknameConfirm.tsx confirms the callsign. There is no TrustMeter.tsx on tip 9dc7ed12. CSS is heavy (first-login.css). Backed by /api/v1/first-login/* and the multi-provider AI dialogue service (OpenAI primary, Anthropic secondary, deterministic fallback).
Trading + ARIA market intelligence¶
trading/TradingInterface.tsx is the core buy/sell UI. trading/MarketIntelligenceDashboard.tsx (~22 KB) and trading/SmartTradingAutomation.tsx (~29 KB) plus the market-intelligence/ quartet (MarketAnalyzer, PricePredictor, RouteOptimizer, CompetitionMonitor) surface ARIA's per-player observations and predictions. Service: services/aiTradingService.ts.
Combat¶
Two components in combat/ on tip 9dc7ed12: CombatInterface.tsx and NpcCombatBanner.tsx. The older eight-file set (CombatLog, CombatAnalytics, DroneManager, FleetBattlePanel, FormationControl, SiegeInterface, TacticalPlanner) is absent โ do not invent those UIs back onto the tip. Product combat-HUD / drone gaps belong to existing player-client WOs, not this inventory page. There is no combat/README.md on tip.
Planetary management¶
15 tsx components in planetary/ on tip 9dc7ed12 (PlanetManager, BuildingManager, ColonistAllocator, ColonySpecialization, DefenseConfiguration, GenesisDeployment, SiegeStatusMonitor, CitadelManager, CitadelStructure, GridManager, LandingRightsControl, PioneerOfficeVenue, PopulationCenterInterface, SpecializationDrawer, TerraformingPanel). ProductionDashboard.tsx is not on tip.
Galaxy / 3D¶
galaxy/Galaxy3DRenderer.tsx plus SectorNode3D, PlayerMarker3D, ConnectionPath3D, StarField, and CourseConfirmPopup provide the Three.js view (cockpit NAV โ not a pages/GalaxyMap.tsx). tactical/SectorViewport.tsx is the in-sector 2D view.
Teams / alliances¶
Four tsx components in teams/ on tip 9dc7ed12: TeamManager, TeamChat, ResourceSharing, MissionPlanner. TeamAnalytics / AllianceManager / DiplomacyInterface are not on tip.
Ships & space dock¶
ships/ has 5 tsx components on tip 9dc7ed12 (InsuranceManager, MaintenanceManager, ModuleGridInterface, ShipRegistryPanel, ShipSelector). CargoManager / FleetCoordination / ShipDetails / UpgradeInterface are not on tip. spacedock/SpaceDockInterface.tsx is the standalone dock view.
ARIA chat¶
See ./aria.md โ ai/EnhancedAIAssistant.tsx is the main chat component with DOMPurify sanitization, client-side rate limiting, Web Speech API, and WebSocket integration.
Subscriptions¶
paypal/PayPalSubscription.tsx plus pages/SubscriptionResult.tsx handle the PayPal monetization flow used by multi-regional ($25/mo regional ownership, $5/mo galactic citizenship โ see ./multi-regional.md).
Player progression UI¶
ranking/(RankDisplay, RankProgress, Leaderboard, MedalShowcase) renders the military-rank progression. SeeFEATURES/gameplay/ranking.md.analytics/AchievementTracker.tsx,GoalManager.tsx, and the rest of theanalytics/directory cover lifetime achievements and personal goals.
Real-time multiplayer¶
services/websocket.ts is the multiplayer-protocol client (presence, sector chat, combat events). See ./realtime.md.
i18n¶
common/LanguageSwitcher.tsx; full i18next setup. Six languages targeted (English / Spanish / French / Portuguese / Chinese launch-complete; German Partial โ see ./i18n.md).
Tip-PRESENT this stamp: Fibril #1178 / #838 MERGED โ b0fa048a8 + place/cancel #839 โ player-client BountyBoard.tsx + BountyPlaceCancel.tsx mounted from ServiceRecordTab.tsx; bountyAPI.getAvailable / place / cancel bound on feat tip (ancestor 935e557d3 / #946). #838/#839 is PC product โ density Soft-HOLD unlock. See ../FEATURES/gameplay/bounties.md.
Tip-PRESENT this stamp: Fibril #1207 / #865 MERGED โ 4108cf582 / LEG-2594 โ player-client Leaderboard.tsx Medals column (medal_count + pinned_medal_id; PlayerNamePlate leaderboard-medal-plate). Live origin/feat 935e557d3 ancestor. #865 is PC product โ density Soft-HOLD unlock. See ../FEATURES/gameplay/medals.md.
Soft-HOLD tip residuals (tip 46bce720 โ do not read as tip-complete; PC Soft-HOLDs unchanged by Soft-ORDER #789 / #788 or GS #710):
- Fibril #1210 โ API-down / offline fallback seeds zh-CN (i18n runtime code is zh) and sets completionPercentage: 0 for every non-en row (LanguageSwitcher.tsx:58โ59). Not the Admin launch-complete 100% path.
- Fibril #1209 โ scripts/validate-translations.js KNOWN_NAMESPACES is still {common, game, auth} while i18n.ts declares 7 namespaces (common, game, auth, ai, marketing, errors, validation).
- Fibril #1445 / PR #618 โ Gatewright owner toll_stats consumer still ABSENT on tip (GS listMine half tip-PRESENT; see ../FEATURES/galaxy/warp-gates.md).
- Fibril #1364 / PR #719 โ windshield beacon sector popup remains preview-only (no Read/Salvage CTAs; see ../FEATURES/gameplay/message-beacons.md).
- Fibril #1180 / PR #689 โ combat history browse UI tip-pending (GS GET /api/v1/combat/history tip-PRESENT via #756; PC ABSENT โ see ../FEATURES/gameplay/combat.md).
- Fibril #1097 / PR #698 โ landing-rights whitelist/denylist UUID editor tip-pending (see ../FEATURES/planets/colonization.md).
- Fibril #1179 / PR #597 โ PlayerNamePlate medal identity tip-pending (see ../FEATURES/gameplay/medals.md).
Do not remint these Soft-HOLDs. Density Soft-HOLD is orthogonal.
5. Build / test¶
# from services/player-client/
npm run dev # vite dev (port 3000)
npm run build # tsc + vite build
npm run lint # eslint
npm test # vitest run
npm run test:e2e # playwright via scripts/run-tests.js
npm run test:e2e:ui # playwright UI mode
E2E specs on tip 9dc7ed12 live in e2e_tests/player/ui/ (4 files): player-ui.spec.ts, deck-page-switch.spec.ts, deck-reflow-bands.spec.ts, uiscale-band-clear-matrix.spec.ts. e2e_tests/foundation-sprint/ contains only test-helpers.ts โ the previously named security-validation.spec.ts / websocket-realtime.spec.ts are not on tip.