# gixakickflight/kick-flight-private-server architecture

> Architecture diagram of the GitHub repository gixakickflight/kick-flight-private-server, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gixakickflight/kick-flight-private-server
- Repository: https://github.com/gixakickflight/kick-flight-private-server

## Overview

Kick Flight: The Fenix Returns is a community private server for the Android game. The main workflow is client requests to the compatibility API, which handles game sessions and matchmaking, persists player state, and directs matches to the separate Photon server; clients also fetch game resources from the CDN. The README documents these service boundaries and the catalog/CDN and APK-preparation capabilities. Some runtime wiring is visible in the API excerpts and source index; unsampled deployment and data-generation internals are represented only at the documented subsystem level.

Main entry points: [`src/KickFlight.BootstrapApi/Program.cs`](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/Program.cs) (API Host), [`src/KickFlight.BootstrapApi/DemoSessionApi.cs`](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/DemoSessionApi.cs) (Game Sessions), [`src/KickFlight.BootstrapApi/PlayerStore/IPlayerStore.cs`](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/PlayerStore/IPlayerStore.cs) (Player Store), [`src/KickFlight.BootstrapApi/PlayerStore/PlayerStoreFactory.cs`](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/PlayerStore/PlayerStoreFactory.cs) (Store Selection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Compatibility API"]
  node_program["API Host<br/>[Program.cs]"]
  node_session["Game Sessions<br/>[DemoSessionApi.cs]"]
  node_codec["D2C Codec<br/>[D2CCodec.cs]"]
  node_capture["Request Capture"]
  node_inspector["Safe Inspector"]
  node_maintenance["Maintenance State"]
  node_updates["Client Updates"]
end

subgraph group_game["Game Services"]
  node_matchmaking["Matchmaking"]
  node_photon["Photon Server"]
  node_photonhealth["Photon Health"]
end

subgraph group_state["Player State"]
  node_playerstate["Session State<br/>[SessionState.cs]"]
  node_storeinterface["Player Store<br/>[IPlayerStore.cs]"]
  node_storefactory["Store Selection"]
  node_postgres[("PostgreSQL Store")]
  node_jsonstore[("JSON Store<br/>[JsonPlayerStore.cs]")]
end

subgraph group_content["Game Content"]
  node_fixtures[("Fixtures<br/>[FixtureStore.cs]")]
  node_resources["Resource Catalog"]
  node_catalog["Resource Catalog Data<br/>[catalog.json]"]
  node_cdn[("Game CDN")]
  node_catalogtool["Catalog Generator"]
  node_cdntool["CDN Builder<br/>[build-cdn-tree.py]"]
  node_apktool["APK Preparation"]
end

node_client(("Android Client"))

node_client -->|"API requests"| node_program
node_client -->|"plays matches"| node_photon
node_client -->|"downloads resources"| node_cdn
node_program -->|"routes requests"| node_session
node_program -->|"registers service"| node_matchmaking
node_program -->|"creates store"| node_storefactory
node_program -->|"registers fixtures"| node_fixtures
node_program -->|"registers catalog"| node_resources
node_program -->|"registers middleware"| node_capture
node_program -->|"registers inspector"| node_inspector
node_program -->|"registers state"| node_maintenance
node_program -->|"registers state"| node_updates
node_program -->|"registers manager"| node_photonhealth
node_session -->|"loads player data"| node_storeinterface
node_session -->|"manages battle entry"| node_matchmaking
node_session -->|"checks mode"| node_maintenance
node_session -->|"checks versions"| node_updates
node_session -->|"encodes payloads"| node_codec
node_storefactory -->|"selects configured"| node_postgres
node_storefactory -->|"selects fallback"| node_jsonstore
node_postgres -->|"implements"| node_storeinterface
node_jsonstore -->|"implements"| node_storeinterface
node_storeinterface -->|"loads and saves"| node_playerstate
node_photonhealth -->|"checks ports"| node_photon
node_resources -->|"reads definitions"| node_catalog
node_program -->|"serves resources"| node_resources
node_catalogtool -->|"updates catalog"| node_catalog
node_cdntool -->|"builds from"| node_catalog
node_cdntool -->|"rebuilds tree"| node_cdn
node_apktool -->|"patches endpoint"| node_client

click node_program "https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/Program.cs"
click node_session "https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/DemoSessionApi.cs"
click node_codec "https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/D2CCodec.cs"
click node_capture "https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/RequestCaptureMiddleware.cs"
click node_inspector "https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/SafeRequestInspector.cs"
click node_maintenance "https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/MaintenanceState.cs"
click node_updates "https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/ClientUpdateState.cs"
click node_matchmaking "https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/BattleMatchmakingService.cs"
click node_photon "https://github.com/gixakickflight/kick-flight-private-server/tree/main/submodules/luxonserver"
click node_photonhealth "https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/PhotonServerManager.cs"
click node_playerstate "https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/SessionState.cs"
click node_storeinterface "https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/PlayerStore/IPlayerStore.cs"
click node_storefactory "https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/PlayerStore/PlayerStoreFactory.cs"
click node_postgres "https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/PlayerStore/PostgresPlayerStore.cs"
click node_jsonstore "https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/PlayerStore/JsonPlayerStore.cs"
click node_fixtures "https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/FixtureStore.cs"
click node_resources "https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/ResourceCatalogStore.cs"
click node_catalog "https://github.com/gixakickflight/kick-flight-private-server/blob/main/config/resources/catalog.json"
click node_cdn "https://github.com/gixakickflight/kick-flight-private-server/tree/main/content"
click node_catalogtool "https://github.com/gixakickflight/kick-flight-private-server/blob/main/scripts/build-title-resource-catalog.py"
click node_cdntool "https://github.com/gixakickflight/kick-flight-private-server/blob/main/scripts/build-cdn-tree.py"
click node_apktool "https://github.com/gixakickflight/kick-flight-private-server/blob/main/scripts/patch-il2cpp-endpoints.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_program,node_session,node_codec,node_capture,node_inspector,node_maintenance,node_updates,node_client toneBlue
class node_matchmaking,node_photon,node_photonhealth toneAmber
class node_playerstate,node_storeinterface,node_storefactory,node_postgres,node_jsonstore toneMint
class node_fixtures,node_resources,node_catalog,node_cdn,node_catalogtool,node_cdntool,node_apktool toneRose
```

## Components

### Compatibility API

- [API Host](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/Program.cs): `src/KickFlight.BootstrapApi/Program.cs`
- [Game Sessions](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/DemoSessionApi.cs): `src/KickFlight.BootstrapApi/DemoSessionApi.cs`
- [D2C Codec](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/D2CCodec.cs): `src/KickFlight.BootstrapApi/D2CCodec.cs`
- [Request Capture](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/RequestCaptureMiddleware.cs): `src/KickFlight.BootstrapApi/RequestCaptureMiddleware.cs`
- [Safe Inspector](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/SafeRequestInspector.cs): `src/KickFlight.BootstrapApi/SafeRequestInspector.cs`
- [Maintenance State](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/MaintenanceState.cs): `src/KickFlight.BootstrapApi/MaintenanceState.cs`
- [Client Updates](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/ClientUpdateState.cs): `src/KickFlight.BootstrapApi/ClientUpdateState.cs`

### Game Services

- [Matchmaking](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/BattleMatchmakingService.cs): `src/KickFlight.BootstrapApi/BattleMatchmakingService.cs`
- [Photon Server](https://github.com/gixakickflight/kick-flight-private-server/tree/main/submodules/luxonserver): `submodules/luxonserver`
- [Photon Health](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/PhotonServerManager.cs): `src/KickFlight.BootstrapApi/PhotonServerManager.cs`

### Player State

- [Session State](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/SessionState.cs): `src/KickFlight.BootstrapApi/SessionState.cs`
- [Player Store](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/PlayerStore/IPlayerStore.cs): `src/KickFlight.BootstrapApi/PlayerStore/IPlayerStore.cs`
- [Store Selection](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/PlayerStore/PlayerStoreFactory.cs): `src/KickFlight.BootstrapApi/PlayerStore/PlayerStoreFactory.cs`
- [PostgreSQL Store](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/PlayerStore/PostgresPlayerStore.cs): `src/KickFlight.BootstrapApi/PlayerStore/PostgresPlayerStore.cs`
- [JSON Store](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/PlayerStore/JsonPlayerStore.cs): `src/KickFlight.BootstrapApi/PlayerStore/JsonPlayerStore.cs`

### Game Content

- [Fixtures](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/FixtureStore.cs): `src/KickFlight.BootstrapApi/FixtureStore.cs`
- [Resource Catalog](https://github.com/gixakickflight/kick-flight-private-server/blob/main/src/KickFlight.BootstrapApi/ResourceCatalogStore.cs): `src/KickFlight.BootstrapApi/ResourceCatalogStore.cs`
- [Resource Catalog Data](https://github.com/gixakickflight/kick-flight-private-server/blob/main/config/resources/catalog.json): `config/resources/catalog.json`
- [Game CDN](https://github.com/gixakickflight/kick-flight-private-server/tree/main/content): `content`
- [Catalog Generator](https://github.com/gixakickflight/kick-flight-private-server/blob/main/scripts/build-title-resource-catalog.py): `scripts/build-title-resource-catalog.py`
- [CDN Builder](https://github.com/gixakickflight/kick-flight-private-server/blob/main/scripts/build-cdn-tree.py): `scripts/build-cdn-tree.py`
- [APK Preparation](https://github.com/gixakickflight/kick-flight-private-server/blob/main/scripts/patch-il2cpp-endpoints.py): `scripts/patch-il2cpp-endpoints.py`

### Other components

- **Android Client**

## Connections

- Android Client → API Host: API requests
- Android Client → Photon Server: plays matches
- Android Client → Game CDN: downloads resources
- API Host → Game Sessions: routes requests (evidence: `src/KickFlight.BootstrapApi/Program.cs`)
- API Host → Matchmaking: registers service (evidence: `src/KickFlight.BootstrapApi/Program.cs`)
- API Host → Store Selection: creates store (evidence: `src/KickFlight.BootstrapApi/Program.cs`)
- API Host → Fixtures: registers fixtures (evidence: `src/KickFlight.BootstrapApi/Program.cs`)
- API Host → Resource Catalog: registers catalog (evidence: `src/KickFlight.BootstrapApi/Program.cs`)
- API Host → Request Capture: registers middleware (evidence: `src/KickFlight.BootstrapApi/Program.cs`)
- API Host → Safe Inspector: registers inspector (evidence: `src/KickFlight.BootstrapApi/Program.cs`)
- API Host → Maintenance State: registers state (evidence: `src/KickFlight.BootstrapApi/Program.cs`)
- API Host → Client Updates: registers state (evidence: `src/KickFlight.BootstrapApi/Program.cs`)
- API Host → Photon Health: registers manager (evidence: `src/KickFlight.BootstrapApi/Program.cs`)
- Game Sessions → Player Store: loads player data (evidence: `src/KickFlight.BootstrapApi/DemoSessionApi.cs`)
- Game Sessions → Matchmaking: manages battle entry (evidence: `src/KickFlight.BootstrapApi/DemoSessionApi.cs`)
- Game Sessions → Maintenance State: checks mode (evidence: `src/KickFlight.BootstrapApi/DemoSessionApi.cs`)
- Game Sessions → Client Updates: checks versions (evidence: `src/KickFlight.BootstrapApi/DemoSessionApi.cs`)
- Game Sessions → D2C Codec: encodes payloads (evidence: `src/KickFlight.BootstrapApi/DemoSessionApi.cs`)
- Store Selection → PostgreSQL Store: selects configured (evidence: `src/KickFlight.BootstrapApi/PlayerStore/PlayerStoreFactory.cs`)
- Store Selection → JSON Store: selects fallback (evidence: `src/KickFlight.BootstrapApi/PlayerStore/PlayerStoreFactory.cs`)
- PostgreSQL Store → Player Store: implements (evidence: `src/KickFlight.BootstrapApi/PlayerStore/PostgresPlayerStore.cs`)
- JSON Store → Player Store: implements (evidence: `src/KickFlight.BootstrapApi/PlayerStore/JsonPlayerStore.cs`)
- Player Store → Session State: loads and saves (evidence: `src/KickFlight.BootstrapApi/PlayerStore/IPlayerStore.cs`)
- Photon Health → Photon Server: checks ports (evidence: `src/KickFlight.BootstrapApi/PhotonServerManager.cs`)
- Resource Catalog → Resource Catalog Data: reads definitions (evidence: `src/KickFlight.BootstrapApi/ResourceCatalogStore.cs`)
- API Host → Resource Catalog: serves resources (evidence: `src/KickFlight.BootstrapApi/Program.cs`)
- Catalog Generator → Resource Catalog Data: updates catalog
- CDN Builder → Resource Catalog Data: builds from
- CDN Builder → Game CDN: rebuilds tree
- APK Preparation → Android Client: patches endpoint
