DEV Community

Cover image for How I Built a Game-Agnostic Platform With 11 Modules Using Next.js 15 and FastAPI
Predrag Mitrovic
Predrag Mitrovic

Posted on

How I Built a Game-Agnostic Platform With 11 Modules Using Next.js 15 and FastAPI

Last year I had a simple question: why does every game community rely on 5-10 disconnected tools? Reddit for discussion, Canva for thumbnails, OBS for clips, Google Maps knockoffs for locations, Discord for squads. None of it built for a specific game.

So I built ViceForge (https://viceforge.app) — a single platform with 11 modules that can be deployed for any game from one config file. Here's the technical deep-dive into how it works.

The Architecture

Frontend: Next.js 15 + React 19 (App Router, Server Components) Backend: FastAPI + Python 3.12 (async, type-safe API) Database: PostgreSQL 16 + pgvector Storage: Cloudflare R2 (zero egress costs) AI Pipeline: GPT-4o, Whisper, FFmpeg on Modal GPU infrastructure

The Game-Agnostic Trick
This was the hardest architectural decision. I wanted to deploy the same codebase for GTA 6 and Red Dead Redemption without writing new code.

The solution: a template system in the admin backoffice. One JSON config controls:

  • Color palette and branding
  • Game name and metadata
  • Module visibility (enable/disable per game)
  • Map tiles and coordinate system
  • AI companion personality and knowledge base

he result? Two live instances running right now:

GTA 6: https://viceforge.app Red Dead: https://rddm.viceforge.app

Same Docker container. Different config. Zero new engineering.

ViceForge for Red Dead - live at rddm.viceforge.app:
ViceForge for Red Dead - live at rddm.viceforge.app:

Same codebase, different game — FrontierForge for GTA6 at viceforge.app:
Same codebase, different game — FrontierForge for GTA6 at viceforge.app:

The AI Clip Pipeline (The Hard Part)
This is the module I'm most proud of. Upload raw gameplay, get 5 TikTok-ready clips in under 3 minutes.

Here's the actual pipeline:

  1. Upload — Video goes to Cloudflare R2. We chose R2 over S3 for zero egress costs — critical when you're processing HD/4K video.
  2. AI Scene Analysis — GPT-4o Vision analyzes the gameplay and identifies the most engaging moments. It looks for action sequences, funny moments, impressive plays.
  3. FFmpeg Processing — Modal GPU spins up an FFmpeg container. Cuts the highlights, renders in the selected format (horizontal, vertical, or both), applies watermark.
  4. Whisper Captions — OpenAI Whisper generates accurate captions. We offer 6 caption styles: Bold, Classic, Neon, Minimal, Shadow, Outline.
  5. Publish — Clips land on ViceForge TV with AI-generated titles, tags, and virality scores.

Cost per clip: ~$0.05 (processing + AI moderation). We charge €0.50. That's 90% margin.

The 11 Modules

There's nothing fancy about any individual module. The power is in having them all connected in one platform with shared auth, shared data, and a unified UX.

  • AI Clips — GPT-4o, FFmpeg, Whisper, Modal GPU
  • ViceForge TV — Content feed with YouTube + TikTok layout, HLS streaming
  • Trend Radar — Scrapes YouTube/TikTok/Reddit/Twitter every 4 hours
  • Interactive Map — Leaflet.js, PostGIS, custom tiles, community-submitted locations
  • AI Companion — In-character NPC chatbot with RAG, pgvector embeddings
  • Predictions — Community voting with leaderboards
  • Academy — Wiki-style guides with rich text editor
  • Squad Finder — Matchmaking by skill, platform, playstyle
  • RP Servers — Server management dashboard with Discord bot integration
  • Developer API — FastAPI auto-docs, rate limiting, 4 pricing tiers
  • Backoffice — Multi-game CMS with template system

*Database Design: PostgreSQL for Everything
*

We considered MongoDB but went all-in on PostgreSQL:

  • pgvector for AI Companion embeddings (RAG search)
  • PostGIS for map coordinates and spatial queries
  • tsvector for full-text search across all modules
  • JSONB for flexible game config storage

One database engine. No extra infrastructure. It handles everything.

*Deployment: Docker + Modal GPU
*

We run a containerized Docker stack with Nginx reverse proxy, SSL termination, and Redis for background job processing with Celery.
AI processing runs on Modal — serverless GPU infrastructure. We only pay for actual clip processing, which keeps our unit economics strong while maintaining the ability to scale horizontally when needed.

What I Learned

  • Don't over-engineer early. A €12 VPS handles more than you think. We'll move to cloud when we need to, not before.
  • PostgreSQL can do everything. Vector search, geospatial queries, full-text search, JSON storage — all in one engine.
  • Game-agnostic from day one was worth it. The template system took 2 extra sprints to build but means every new game is a config change, not a rewrite.
  • AI costs are dropping fast. When we started, clip processing cost $0.30. Now it's $0.05. By launch it'll be even less.

Try It
Both instances are live:

GTA 6: viceforge.app Red Dead: Red Dead

We're 4 founders, self-funded, applying for YC Summer 2026. GTA 6 launches November 19, 2026 — we're building the infrastructure before 40 million players show up.

Questions? Drop a comment. Happy to go deeper on any part of the stack.

Top comments (0)