# furmanovvitaliy/self-hosted-cloud-gaming-service architecture

> Architecture diagram of the GitHub repository furmanovvitaliy/self-hosted-cloud-gaming-service, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/furmanovvitaliy/self-hosted-cloud-gaming-service
- Repository: https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service

## Overview

Pixel Cloud is a self-hosted cloud-gaming service: users browse a game library, authenticate, join rooms, and play games streamed from server-managed game environments. The graph shows the web router and input controls, plus the server’s documented composition of game, user, scanner, streaming, and VM services. Several backend runtime links are based on the composition root; internal use-case and route behavior was not sampled, so those details are not expanded.

Main entry points: [`server/cmd/app/app.go`](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/server/cmd/app/app.go) (Application composition), [`server/internal/core/hub`](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/tree/development/server/internal/core/hub) (Room hub), [`web/src/app/app.ts`](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/web/src/app/app.ts) (Web router), [`web/src/components/templates/input.ts`](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/web/src/components/templates/input.ts) (Gamepad input)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web client"]
  node_webapp["Web router<br/>[app.ts]"]
  node_webpages["Pages"]
  node_webapi["API clients<br/>[api.ts]"]
  node_authapi["Auth client<br/>[auth.ts]"]
  node_input["Gamepad input<br/>[input.ts]"]
  node_gamepadkbd["Gamepad keyboard"]
  node_webstream["WebRTC client<br/>[webrtc.ts]"]
  node_bootstrap["Web bootstrap<br/>[main.tsx]"]
end

subgraph group_server["Server runtime"]
  node_app["Application composition<br/>[app.go]"]
  node_http["HTTP server<br/>[server.go]"]
  node_routes["HTTP API routes"]
  node_usecases["Use cases"]
  node_mongo[("MongoDB")]
end

subgraph group_domain["Game and identity"]
  node_games["Game catalog"]
  node_users["User accounts"]
  node_scanner["Game scanner"]
  node_igdb["IGDB metadata<br/>[igdb.go]"]
end

subgraph group_gaming["Game streaming"]
  node_hub["Room hub"]
  node_vm["Game VM containers<br/>[service.go]"]
  node_display["Virtual displays"]
  node_srm["Resource manager<br/>[srm.go]"]
  node_streamer["WebRTC streamer<br/>[service.go]"]
  node_broker["WebSocket broker"]
end

node_user(("Player"))

node_user -->|"navigates"| node_webapp
node_webapp -->|"renders"| node_webpages
node_webapp -->|"clears focus"| node_input
node_bootstrap -->|"starts router"| node_webapp
node_bootstrap -->|"starts handling"| node_input
node_authapi -->|"extends"| node_webapi
node_input -->|"loads keyboard"| node_gamepadkbd
node_app -->|"connects"| node_mongo
node_app -->|"initializes client"| node_igdb
node_app -->|"creates storage"| node_games
node_app -->|"creates storage"| node_users
node_app -->|"creates service"| node_scanner
node_app -->|"creates service"| node_display
node_app -->|"creates service"| node_srm
node_app -->|"creates service"| node_hub
node_app -->|"creates service"| node_streamer
node_app -->|"creates service"| node_vm
node_app -->|"assembles"| node_usecases
node_app -->|"creates handler"| node_routes
node_app -->|"starts server"| node_http
node_http -->|"registers routes"| node_routes
node_webapi -.->|"calls API"| node_routes
node_webstream -.->|"negotiates stream"| node_streamer
node_input -.->|"sends controls"| node_hub
node_hub -.->|"starts game VM"| node_vm
node_hub -.->|"relays media"| node_streamer
node_hub -.->|"uses messaging"| node_broker

