Files
TSSBOT-web/backend
deploy 65ad10ad11 align backend with TSS schema: drop SRE-specific fields, fix cross-tournament queries
- Remove teams_points, clanrating, tag/short/long name, description, region,
  guild_id, clan_id — none of these exist in the TSS DB schema
- Rename long_name → name throughout (TSS teams have one name, not long+short)
- Cross-tournament stat queries now use team_name (string) from player_games_hist
  instead of team_id, since team_id is assigned per-tournament by Spectra
- Leaderboard deduplicates teams_data by name with GROUP BY, MAX(team_id) for roster ref
- team_members roster still uses team_id (correct within a single tournament)
- Fix player_teams_for: was grouping by non-existent team_tag column, now team_id
- Fix games_for: winning_team/losing_team → winning_slot/losing_slot; add mission_name
- Remove joined_unix, points, sqb_points from PlayerSummary; nick resolved from battles_db
- Remove rating_hourly from HistoryResponse (teams_points never existed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 01:07:57 +00:00
..
2026-05-29 18:55:56 +01:00
2026-05-29 18:55:56 +01:00
2026-05-29 21:56:12 +01:00

tssbot backend

Rust backend API service for Toothless' TSS Bot.

It reads two SQLite databases:

  • TSS_BATTLES_DB for tss_battles.db
  • TSS_TEAMS_DB for tss_teams.db
  • BACKEND_HOST bind host, default 127.0.0.1
  • BACKEND_ALLOWED_ORIGINS comma-separated browser origins allowed by CORS

Both paths can be absolute or relative to the repo root when run through the root scripts/PM2.

It currently exposes:

  • GET /health
  • GET /api/tss/leaderboard/teams?limit=100
  • GET /api/tss/teams/resolve?name=...
  • GET /api/tss/teams/search?q=...&limit=10
  • GET /api/tss/teams/:team
  • GET /api/tss/teams/:team/history
  • GET /api/tss/teams/:team/games

Local development

npm run dev:backend

The backend listens on http://127.0.0.1:6000 by default. Override with BACKEND_PORT and BACKEND_HOST.

Production build

npm run build:backend