# scionoftech/cloudjoy architecture

> Architecture diagram of the GitHub repository scionoftech/cloudjoy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/scionoftech/cloudjoy
- Repository: https://github.com/scionoftech/cloudjoy

## Overview

CloudJoy is a small Android TV client for Xbox Cloud Gaming: its single Activity configures a fullscreen WebView, loads the official play site, and handles controller and remote navigation. The WebView owns the website interaction, including Microsoft sign-in and gameplay; cookies preserve login, while the Activity manages lifecycle and protected-media permission requests. README documents the required Game Pass account, Bluetooth gamepad, and compatible Android System WebView. The only runtime source shown is MainActivity, so the graph does not infer internal website stages or unsampled integrations.

Main entry points: [`app/src/main/java/com/scionoftech/cloudjoy/MainActivity.kt`](https://github.com/scionoftech/cloudjoy/blob/main/app/src/main/java/com/scionoftech/cloudjoy/MainActivity.kt) (Main Activity)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tv_app["TV client"]
  node_activity["Main Activity<br/>[MainActivity.kt]"]
  node_webview["Configured WebView<br/>[MainActivity.kt]"]
  node_cookie_state[("Login cookies<br/>[MainActivity.kt]")]
end

subgraph group_web_experience["Cloud gaming site"]
  node_xbox_play["Xbox Play website"]
  node_microsoft_signin["Microsoft sign-in"]
  node_cloud_games["Cloud gameplay"]
end

node_player(("TV player"))
node_gamepad(("Bluetooth gamepad"))
node_android_webview["Android System WebView"]

node_player -->|"opens app"| node_activity
node_activity -->|"configures and hosts"| node_webview
node_activity -->|"loads URL"| node_xbox_play
node_webview -->|"renders sign-in"| node_microsoft_signin
node_microsoft_signin -->|"persists login"| node_cookie_state
node_webview -->|"renders gameplay"| node_cloud_games
node_gamepad -->|"browser Gamepad API"| node_cloud_games
node_activity -->|"forwards gamepad BACK"| node_gamepad
node_webview -->|"runs on"| node_android_webview
node_activity -->|"flushes on pause"| node_cookie_state
node_player -->|"pairs with TV"| node_gamepad

click node_activity "https://github.com/scionoftech/cloudjoy/blob/main/app/src/main/java/com/scionoftech/cloudjoy/MainActivity.kt"
click node_webview "https://github.com/scionoftech/cloudjoy/blob/main/app/src/main/java/com/scionoftech/cloudjoy/MainActivity.kt"
click node_cookie_state "https://github.com/scionoftech/cloudjoy/blob/main/app/src/main/java/com/scionoftech/cloudjoy/MainActivity.kt"

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_activity,node_webview,node_cookie_state,node_android_webview toneBlue
class node_xbox_play,node_microsoft_signin,node_cloud_games toneAmber
class node_player,node_gamepad toneIndigo
```

## Components

### TV client

- [Main Activity](https://github.com/scionoftech/cloudjoy/blob/main/app/src/main/java/com/scionoftech/cloudjoy/MainActivity.kt): `app/src/main/java/com/scionoftech/cloudjoy/MainActivity.kt`
- [Configured WebView](https://github.com/scionoftech/cloudjoy/blob/main/app/src/main/java/com/scionoftech/cloudjoy/MainActivity.kt): `app/src/main/java/com/scionoftech/cloudjoy/MainActivity.kt`
- [Login cookies](https://github.com/scionoftech/cloudjoy/blob/main/app/src/main/java/com/scionoftech/cloudjoy/MainActivity.kt): `app/src/main/java/com/scionoftech/cloudjoy/MainActivity.kt`

### Cloud gaming site

- **Xbox Play website**
- **Microsoft sign-in**
- **Cloud gameplay**

### Other components

- **TV player**
- **Bluetooth gamepad**
- **Android System WebView**

## Connections

- TV player → Main Activity: opens app (evidence: `README.md`)
- Main Activity → Configured WebView: configures and hosts (evidence: `app/src/main/java/com/scionoftech/cloudjoy/MainActivity.kt`)
- Main Activity → Xbox Play website: loads URL (evidence: `app/src/main/java/com/scionoftech/cloudjoy/MainActivity.kt`)
- Configured WebView → Microsoft sign-in: renders sign-in (evidence: `README.md`)
- Microsoft sign-in → Login cookies: persists login (evidence: `README.md`)
- Configured WebView → Cloud gameplay: renders gameplay (evidence: `README.md`)
- Bluetooth gamepad → Cloud gameplay: browser Gamepad API (evidence: `README.md`)
- Main Activity → Bluetooth gamepad: forwards gamepad BACK (evidence: `app/src/main/java/com/scionoftech/cloudjoy/MainActivity.kt`)
- Configured WebView → Android System WebView: runs on (evidence: `README.md`)
- Main Activity → Login cookies: flushes on pause (evidence: `app/src/main/java/com/scionoftech/cloudjoy/MainActivity.kt`)
- TV player → Bluetooth gamepad: pairs with TV (evidence: `README.md`)
