Skip to content

PBug90/magic-sentry

Repository files navigation

Magic Sentry

Magic Sentry

Deployed at magicsentry.pro

Live WarCraft III game intelligence — a monorepo containing three applications that work together to capture, stream, and visualise real-time game data.

Applications

Package Stack Description
cli Rust · Windows Reads live game data from WC3 shared memory, writes JSON snapshots to disk, and streams incremental patches to the web server
web TypeScript · Hono · React Receives patches from the CLI, reconstructs full game records, and exposes a JSON API for viewers
twitch-extension TypeScript · React · Vite Twitch video overlay that polls the live API and renders interactive charts for heroes, resources, food, and army composition

Supporting packages

These workspace packages are shared by the applications above rather than deployed on their own:

Package Description
shared Game-record schema (Zod), patch protocol, chart helpers, and fight/timeline detection
viewer Reusable React panels and charts rendered by both the web viewer and the Twitch overlay
wc3data Warcraft III reference data (units, heroes, items, upgrades, abilities) and its SLK refresh pipeline

Quick start

CLI

See cli/README.md for full usage.

magic-sentry.exe

Place a magic-sentry.toml next to the executable to enable HTTP streaming:

endpoint = "https://your-server.example.com/api/ingest"
secret   = "your-cli-token"   # token generated in the web UI → Settings

Web server

cd web
npm start

Local development

Prerequisites

  • Node.js 22+
  • Docker (for Postgres)
  • Rust with the x86_64-pc-windows-msvc target (CLI only, Windows)

Web server

# 1. Install dependencies
npm install

# 2. Start Postgres
docker compose up -d

# 3. Configure environment
cp web/.env.example web/.env
# Edit web/.env — fill in TWITCH_CLIENT_ID and TWITCH_CLIENT_SECRET
# Create a Twitch app at https://dev.twitch.tv/console and add
# http://localhost:3000/auth/twitch/callback as an OAuth redirect URL.

# 4. Start the dev server
npm run dev:web

The web UI is available at http://localhost:3000.

Building

# Rust CLI (Windows target)
cargo build --release --target x86_64-pc-windows-msvc -p magic-sentry

# All JS/TS packages
npm install
npm run build:all

Testing

# CLI integration tests (Windows)
cargo test -p magic-sentry

# TypeScript type-checking
npm run typecheck:extension
npm run typecheck:viewer
npm run typecheck:web

About

Magic Sentry - WarCraft III Live Game Data Tracker

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors