Skip to content

Stat aggregation website/app for video games across different games and platforms

Notifications You must be signed in to change notification settings

lufifraca/Tactix

Repository files navigation

Tactix

A cross-game analytics and coaching platform that helps competitive gamers track performance, identify patterns, and improve through data-driven insights.

Next.js Fastify TypeScript Prisma Tailwind CSS

Features

Multi-Game Support

  • Marvel Rivals - Hero shooter stats via community APIs
  • Valorant - Agent stats via Henrik API
  • Clash Royale - Trophy/battle stats via Supercell API
  • Brawl Stars - Brawler stats via Supercell API
  • Steam Library - Import and track your full game library

Analytics Dashboard

  • Today's Performance - Real-time win rate, K/D/A, and time played
  • Session Intelligence - Best time of day, optimal session length, tilt detection
  • Skill Domains - Cross-game metrics (Mechanics, Aggression, Vitality, etc.)
  • Character Breakdown - Per-hero/agent performance stats
  • Rank Tracking - Historical rank progression with sparkline charts

Gamification

  • Daily Quests - Verifiable stat-based challenges (1 free, 3 for Pro)
  • Streaks & Milestones - Track win streaks and achievement progress
  • Shareable Rewards - Badge + share card generation for completed quests

Infrastructure

  • Real-time Sync - Manual refresh + auto-refresh on stale data
  • Background Polling - Scheduled stat ingestion via BullMQ
  • Subscription System - Stripe integration for Pro tier ($4.99/mo)
  • Error Monitoring - Sentry integration for production

Tech Stack

Layer Technology
Frontend Next.js 14, React 18, Tailwind CSS, Framer Motion
Backend Fastify, Prisma ORM, PostgreSQL
Queue BullMQ, Redis (Upstash)
Storage S3-compatible (MinIO local, Tigris production)
Auth Google OAuth, Steam OpenID
Payments Stripe Checkout + Customer Portal
Monitoring Sentry
Deployment Vercel (web), Render (API), Neon (DB)

Architecture

tactix/
├── apps/
│   ├── web/                 # Next.js dashboard
│   └── mobile/              # Expo React Native (minimal)
├── services/
│   └── api/                 # Fastify API + Prisma + BullMQ worker
├── packages/
│   └── shared/              # Shared Zod schemas and types
├── docker-compose.yml       # Local Postgres + Redis + MinIO
└── render.yaml              # Render deployment config

Local Development

Prerequisites

  • Node.js 20+
  • pnpm 8+
  • Docker (for local infrastructure)

1. Start Infrastructure

pnpm docker:up

This starts:

  • PostgreSQL (port 5432)
  • Redis (port 6379)
  • MinIO S3 (port 9000, console 9001)

2. Install Dependencies

pnpm install

3. Configure Environment

cp .env.example .env

Required variables:

  • JWT_SECRET - Any secure random string
  • DATABASE_URL - Postgres connection string
  • REDIS_URL - Redis connection string
  • GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET - For OAuth

Game API keys (optional for testing):

  • SUPERCELL_API_KEY - For Clash Royale / Brawl Stars
  • HENRIK_API_KEY - For Valorant
  • STEAM_WEB_API_KEY - For Steam library import

4. Run Database Migrations

pnpm --filter @tactix/api db:generate
pnpm --filter @tactix/api db:migrate

5. Start Development Servers

Terminal 1 - API:

pnpm --filter @tactix/api dev

Terminal 2 - Worker (optional):

pnpm --filter @tactix/api worker:dev

Terminal 3 - Web:

pnpm --filter @tactix/web dev

Deployment

Vercel (Frontend)

  1. Connect GitHub repo to Vercel
  2. Set root directory to apps/web
  3. Add environment variables:
    • NEXT_PUBLIC_API_BASE_URL
    • NEXT_PUBLIC_SENTRY_DSN
    • NEXT_PUBLIC_STRIPE_PAYMENT_URL (optional)

Render (Backend)

  1. Use render.yaml for infrastructure-as-code
  2. Or manually create:
    • Web Service for API (services/api)
    • Background Worker for polling
  3. Add all API environment variables

Database

  • Neon recommended for serverless Postgres
  • Run migrations: pnpm --filter @tactix/api db:migrate

API Endpoints

Method Endpoint Description
GET /health Health check
GET /me Current user info
GET /me/library Game library with stats
GET /dashboard Full dashboard data
POST /ingest/refresh Trigger stat sync
POST /link/marvel Link Marvel Rivals account
POST /link/valorant Link Valorant account
POST /link/supercell Link Clash Royale / Brawl Stars
GET /quests Daily quests
POST /billing/checkout Stripe checkout session
POST /webhooks/stripe Stripe webhook handler

Environment Variables

See .env.example for the full list. Key variables:

# Core
JWT_SECRET=
DATABASE_URL=
REDIS_URL=

# OAuth
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
STEAM_WEB_API_KEY=

# Game APIs
SUPERCELL_API_KEY=
HENRIK_API_KEY=

# Stripe (optional)
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
STRIPE_PRICE_ID_MONTHLY=

# Monitoring
SENTRY_DSN=

Development

AI-Assisted Development

This project was built with assistance from Claude (Anthropic's AI assistant). Claude helped with:

  • Feature implementation - Building out dashboard components, quest systems, and analytics displays
  • Bug fixes & debugging - Resolving UI issues like text truncation, color theming, and stat display logic
  • API integrations - Connecting to game APIs (Marvel Rivals, Valorant, Supercell, Steam)
  • Code refactoring - Improving component structure and handling edge cases
  • Stripe integration - Setting up billing portal flows and subscription handling

The collaborative workflow involved iterating on features through conversation, with Claude providing code suggestions and fixes that were reviewed and integrated into the codebase.

License

Private - All rights reserved.

About

Stat aggregation website/app for video games across different games and platforms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages