Skip to content

sparkoo/csgo-2d-demo-viewer

Repository files navigation

CS2 2D Demo Viewer

A web-based application for visualizing Counter-Strike 2 (CS2) demo files in 2D.

Project Components

Parser (parser/)

Written in Go, built into WebAssembly.

Using CS demo parser library https://github.com/markus-wa/demoinfocs-golang ❤️

Frontend (web/)

Written in JavaScript using Preact.

  • Homepage component at web/src/Index (only static page, nothing interesting here)
  • Player component at web/src/Player

Player is using parser webassembly to parse the binary demo. It then stores received data from the parser into the memory and plays them.

Protocol Buffers ( protos/)

Custom message format to send demo data between parser and the Player application.

Backend (server/)

  • Serving of static web content
  • Demo download proxy

Faceit browser plugin (browserplugin/faceit/)

Adds several buttons to Faceit interface to play the demo. Internaly it resolves the real demo URL and opens player link with the demo url in parameter. Works for Firefox and Chrome-based browsers.

Container

Whole application is built into container and deployed to GCP. Everything is server by Go server.

CI/CD (.github/workflows/)

Using GitHub Actions

GitHub Copilot Agents (.github/agents/)

Specialized agents provide expert guidance for different areas of the codebase:

  • Go Parser Specialist - WebAssembly parser development
  • Frontend Specialist - Preact/JavaScript UI and visualization
  • Server Specialist - Go HTTP server and proxying
  • Build & CI Specialist - Build processes and GitHub Actions
  • Browser Plugin Specialist - Browser extension and FACEIT integration
  • Agent Writer Specialist - Meta agent for creating/maintaining agents

See .github/agents/README.md for details on using these agents.

Development

Makefile to ease the development.

To build the Parser WebAssembly

make wasm

To run the frontend (together with wasm, it is enough to develop a Player with manual upload)

make dev

To run the server (runs the server in dev mode, which enables local testing using url like http://localhost:5173/player?demourl=http://localhost:8080/testdemos/1-6e537ed7-b125-44f8-add6-14e814af55a6-1-1.dem.zst)

make server