click node_webapp "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/web/src/app/app.ts"
click node_webpages "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/tree/development/web/src/pages"
click node_webapi "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/web/src/api/api.ts"
click node_authapi "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/web/src/api/auth.ts"
click node_input "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/web/src/components/templates/input.ts"
click node_gamepadkbd "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/web/src/components/templates/gamepad-keyboard.jsx"
click node_webstream "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/web/src/components/templates/webrtc.ts"
click node_bootstrap "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/web/src/main.tsx"
click node_app "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/server/cmd/app/app.go"
click node_http "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/server/pkg/http/server.go"
click node_routes "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/tree/development/server/internal/handler/http/api/v1"
click node_usecases "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/tree/development/server/internal/usecase"
click node_games "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/tree/development/server/internal/domain/game"
click node_users "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/tree/development/server/internal/domain/user"
click node_scanner "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/tree/development/server/internal/core/scanner"
click node_igdb "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/server/internal/adapters/igdb/igdb.go"
click node_hub "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/tree/development/server/internal/core/hub"
click node_vm "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/server/internal/infrastructure/docker/service.go"
click node_display "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/tree/development/server/internal/infrastructure/display"
click node_srm "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/server/internal/core/srm/srm.go"
click node_streamer "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/server/internal/infrastructure/wrtc/service.go"
click node_broker "https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/server/internal/infrastructure/broker/websocket_broker.go"

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_webapp,node_webpages,node_webapi,node_authapi,node_input,node_gamepadkbd,node_webstream,node_bootstrap toneBlue
class node_app,node_http,node_routes,node_usecases,node_mongo toneAmber
class node_games,node_users,node_scanner,node_igdb toneMint
class node_hub,node_vm,node_display,node_srm,node_streamer,node_broker toneRose
class node_user toneIndigo
```

## Components

### Web client

- [Web router](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/web/src/app/app.ts): `web/src/app/app.ts`
- [Pages](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/tree/development/web/src/pages): `web/src/pages`
- [API clients](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/web/src/api/api.ts): `web/src/api/api.ts`
- [Auth client](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/web/src/api/auth.ts): `web/src/api/auth.ts`
- [Gamepad input](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/web/src/components/templates/input.ts): `web/src/components/templates/input.ts`
- [Gamepad keyboard](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/web/src/components/templates/gamepad-keyboard.jsx): `web/src/components/templates/gamepad-keyboard.jsx`
- [WebRTC client](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/web/src/components/templates/webrtc.ts): `web/src/components/templates/webrtc.ts`
- [Web bootstrap](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/web/src/main.tsx): `web/src/main.tsx`

### Server runtime

- [Application composition](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/server/cmd/app/app.go): `server/cmd/app/app.go`
- [HTTP server](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/server/pkg/http/server.go): `server/pkg/http/server.go`
- [HTTP API routes](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/tree/development/server/internal/handler/http/api/v1): `server/internal/handler/http/api/v1`
- [Use cases](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/tree/development/server/internal/usecase): `server/internal/usecase`
- **MongoDB**

### Game and identity

- [Game catalog](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/tree/development/server/internal/domain/game): `server/internal/domain/game`
- [User accounts](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/tree/development/server/internal/domain/user): `server/internal/domain/user`
- [Game scanner](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/tree/development/server/internal/core/scanner): `server/internal/core/scanner`
- [IGDB metadata](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/server/internal/adapters/igdb/igdb.go): `server/internal/adapters/igdb/igdb.go`

### Game streaming

- [Room hub](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/tree/development/server/internal/core/hub): `server/internal/core/hub`
- [Game VM containers](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/server/internal/infrastructure/docker/service.go): `server/internal/infrastructure/docker/service.go`
- [Virtual displays](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/tree/development/server/internal/infrastructure/display): `server/internal/infrastructure/display`
- [Resource manager](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/server/internal/core/srm/srm.go): `server/internal/core/srm/srm.go`
- [WebRTC streamer](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/server/internal/infrastructure/wrtc/service.go): `server/internal/infrastructure/wrtc/service.go`
- [WebSocket broker](https://github.com/furmanovvitaliy/self-hosted-cloud-gaming-service/blob/development/server/internal/infrastructure/broker/websocket_broker.go): `server/internal/infrastructure/broker/websocket_broker.go`

### Other components

- **Player**

## Connections

- Player → Web router: navigates (evidence: `web/src/app/app.ts`)
- Web router → Pages: renders (evidence: `web/src/app/app.ts`)
- Web router → Gamepad input: clears focus (evidence: `web/src/app/app.ts`)
- Web bootstrap → Web router: starts router (evidence: `web/src/main.tsx`)
- Web bootstrap → Gamepad input: starts handling (evidence: `web/src/main.tsx`)
- Auth client → API clients: extends (evidence: `web/src/api/auth.ts`)
- Gamepad input → Gamepad keyboard: loads keyboard (evidence: `web/src/components/templates/input.ts`)
- Application composition → MongoDB: connects (evidence: `server/cmd/app/app.go`)
- Application composition → IGDB metadata: initializes client (evidence: `server/cmd/app/app.go`)
- Application composition → Game catalog: creates storage (evidence: `server/cmd/app/app.go`)
- Application composition → User accounts: creates storage (evidence: `server/cmd/app/app.go`)
- Application composition → Game scanner: creates service (evidence: `server/cmd/app/app.go`)
- Application composition → Virtual displays: creates service (evidence: `server/cmd/app/app.go`)
- Application composition → Resource manager: creates service (evidence: `server/cmd/app/app.go`)
- Application composition → Room hub: creates service (evidence: `server/cmd/app/app.go`)
- Application composition → WebRTC streamer: creates service (evidence: `server/cmd/app/app.go`)
- Application composition → Game VM containers: creates service (evidence: `server/cmd/app/app.go`)
- Application composition → Use cases: assembles (evidence: `server/cmd/app/app.go`)
- Application composition → HTTP API routes: creates handler (evidence: `server/cmd/app/app.go`)
- Application composition → HTTP server: starts server (evidence: `server/cmd/app/app.go`)
- HTTP server → HTTP API routes: registers routes (evidence: `server/pkg/http/server.go`)
- API clients → HTTP API routes: calls API
- WebRTC client → WebRTC streamer: negotiates stream
- Gamepad input → Room hub: sends controls
- Room hub → Game VM containers: starts game VM
- Room hub → WebRTC streamer: relays media
- Room hub → WebSocket broker: uses messaging
