# turbo-forcing/pygamelauncher architecture

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

- Interactive diagram: https://gitdiagram.com/turbo-forcing/pygamelauncher
- Repository: https://github.com/turbo-forcing/pygamelauncher

## Overview

PyGame Launcher is a Python CLI for browsing a built-in game market and managing locally installed GitHub games. Users enter commands through the command-line or interactive prompt; the CLI coordinates market lookup, security checks, installation/update/removal, and launch, while reporting version and game details. The single source file contains these responsibilities, including Git operations and SQLite-backed password protection. The excerpts show several direct calls, but omit parts of command dispatch and launch checks, so those links are not inferred beyond documented capabilities.

Main entry points: [`PyGameLauncher.py`](https://github.com/turbo-forcing/pygamelauncher/blob/master/PyGameLauncher.py) (CLI command handler), [`games_security.db`](https://github.com/turbo-forcing/pygamelauncher/blob/master/games_security.db) (Password database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry and commands"]
  node_cli["CLI command handler<br/>[PyGameLauncher.py]"]
  node_interactive["Interactive prompt<br/>[PyGameLauncher.py]"]
end

subgraph group_catalog["Market and game lifecycle"]
  node_market["Built-in game market<br/>[PyGameLauncher.py]"]
  node_downloader["Git game downloader<br/>[PyGameLauncher.py]"]
  node_installed[("Installed game files<br/>[PyGameLauncher.py]")]
end

subgraph group_protection["Security and environment"]
  node_security["Game password manager<br/>[PyGameLauncher.py]"]
end

node_user(("CLI user"))
node_game_process["Game process"]
node_security_db[("Password database<br/>[games_security.db]")]
node_classroom["Classroom environment"]

node_user -->|"issues commands"| node_cli
node_user -->|"enters commands"| node_interactive
node_interactive -.->|"dispatches commands"| node_cli
node_cli -->|"looks up games"| node_market
node_market -->|"installs via Git"| node_downloader
node_downloader -->|"clones or updates"| node_installed
node_cli -.->|"updates and inspects"| node_downloader
node_cli -.->|"removes games"| node_installed
node_cli -->|"starts game script"| node_game_process
node_cli -->|"manages passwords"| node_security
node_security -->|"reads and writes"| node_security_db
node_cli -->|"checks environment"| node_classroom
node_cli -.->|"verifies safe mode"| node_security

click node_cli "https://github.com/turbo-forcing/pygamelauncher/blob/master/PyGameLauncher.py"
click node_interactive "https://github.com/turbo-forcing/pygamelauncher/blob/master/PyGameLauncher.py"
click node_market "https://github.com/turbo-forcing/pygamelauncher/blob/master/PyGameLauncher.py"
click node_downloader "https://github.com/turbo-forcing/pygamelauncher/blob/master/PyGameLauncher.py"
click node_installed "https://github.com/turbo-forcing/pygamelauncher/blob/master/PyGameLauncher.py"
click node_security "https://github.com/turbo-forcing/pygamelauncher/blob/master/PyGameLauncher.py"
click node_security_db "https://github.com/turbo-forcing/pygamelauncher/blob/master/games_security.db"

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_cli,node_interactive,node_user toneBlue
class node_market,node_downloader,node_installed,node_security_db toneAmber
class node_security toneMint
class node_game_process,node_classroom toneIndigo
```

## Components

### CLI entry and commands

- [CLI command handler](https://github.com/turbo-forcing/pygamelauncher/blob/master/PyGameLauncher.py): `PyGameLauncher.py`
- [Interactive prompt](https://github.com/turbo-forcing/pygamelauncher/blob/master/PyGameLauncher.py): `PyGameLauncher.py`

### Market and game lifecycle

- [Built-in game market](https://github.com/turbo-forcing/pygamelauncher/blob/master/PyGameLauncher.py): `PyGameLauncher.py`
- [Git game downloader](https://github.com/turbo-forcing/pygamelauncher/blob/master/PyGameLauncher.py): `PyGameLauncher.py`
- [Installed game files](https://github.com/turbo-forcing/pygamelauncher/blob/master/PyGameLauncher.py): `PyGameLauncher.py`

### Security and environment

- [Game password manager](https://github.com/turbo-forcing/pygamelauncher/blob/master/PyGameLauncher.py): `PyGameLauncher.py`

### Other components

- **CLI user**
- **Game process**
- [Password database](https://github.com/turbo-forcing/pygamelauncher/blob/master/games_security.db): `games_security.db`
- **Classroom environment**

## Connections

- CLI user → CLI command handler: issues commands (evidence: `README.md`)
- CLI user → Interactive prompt: enters commands (evidence: `README.md`)
- Interactive prompt → CLI command handler: dispatches commands (evidence: `PyGameLauncher.py`)
- CLI command handler → Built-in game market: looks up games (evidence: `PyGameLauncher.py`)
- Built-in game market → Git game downloader: installs via Git (evidence: `PyGameLauncher.py`)
- Git game downloader → Installed game files: clones or updates (evidence: `PyGameLauncher.py`)
- CLI command handler → Git game downloader: updates and inspects (evidence: `PyGameLauncher.py`)
- CLI command handler → Installed game files: removes games (evidence: `PyGameLauncher.py`)
- CLI command handler → Game process: starts game script (evidence: `PyGameLauncher.py`)
- CLI command handler → Game password manager: manages passwords (evidence: `PyGameLauncher.py`)
- Game password manager → Password database: reads and writes (evidence: `PyGameLauncher.py`)
- CLI command handler → Classroom environment: checks environment (evidence: `PyGameLauncher.py`)
- CLI command handler → Game password manager: verifies safe mode (evidence: `PyGameLauncher.py`)
