PrimeCache - FiveM Resource CDN Distribution Platform

About
A multi-node CDN caching and distribution SaaS built specifically for FiveM game servers. PrimeCache sits between the FiveM server and its players: when a player joins, resource downloads hit the dashboard's `/api/serve/` endpoint, which geo-routes them to the nearest healthy cache node via a 302 redirect. Resources are pre-synced from the dashboard to assigned nodes, players download at full edge speed, and join times drop from 10+ minutes to under 60 seconds.
The platform is a tiered subscription product — Free / Starter / Pro / Enterprise — with per-plan limits on nodes, bandwidth, storage, speed, and clients. Built as a turborepo monorepo: a Next.js 15 + Prisma dashboard (admin panel for the operator, client portal for FiveM hosts), a TypeScript node-agent that runs on each cache VPS reporting CPU/RAM/disk/bandwidth via WebSocket, and a custom load balancer that measures actual download counts to redistribute clients across nodes every 60s. Includes IP filtering, rate limiting, security alerts (bandwidth spikes, Tor exit nodes, auth failures), full audit log, real-time WebSocket metrics, one-command remote node deployment over SSH, and Cloudflare DNS integration. Closed source — built for a private hosting client.
Features
- Geo-routed CDN endpoint — `/api/serve/[file]` redirects each player to the nearest healthy cache node
- Drops player join times from 10+ minutes to under 60 seconds
- Multi-tenant SaaS with 4-tier plans (Free / Starter / Pro / Enterprise) and per-plan resource limits
- Demand-based auto-rebalancer — runs every 60s using real download counts, not fake player counts
- Real-time node metrics over WebSocket — CPU, RAM, disk, network TX/RX, nginx bandwidth, active connections
- One-command remote node deployment via SSH from the admin panel
- Resource upload + delta sync from dashboard to all assigned nodes with progress tracking
- Multi-region: nodes tagged eu-west / eu-central / us-east / us-west / asia-east / asia-west
- Security alerts — bandwidth spikes, Tor exit nodes, auth failures, rate-limit hits, with severity levels
- IP whitelist/blacklist (CIDR support), per-client and global rate-limit configs, burst limits
- Auto-purge of old metrics (30d), logs (90d), and resolved alerts (60d)
- Full audit log of every admin action with IP address and entity references
- Client portal: clients add their FiveM servers, upload resources, drop one `set adhesive_cdnKey` line in `server.cfg`
- Plan enforcement on bandwidth, storage, max clients, max nodes, and max speed
- NextAuth with Discord OAuth, Google OAuth, and email/password — JWT sessions
- Cloudflare DNS hooks — provision subdomains for new cache nodes automatically
- Activity log with running/pending/completed/failed states for uploads, syncs, deploys, speed tests
- Public landing + pricing + FAQ pages — SaaS-ready storefront