How 14vosx/hsc-cs2-portal works
Purpose and runtime
HSC CS2 Portal is a public and player-facing Counter-Strike 2 portal. Its primary implementation is an Angular 22 single-page application using TypeScript, RxJS, ngx-translate, and ApexCharts for analytics. The legacy static HTML/CSS/JS site remains at the repository root, but the active application is frontend/angular/.
Entry points: frontend/angular/src/main.ts, frontend/angular/src/app/app.ts, and route definitions in frontend/angular/src/app/app.routes.ts.
Application shell and navigation
The root application composes global providers, routing, styles, and the reusable portal chrome. The shell owns header/sidebar/footer placement while routed feature pages supply content.
Key paths:
• frontend/angular/src/app/app.config.ts
• frontend/angular/src/app/layout/app-shell/app-shell.ts
• frontend/angular/src/app/layout/app-header/app-header.ts
Global locale and visual preference state is managed centrally rather than independently per feature:
• frontend/angular/src/app/core/i18n/locale.service.ts
• frontend/angular/src/app/core/theme/portal-theme.service.ts
API boundary and data shaping
The browser is a presentation client, not the authority for identity, competitive rules, match-room transitions, drafting, vetoes, server assignment, or ETL. Feature API services call backend endpoints through the shared API layer, receive DTOs, and normalize them into feature-domain models before pages render them.
Key paths:
• frontend/angular/src/app/core/api/cs2-api.service.ts
• frontend/angular/src/app/core/api/dto/
• frontend/angular/src/app/core/config/api-paths.ts
Representative feature boundary:
• frontend/angular/src/app/features/matches/data-access/matches-api.service.ts
• frontend/angular/src/app/features/matches/domain/match.normalizer.ts
Public competition content
Home, ranking, matches, maps, seasons, and news follow a consistent feature structure: page/container → data-access service → normalizer/domain model → focused presentational components. This separates backend contract drift from UI behavior.
Key paths:
• frontend/angular/src/app/features/home/home-page.ts
• frontend/angular/src/app/features/ranking/ranking-page.ts
• frontend/angular/src/app/features/seasons/season-context.ts
Season pages coordinate season-specific ranking, matches, and maps:
• frontend/angular/src/app/features/seasons/data-access/season-ranking-api.service.ts
• frontend/angular/src/app/features/seasons/season-detail-page/season-detail-page.ts
Player identity and account area
Player-facing capabilities are partitioned between core session/presentation concerns and player feature APIs. The UI consumes backend-authoritative identity, membership, entitlement, account, profile, cosmetics, email authentication, and server-access data.
Key paths:
• frontend/angular/src/app/core/session/player-session.service.ts
• frontend/angular/src/app/core/player-presentation/player-presentation-reference.service.ts
• frontend/angular/src/app/features/player/data-access/player-self-api.service.ts
The Player Presentation Reference is deliberately limited to Steam ID, persona name, avatar, and optional profile slug; Match Room must not infer unguaranteed competitive/player attributes.
HSC Mix and Match Room
Mix is the most stateful feature: lobby listing and room views call the backend for formation and setup snapshots. The client supports formation lifecycle display/actions, polling, and stale snapshot/version protection. It must enable controls only from backend viewer.actions; backend confirmation precedes terminal-state visuals or motion.
Key paths:
• frontend/angular/src/app/features/mix/data-access/match-room-api.service.ts
• frontend/angular/src/app/features/mix/match-room/match-room-page.ts
• frontend/angular/src/app/features/mix/domain/match-room.normalizer.ts
Setup presentation is decomposed for competitive status, captain draft, and map veto:
• frontend/angular/src/app/features/mix/match-room/competitive/match-room-competitive-panel.ts
• frontend/angular/src/app/features/mix/match-room/draft/match-room-draft-panel.ts
• frontend/angular/src/app/features/mix/match-room/veto/match-room-map-veto-panel.ts
Bunker analytics and UI motion
Bunker presents player analytics using backend data normalized into a feature model and visualized through specialized panels/charts. Motion is a bounded presentation layer: it may reflect confirmed server state, honors reduced-motion settings, and must not predict transitions.
Key paths:
• frontend/angular/src/app/features/bunker/data-access/bunker-api.service.ts
• frontend/angular/src/app/features/bunker/bunker-page.ts
• frontend/angular/src/app/features/bunker/motion/bunker-motion-registry.ts
Static images, branding, hero assets, and translations are browser-served assets:
• frontend/angular/public/assets/
• frontend/angular/public/i18n/en-US.json
• frontend/angular/public/i18n/pt-BR.json
Main entry points: cs2-api.service.ts Shared API layer · app.routes.ts Feature routes · app.ts Root application · app.config.ts Global providers
Components 28
App shell
- Angular bootstrap
frontend/angular/src/main.ts - Root application
frontend/angular/src/app/app.ts - Feature routes
frontend/angular/src/app/app.routes.ts - Global providers
frontend/angular/src/app/app.config.ts - Portal shell · Places reusable header, sidebar, footer, and routed content.
frontend/angular/src/app/layout/app-shell/app-shell.ts - App header
frontend/angular/src/app/layout/app-header/app-header.ts
Core platform
- Locale state
frontend/angular/src/app/core/i18n/locale.service.ts - Theme state
frontend/angular/src/app/core/theme/portal-theme.service.ts - Shared API layer · Shared browser boundary for backend endpoint calls and DTOs.
frontend/angular/src/app/core/api/cs2-api.service.ts - API paths
frontend/angular/src/app/core/config/api-paths.ts - Browser assets & translations
Competition content
- Public feature pages · Home, ranking, matches, maps, and news use feature data-access and domain models.
frontend/angular/src/app/features/home/home-page.ts - Matches data access
frontend/angular/src/app/features/matches/data-access/matches-api.service.ts - Match model normalizer
frontend/angular/src/app/features/matches/domain/match.normalizer.ts - Season context
frontend/angular/src/app/features/seasons/season-context.ts - Season detail · Coordinates season ranking, matches, and maps.
frontend/angular/src/app/features/seasons/season-detail-page/season-detail-page.ts - Season ranking access
frontend/angular/src/app/features/seasons/data-access/season-ranking-api.service.ts
Player & Mix
- Player session
frontend/angular/src/app/core/session/player-session.service.ts - Player presentation · Steam ID, persona name, avatar, and optional profile slug only.
frontend/angular/src/app/core/player-presentation/player-presentation-reference.service.ts - Player account access · Fetches backend-authoritative account, profile, entitlement, and access data.
frontend/angular/src/app/features/player/data-access/player-self-api.service.ts - Match Room · Uses backend snapshots, polling, versions, and viewer-authorized actions.
frontend/angular/src/app/features/mix/match-room/match-room-page.ts - Match Room access
frontend/angular/src/app/features/mix/data-access/match-room-api.service.ts - Room model normalizer
frontend/angular/src/app/features/mix/domain/match-room.normalizer.ts - Draft, veto & status panels · Reflect confirmed competitive, captain draft, and map-veto state.
frontend/angular/src/app/features/mix/match-room/competitive/match-room-competitive-panel.ts
Analytics
- Bunker analytics
frontend/angular/src/app/features/bunker/bunker-page.ts - Bunker data access
frontend/angular/src/app/features/bunker/data-access/bunker-api.service.ts - Bounded UI motion · Honors reduced motion and reflects confirmed server state only.
frontend/angular/src/app/features/bunker/motion/bunker-motion-registry.ts
Other components
- Authoritative backend · Owns identity, competition rules, room transitions, and analytics data.
Connections 29
- Angular bootstrap → Root application: boots
- Root application → Global providers: uses
- Root application → Feature routes: loads
- Root application → Portal shell: composes
- Portal shell → App header: renders
- Global providers → Locale state: provides
- Global providers → Theme state: provides
- Locale state → Browser assets & translations: loads translations
- Feature routes → Public feature pages: routes to
- Feature routes → Season detail: routes to
- Feature routes → Match Room: routes to
- Feature routes → Bunker analytics: routes to
- Public feature pages → Matches data access: requests data
- Matches data access → Shared API layer: calls through
- Matches data access → Match model normalizer: normalizes
- Season detail → Season context: coordinates
- Season detail → Season ranking access: requests data
- Season ranking access → Shared API layer: calls through
- Player session → Player presentation: supplies identity
- Player account access → Shared API layer: calls through
- Match Room → Match Room access: polls and acts
- Match Room access → Shared API layer: calls through
- Match Room access → Room model normalizer: normalizes snapshots
- Match Room → Draft, veto & status panels: renders confirmed state
- Bunker analytics → Bunker data access: requests analytics
- Bunker data access → Shared API layer: calls through
- Bunker analytics → Bounded UI motion: uses
- Shared API layer → API paths: uses endpoints
- Shared API layer → Authoritative backend: HTTP requests