feat: SSE live fight spectating with spectator count

Enable real-time fight spectating for all live fights (not just human
fights). Multiple spectators can watch simultaneously via SSE. Spectator
count is tracked per-fight and broadcast with every SSE event.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-08 19:46:39 +00:00
co-authored by Claude Opus 4.6
parent a540320901
commit 610e799605
18 changed files with 1555 additions and 397 deletions
+15
View File
@@ -55,8 +55,23 @@ export default defineConfig({
},
}),
],
worker: {
format: 'es', // Required for dynamic import('kokoro-js') inside the TTS worker
},
optimizeDeps: {
// Pre-bundle kokoro-js on first startup so Vite doesn't stall mid-page-load
// discovering it as a new dep. The 4.8MB bundle is cached in node_modules/.vite/deps.
include: ['kokoro-js'],
},
server: {
port: 9101,
headers: {
// Enable SharedArrayBuffer for onnxruntime WASM threads.
// Without these, Kokoro TTS runs single-threaded on the main thread,
// blocking the UI for seconds on every TTS generation.
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'credentialless',
},
proxy: {
'/api': {
target: 'http://localhost:9100',