# kansomirai/cocoonfe architecture

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

- Interactive diagram: https://gitdiagram.com/kansomirai/cocoonfe
- Repository: https://github.com/kansomirai/cocoonfe

## Overview

This repository is the Android platform/player catalogue and its generator, not Cocoon Shell’s Android application. The main workflow is to define platform and player metadata in YAML, load and transform it into a catalogue, and make that catalogue available to Cocoon, which launches games through emulators. The README also describes broader frontend features, but their implementation is not present in this tree. The graph focuses on the supported catalogue workflow; it does not infer runtime wiring beyond the documentation.

Main entry points: [`tools/build.py`](https://github.com/kansomirai/cocoonfe/blob/main/tools/build.py) (Catalogue generator), [`tools/platforms.py`](https://github.com/kansomirai/cocoonfe/blob/main/tools/platforms.py) (YAML loader), [`android`](https://github.com/kansomirai/cocoonfe/tree/main/android) (Platform and player data), [`tools/yaml_to_json.rb`](https://github.com/kansomirai/cocoonfe/blob/main/tools/yaml_to_json.rb) (YAML parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_definitions["Platform definitions"]
  node_platform_yaml["Platform and player data"]
end

subgraph group_catalogue["Catalogue generation"]
  node_loader["YAML loader<br/>[platforms.py]"]
  node_yaml_parser["YAML parser<br/>[yaml_to_json.rb]"]
  node_transformer["Catalogue transformer<br/>[platforms.py]"]
  node_generator["Catalogue generator<br/>[build.py]"]
end

subgraph group_consumers["Catalogue consumers"]
  node_catalogue_output["Android catalogue"]
  node_cocoon(("Cocoon frontend"))
  node_emulators(("Android emulators"))
end

node_maintainer(("Catalogue maintainer"))

node_maintainer -->|"defines platforms"| node_platform_yaml
node_loader -->|"reads YAML"| node_platform_yaml
node_loader -->|"invokes parser"| node_yaml_parser
node_generator -->|"loads definitions"| node_loader
node_generator -->|"builds catalogue"| node_transformer
node_generator -->|"writes catalogue"| node_catalogue_output
node_cocoon -->|"downloads catalogue"| node_catalogue_output
node_cocoon -->|"launches games"| node_emulators

click node_platform_yaml "https://github.com/kansomirai/cocoonfe/tree/main/android"
click node_loader "https://github.com/kansomirai/cocoonfe/blob/main/tools/platforms.py"
click node_yaml_parser "https://github.com/kansomirai/cocoonfe/blob/main/tools/yaml_to_json.rb"
click node_transformer "https://github.com/kansomirai/cocoonfe/blob/main/tools/platforms.py"
click node_generator "https://github.com/kansomirai/cocoonfe/blob/main/tools/build.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_platform_yaml toneBlue
class node_loader,node_yaml_parser,node_transformer,node_generator toneAmber
class node_catalogue_output,node_cocoon,node_emulators toneMint
class node_maintainer toneIndigo
```

## Components

### Platform definitions

- [Platform and player data](https://github.com/kansomirai/cocoonfe/tree/main/android): `android`

### Catalogue generation

- [YAML loader](https://github.com/kansomirai/cocoonfe/blob/main/tools/platforms.py): `tools/platforms.py`
- [YAML parser](https://github.com/kansomirai/cocoonfe/blob/main/tools/yaml_to_json.rb): `tools/yaml_to_json.rb`
- [Catalogue transformer](https://github.com/kansomirai/cocoonfe/blob/main/tools/platforms.py): `tools/platforms.py`
- [Catalogue generator](https://github.com/kansomirai/cocoonfe/blob/main/tools/build.py): `tools/build.py`

### Catalogue consumers

- **Android catalogue**
- **Cocoon frontend**
- **Android emulators**

### Other components

- **Catalogue maintainer**

## Connections

- Catalogue maintainer → Platform and player data: defines platforms (evidence: `README.md`)
- YAML loader → Platform and player data: reads YAML (evidence: `tools/platforms.py`)
- YAML loader → YAML parser: invokes parser (evidence: `tools/platforms.py`)
- Catalogue generator → YAML loader: loads definitions (evidence: `tools/build.py`)
- Catalogue generator → Catalogue transformer: builds catalogue (evidence: `tools/build.py`)
- Catalogue generator → Android catalogue: writes catalogue (evidence: `tools/build.py`)
- Cocoon frontend → Android catalogue: downloads catalogue
- Cocoon frontend → Android emulators: launches games (evidence: `README.md`)
