# 🔬 FUT.GG Complete Technical Architecture, Stack, Endpoints & DNS Reverse Engineering

> **Ecosystem:** `@aphrody/fut` — BXC Monorepo  
> **Target:** `https://www.fut.gg`  
> **Investigation Date:** September 2026 (EA SPORTS FC 27 Season)  
> **Status:** Verified Live via BXC Impersonated Prober

---

## 1. Executive Summary & Technology Stack

FUT.GG is built on a cutting-edge modern TypeScript stack, moving away from legacy monolithic SSR toward streaming edge-rendered architectures with TanStack Router.

```mermaid
flowchart TD
    subgraph Client ["Frontend Client (Browser)"]
        UI["React 19 + Tailwind CSS"]
        ROUTER["TanStack Router (ESM Chunks)"]
        HYDRATE["Seroval Stream De-serializer ($tsr)"]
    end

    subgraph Edge ["Edge & CDN Layer (Cloudflare)"]
        CF_EDGE["Cloudflare Edge Workers"]
        CF_CACHE["Cloudflare Cache (Tiered Cache)"]
        WAF["Cloudflare WAF / Managed Rules"]
    end

    subgraph Backend ["Origin & Compute Infrastructure"]
        ORIGIN["AWS ECS (Fargate Container Cluster)"]
        FAST_API["REST v2 Internal API (Python/FastAPI or Go)"]
        IMG_PIPE["Cloudflare Image Resizer / media.fut.gg"]
        DB["PostgreSQL / ClickHouse (Historical Prices)"]
        REDIS["Redis Cache Cluster (Market Tick Prices)"]
    end

    Client -->|HTTP/2 & HTTP/3| CF_EDGE
    CF_EDGE --> CF_CACHE
    CF_CACHE -->|Cache Miss| ORIGIN
    ORIGIN --> FAST_API
    FAST_API --> DB
    FAST_API --> REDIS
    UI -->|Image Fetch| IMG_PIPE
```

### 1.1 Stack Breakdown

| Layer | Technology | Details / Versions |
| :--- | :--- | :--- |
| **Frontend Framework** | React 19 + TanStack Router | Pure ESM modules, dynamic chunk imports |
| **Build Tooling** | Rolldown + Vite | `<meta name="build-variant" content="rolldown-vite"/>` |
| **Styling & CSS** | Tailwind CSS v3/v4 | Bundled into `https://assets.fut.gg/ts/assets/app-*.css` |
| **Typography** | Google Fonts | `Mrs Saint Delafield` (handwritten cursive) & `Red Hat Display` (sans-serif) |
| **Streaming SSR** | Seroval (`$tsr-stream-barrier`) | Zero-latency HTML stream with embedded JSON state |
| **Edge CDN** | Cloudflare Enterprise | HTTP/3 (QUIC) enabled, `cf-cache-status`, TLS 1.3 |
| **Image CDN** | Cloudflare Images | `https://media.fut.gg/cdn-cgi/image/width=...,fit=cover,format=auto/...` |
| **Ad / Analytics** | Uniconsent CMP + Stormstrike Bidstorm | `cmp.uniconsent.com`, `bidstorm.stormstrike.gg` |

---

## 2. DNS Infrastructure & Network Topology

### 2.1 Host Registry & IP Allocation

| Hostname | Role | IP / Anycast Routing | CDN / Provider |
| :--- | :--- | :--- | :--- |
| `www.fut.gg` | Primary Web Portal & SSR | `104.18.4.135`, `104.18.5.135` | Cloudflare Edge |
| `api.fut.gg` | REST API Gateway | `104.18.4.135`, `104.18.5.135` | Cloudflare Edge -> Origin Gateway |
| `assets.fut.gg` | Static JS/CSS Bundles | Cloudflare Edge / R2 Bucket | Immutable cache (`max-age=31536000`) |
| `media.fut.gg` | Player Portraits & Badges | Cloudflare Image Pipeline | Auto WebP/AVIF transcoding |
| `images.fut.gg` | Community uploads & Squads | Cloudflare Images | User-generated assets |

### 2.2 Live Headers Analysis

```http
HTTP/2 200 OK
date: Thu, 17 Sep 2026 09:15:14 GMT
content-type: text/html; charset=utf-8
cache-control: s-maxage=1800, no-store
content-language: en
vary: Accept-Language, Accept-Encoding, Origin
cf-cache-status: MISS (or HIT on static routes)
server: cloudflare
cf-ray: a3c701593993dc3e-ATL
alt-svc: h3=":443"; ma=86400
```

---

## 3. Frontend Architecture: TanStack Router & Seroval Hydration

FUT.GG streams server-rendered HTML while injecting the application state at the bottom of the document using Seroval:

```html
<script>$tsr=new Map();$tsr.set("/players/27-1001-mbappe",{data:{...}});</script>
<!--$-->
<div id="player-view">...</div>
<!--/$-->
<script>$tsr_stream_barrier()</script>
```

### Extraction Advantage for `@aphrody/fut`:
Unlike regular HTML scraping that requires fragile CSS selector querying, the Seroval stream block contains **100% pure typed JSON** of all in-game stats, PlayStyles+, Roles++, and live transfer market prices. BXC extracts this in <2ms without headless browser overhead!

---

## 4. Complete Catalog of FUT.GG Internal & Public Endpoints

### 4.1 Player APIs
- `GET https://www.fut.gg/api/fut/27/players/` : Filtered player database query.
- `GET https://www.fut.gg/api/fut/27/players/:id/` : Full player item detail (stats, roles, traits).
- `GET https://www.fut.gg/api/fut/27/players/:id/price/` : Live market price on PS, Xbox, and PC.
- `GET https://www.fut.gg/api/fut/27/players/:id/price-history/` : Historical price chart points (hourly, daily).
- `GET https://www.fut.gg/api/fut/search/?q=:query` : Global autocomplete for players, clubs, and SBCs.

### 4.2 Squad Building Challenges (SBC) APIs
- `GET https://www.fut.gg/api/fut/sbc/27/categories/` : All active SBC categories (Live, Icons, Upgrades).
- `GET https://www.fut.gg/api/fut/sbc/27/` : Active SBC sets with cost and expiry.
- `GET https://www.fut.gg/api/fut/sbc/27/:slug/` : Specific SBC set requirements and challenges.
- `GET https://www.fut.gg/api/fut/sbc/27/challenge/:id/` : Individual challenge requirements and cheapest solutions.

### 4.3 Evolutions APIs
- `GET https://www.fut.gg/api/fut/evolutions/27/` : Active evolutions list with coin/FP entry cost.
- `GET https://www.fut.gg/api/fut/evolutions/27/:slug/` : Evolution requirements, stat boosts, and eligible cards.

### 4.4 Market & Fodder Index
- `GET https://www.fut.gg/api/fut/market/fodder/` : Live prices by rating tier (82 to 91+).
- `GET https://www.fut.gg/api/fut/market/trends/` : Trending market movers and percentage gainers.
