# fahriadison/nanaplay architecture

> Architecture diagram of the GitHub repository fahriadison/nanaplay, 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/fahriadison/nanaplay
- Repository: https://github.com/fahriadison/nanaplay

## Overview

NanaPlay is an Android GeForce NOW client with a console-style interface, customizable controls, queue and network features, and music/browser/media extras. The main user journey is to open the app, browse and launch a cloud game, then play through the streaming experience; the README documents these capabilities, but the excerpts do not show the complete launch path. The repository also contains substantial OpenNOW desktop/native-streamer and controller-library code, represented separately. Relationships below are limited to explicit README statements and source-index references.

Main entry points: [`native/opennow-streamer/src/gstreamer_pipeline.rs`](https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/gstreamer_pipeline.rs) (WebRTC pipeline), [`native/opennow-streamer/src/gstreamer_liveness.rs`](https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/gstreamer_liveness.rs) (Stream liveness), [`android/app/src/main/java/com/opencloudgaming/opennow/MainActivity.kt`](https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/MainActivity.kt) (App entry), [`native/opennow-streamer/src/sdp.rs`](https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/sdp.rs) (SDP handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_android["Android client"]
  node_activity["App entry<br/>[MainActivity.kt]"]
  node_viewmodel["App state"]
  node_screens["Console UI<br/>[OpenNowScreens.kt]"]
  node_settings["Settings UI"]
  node_keymap["Input mapping<br/>[KeymapMapper.kt]"]
end

subgraph group_play["Streaming experience"]
  node_gfn["GeForce NOW API<br/>[GfnApi.kt]"]
  node_queue["Queue handling"]
  node_network["Network tuning"]
  node_streaming["Stream session<br/>[Streaming.kt]"]
  node_decoder["Video decoder"]
  node_touch["Touch controls"]
end

subgraph group_extras["Media and extras"]
  node_music["Music player<br/>[NanaMusicPlayer.kt]"]
  node_musicservice["Music service"]
  node_browser["Floating browser"]
  node_recording["Stream recording"]
end

subgraph group_desktop["Desktop client"]
  node_desktoplibrary["Controller library"]
  node_libraryevents["Library events"]
  node_libraryderive["Game derivations"]
  node_playtime["Playtime tracking<br/>[usePlaytime.ts]"]
end

subgraph group_native["Native streamer"]
  node_nativeentry["Streamer process<br/>[main.rs]"]
  node_backend["Streamer backend<br/>[backend.rs]"]
  node_gstbackend["GStreamer backend"]
  node_pipeline["WebRTC pipeline"]
  node_gstconfig["Pipeline config"]
  node_gstinput["Stream input<br/>[gstreamer_input.rs]"]
  node_liveness["Stream liveness"]
  node_platform["Platform support"]
  node_transitions["Video transitions"]
  node_protocol["Streamer protocol<br/>[protocol.rs]"]
  node_sdp["SDP handling<br/>[sdp.rs]"]
  node_input["Input encoding<br/>[input.rs]"]
end

node_player(("Player"))

node_player -->|"opens"| node_activity
node_activity -->|"observes state"| node_viewmodel
node_activity -->|"maps keys"| node_keymap
node_player -->|"browses and launches"| node_screens
node_player -->|"waits in queue"| node_queue
node_player -->|"plays on variable networks"| node_network
node_player -->|"plays cloud games"| node_streaming
node_player -->|"customizes controls"| node_touch
node_player -->|"plays music"| node_music
node_musicservice -->|"uses player"| node_music
node_player -->|"opens browser"| node_browser
node_player -->|"records stream"| node_recording
node_desktoplibrary -->|"handles navigation"| node_libraryevents
node_desktoplibrary -->|"derives game lists"| node_libraryderive
node_libraryderive -->|"reads playtime"| node_playtime
node_nativeentry -->|"creates backend"| node_backend
node_nativeentry -->|"dispatches commands"| node_gstbackend
node_gstbackend -->|"manages pipeline"| node_pipeline
node_pipeline -->|"reads configuration"| node_gstconfig
node_pipeline -->|"configures input"| node_gstinput
node_pipeline -->|"uses liveness"| node_liveness
node_pipeline -->|"uses platform support"| node_platform
node_pipeline -->|"uses transitions"| node_transitions
node_pipeline -->|"emits protocol events"| node_protocol
node_pipeline -->|"uses SDP"| node_sdp
node_liveness -->|"configures queues"| node_pipeline
node_liveness -->|"resolves transitions"| node_transitions
node_liveness -->|"emits events"| node_protocol
node_gstinput -->|"encodes input"| node_input
node_sdp -->|"uses input types"| node_input
node_sdp -->|"uses protocol types"| node_protocol

click node_activity "https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/MainActivity.kt"
click node_viewmodel "https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/OpenNowViewModel.kt"
click node_screens "https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/OpenNowScreens.kt"
click node_settings "https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/OpenNowSettingsScreens.kt"
click node_keymap "https://github.com/fahriadison/nanaplay/blob/main/android/keymap/src/main/java/com/papahchan/nanaplay/keymap/KeymapMapper.kt"
click node_gfn "https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/GfnApi.kt"
click node_queue "https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/QueueLaunchStatus.kt"
click node_network "https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/NetworkConditionAdaptor.kt"
click node_streaming "https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/Streaming.kt"
click node_decoder "https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/LowLatencyVideoDecoder.kt"
click node_touch "https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/NativeTouchGames.kt"
click node_music "https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/NanaMusicPlayer.kt"
click node_musicservice "https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/NanaMusicPlaybackService.kt"
click node_browser "https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/NanaBrowserPanel.kt"
click node_recording "https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/AndroidStreamRecorder.kt"
click node_desktoplibrary "https://github.com/fahriadison/nanaplay/blob/main/opennow-stable/src/renderer/src/components/controllerMode/ControllerLibraryPage.tsx"
click node_libraryevents "https://github.com/fahriadison/nanaplay/blob/main/opennow-stable/src/renderer/src/components/controllerMode/controllerLibrary/useControllerLibraryEvents.ts"
click node_libraryderive "https://github.com/fahriadison/nanaplay/blob/main/opennow-stable/src/renderer/src/components/controllerMode/controllerLibrary/useControllerLibraryGameDerivations.ts"
click node_playtime "https://github.com/fahriadison/nanaplay/blob/main/opennow-stable/src/renderer/src/utils/usePlaytime.ts"
click node_nativeentry "https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/main.rs"
click node_backend "https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/backend.rs"
click node_gstbackend "https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/gstreamer_backend.rs"
click node_pipeline "https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/gstreamer_pipeline.rs"
click node_gstconfig "https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/gstreamer_config.rs"
click node_gstinput "https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/gstreamer_input.rs"
click node_liveness "https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/gstreamer_liveness.rs"
click node_platform "https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/gstreamer_platform.rs"
click node_transitions "https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/gstreamer_transitions.rs"
click node_protocol "https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/protocol.rs"
click node_sdp "https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/sdp.rs"
click node_input "https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/input.rs"

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_viewmodel,node_screens,node_settings,node_keymap toneBlue
class node_gfn,node_queue,node_network,node_streaming,node_decoder,node_touch toneAmber
class node_music,node_musicservice,node_browser,node_recording toneMint
class node_desktoplibrary,node_libraryevents,node_libraryderive,node_playtime toneRose
class node_nativeentry,node_backend,node_gstbackend,node_pipeline,node_gstconfig,node_gstinput,node_liveness,node_platform,node_transitions,node_protocol,node_sdp,node_input,node_player toneIndigo
```

## Components

### Android client

- [App entry](https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/MainActivity.kt): `android/app/src/main/java/com/opencloudgaming/opennow/MainActivity.kt`
- [App state](https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/OpenNowViewModel.kt): `android/app/src/main/java/com/opencloudgaming/opennow/OpenNowViewModel.kt`
- [Console UI](https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/OpenNowScreens.kt): `android/app/src/main/java/com/opencloudgaming/opennow/OpenNowScreens.kt`
- [Settings UI](https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/OpenNowSettingsScreens.kt): `android/app/src/main/java/com/opencloudgaming/opennow/OpenNowSettingsScreens.kt`
- [Input mapping](https://github.com/fahriadison/nanaplay/blob/main/android/keymap/src/main/java/com/papahchan/nanaplay/keymap/KeymapMapper.kt): `android/keymap/src/main/java/com/papahchan/nanaplay/keymap/KeymapMapper.kt`

### Streaming experience

- [GeForce NOW API](https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/GfnApi.kt): `android/app/src/main/java/com/opencloudgaming/opennow/GfnApi.kt`
- [Queue handling](https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/QueueLaunchStatus.kt): `android/app/src/main/java/com/opencloudgaming/opennow/QueueLaunchStatus.kt`
- [Network tuning](https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/NetworkConditionAdaptor.kt): `android/app/src/main/java/com/opencloudgaming/opennow/NetworkConditionAdaptor.kt`
- [Stream session](https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/Streaming.kt): `android/app/src/main/java/com/opencloudgaming/opennow/Streaming.kt`
- [Video decoder](https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/LowLatencyVideoDecoder.kt): `android/app/src/main/java/com/opencloudgaming/opennow/LowLatencyVideoDecoder.kt`
- [Touch controls](https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/NativeTouchGames.kt): `android/app/src/main/java/com/opencloudgaming/opennow/NativeTouchGames.kt`

### Media and extras

- [Music player](https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/NanaMusicPlayer.kt): `android/app/src/main/java/com/opencloudgaming/opennow/NanaMusicPlayer.kt`
- [Music service](https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/NanaMusicPlaybackService.kt): `android/app/src/main/java/com/opencloudgaming/opennow/NanaMusicPlaybackService.kt`
- [Floating browser](https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/NanaBrowserPanel.kt): `android/app/src/main/java/com/opencloudgaming/opennow/NanaBrowserPanel.kt`
- [Stream recording](https://github.com/fahriadison/nanaplay/blob/main/android/app/src/main/java/com/opencloudgaming/opennow/AndroidStreamRecorder.kt): `android/app/src/main/java/com/opencloudgaming/opennow/AndroidStreamRecorder.kt`

### Desktop client

- [Controller library](https://github.com/fahriadison/nanaplay/blob/main/opennow-stable/src/renderer/src/components/controllerMode/ControllerLibraryPage.tsx): `opennow-stable/src/renderer/src/components/controllerMode/ControllerLibraryPage.tsx`
- [Library events](https://github.com/fahriadison/nanaplay/blob/main/opennow-stable/src/renderer/src/components/controllerMode/controllerLibrary/useControllerLibraryEvents.ts): `opennow-stable/src/renderer/src/components/controllerMode/controllerLibrary/useControllerLibraryEvents.ts`
- [Game derivations](https://github.com/fahriadison/nanaplay/blob/main/opennow-stable/src/renderer/src/components/controllerMode/controllerLibrary/useControllerLibraryGameDerivations.ts): `opennow-stable/src/renderer/src/components/controllerMode/controllerLibrary/useControllerLibraryGameDerivations.ts`
- [Playtime tracking](https://github.com/fahriadison/nanaplay/blob/main/opennow-stable/src/renderer/src/utils/usePlaytime.ts): `opennow-stable/src/renderer/src/utils/usePlaytime.ts`

### Native streamer

- [Streamer process](https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/main.rs): `native/opennow-streamer/src/main.rs`
- [Streamer backend](https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/backend.rs): `native/opennow-streamer/src/backend.rs`
- [GStreamer backend](https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/gstreamer_backend.rs): `native/opennow-streamer/src/gstreamer_backend.rs`
- [WebRTC pipeline](https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/gstreamer_pipeline.rs): `native/opennow-streamer/src/gstreamer_pipeline.rs`
- [Pipeline config](https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/gstreamer_config.rs): `native/opennow-streamer/src/gstreamer_config.rs`
- [Stream input](https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/gstreamer_input.rs): `native/opennow-streamer/src/gstreamer_input.rs`
- [Stream liveness](https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/gstreamer_liveness.rs): `native/opennow-streamer/src/gstreamer_liveness.rs`
- [Platform support](https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/gstreamer_platform.rs): `native/opennow-streamer/src/gstreamer_platform.rs`
- [Video transitions](https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/gstreamer_transitions.rs): `native/opennow-streamer/src/gstreamer_transitions.rs`
- [Streamer protocol](https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/protocol.rs): `native/opennow-streamer/src/protocol.rs`
- [SDP handling](https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/sdp.rs): `native/opennow-streamer/src/sdp.rs`
- [Input encoding](https://github.com/fahriadison/nanaplay/blob/main/native/opennow-streamer/src/input.rs): `native/opennow-streamer/src/input.rs`

### Other components

- **Player**

## Connections

- Player → App entry: opens (evidence: `README.md`)
- App entry → App state: observes state (evidence: `android/app/src/main/java/com/opencloudgaming/opennow/MainActivity.kt`)
- App entry → Input mapping: maps keys (evidence: `android/app/src/main/java/com/opencloudgaming/opennow/MainActivity.kt`)
- Player → Console UI: browses and launches (evidence: `README.md`)
- Player → Queue handling: waits in queue (evidence: `README.md`)
- Player → Network tuning: plays on variable networks (evidence: `README.md`)
- Player → Stream session: plays cloud games (evidence: `README.md`)
- Player → Touch controls: customizes controls (evidence: `README.md`)
- Player → Music player: plays music (evidence: `README.md`)
- Music service → Music player: uses player (evidence: `android/app/src/main/java/com/opencloudgaming/opennow/NanaMusicPlaybackService.kt`)
- Player → Floating browser: opens browser (evidence: `README.md`)
- Player → Stream recording: records stream (evidence: `README.md`)
- Controller library → Library events: handles navigation (evidence: `opennow-stable/src/renderer/src/components/controllerMode/ControllerLibraryPage.tsx`)
- Controller library → Game derivations: derives game lists (evidence: `opennow-stable/src/renderer/src/components/controllerMode/ControllerLibraryPage.tsx`)
- Game derivations → Playtime tracking: reads playtime (evidence: `opennow-stable/src/renderer/src/components/controllerMode/controllerLibrary/useControllerLibraryGameDerivations.ts`)
- Streamer process → Streamer backend: creates backend (evidence: `native/opennow-streamer/src/main.rs`)
- Streamer process → GStreamer backend: dispatches commands (evidence: `native/opennow-streamer/src/main.rs`)
- GStreamer backend → WebRTC pipeline: manages pipeline (evidence: `native/opennow-streamer/src/gstreamer_backend.rs`)
- WebRTC pipeline → Pipeline config: reads configuration (evidence: `native/opennow-streamer/src/gstreamer_pipeline.rs`)
- WebRTC pipeline → Stream input: configures input (evidence: `native/opennow-streamer/src/gstreamer_pipeline.rs`)
- WebRTC pipeline → Stream liveness: uses liveness (evidence: `native/opennow-streamer/src/gstreamer_pipeline.rs`)
- WebRTC pipeline → Platform support: uses platform support (evidence: `native/opennow-streamer/src/gstreamer_pipeline.rs`)
- WebRTC pipeline → Video transitions: uses transitions (evidence: `native/opennow-streamer/src/gstreamer_pipeline.rs`)
- WebRTC pipeline → Streamer protocol: emits protocol events (evidence: `native/opennow-streamer/src/gstreamer_pipeline.rs`)
- WebRTC pipeline → SDP handling: uses SDP (evidence: `native/opennow-streamer/src/gstreamer_pipeline.rs`)
- Stream liveness → WebRTC pipeline: configures queues (evidence: `native/opennow-streamer/src/gstreamer_liveness.rs`)
- Stream liveness → Video transitions: resolves transitions (evidence: `native/opennow-streamer/src/gstreamer_liveness.rs`)
- Stream liveness → Streamer protocol: emits events (evidence: `native/opennow-streamer/src/gstreamer_liveness.rs`)
- Stream input → Input encoding: encodes input (evidence: `native/opennow-streamer/src/gstreamer_input.rs`)
- SDP handling → Input encoding: uses input types (evidence: `native/opennow-streamer/src/sdp.rs`)
- SDP handling → Streamer protocol: uses protocol types (evidence: `native/opennow-streamer/src/sdp.rs`)
