# yasir196/yg-plug-play architecture

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

- Interactive diagram: https://gitdiagram.com/yasir196/yg-plug-play
- Repository: https://github.com/yasir196/yg-plug-play

## Overview

YG-PLUG-PLAY is a plugin-first, Windows-local content production platform. Its evident user workflow is to configure a channel and project, save a validated brief, route capability requests to eligible providers, and execute durable workflows that track artifacts and approvals. Supporting product areas include plugin trust and assignment, authentication, settings, progress, and audit. The excerpts establish some service-to-service links; for other subsystems, the map preserves their documented or indexed modules without assuming runtime wiring that was not shown.

Main entry points: [`core/database/models.py`](https://github.com/yasir196/yg-plug-play/blob/main/core/database/models.py) (SQLite Persistence), [`core/workspace/service.py`](https://github.com/yasir196/yg-plug-play/blob/main/core/workspace/service.py) (Workspace Service), [`tools/yg/cli.py`](https://github.com/yasir196/yg-plug-play/blob/main/tools/yg/cli.py) (CLI), [`core/plugin_registry/registry.py`](https://github.com/yasir196/yg-plug-play/blob/main/core/plugin_registry/registry.py) (Plugin Registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace"]
  node_workspace_api["Workspace API<br/>[api.py]"]
  node_workspace_service["Workspace Service<br/>[service.py]"]
  node_workspace_defaults["Demo Defaults<br/>[defaults.py]"]
end

subgraph group_plugins["Plugin Platform"]
  node_plugin_manifest["Manifest Validation<br/>[manifest.py]"]
  node_plugin_registry["Plugin Registry<br/>[registry.py]"]
  node_plugin_installer["Plugin Installer<br/>[installer.py]"]
  node_plugin_runtime["Plugin Runtime<br/>[manager.py]"]
  node_permissions["Runtime Permissions<br/>[permissions.py]"]
  node_plugin_data["Plugin Data<br/>[service.py]"]
end

subgraph group_production["Content Production"]
  node_router["Purpose Router<br/>[router.py]"]
  node_prompt_executor["Prompt Executor<br/>[executor.py]"]
  node_workflow_engine["Workflow Engine<br/>[engine.py]"]
  node_workflow_approvals["Workflow Approvals<br/>[approvals.py]"]
  node_workflow_validator["Workflow Validator<br/>[validator.py]"]
  node_artifacts["Artifact Store<br/>[store.py]"]
  node_progress["Job Progress<br/>[service.py]"]
end

subgraph group_platform["Platform Services"]
  node_cli["CLI<br/>[cli.py]"]
  node_dashboard["Dashboard Routes<br/>[routes.py]"]
  node_audit["Audit Service<br/>[service.py]"]
  node_auth_api["Auth API<br/>[app.py]"]
  node_auth_service["Auth Service<br/>[service.py]"]
  node_settings["Settings Service<br/>[service.py]"]
  node_data_root["Data Root<br/>[data_root.py]"]
  node_database[("SQLite Persistence<br/>[models.py]")]
end

node_user(("Operator"))

node_user -->|"operates"| node_cli
node_user -->|"uses"| node_dashboard
node_cli -->|"configures"| node_data_root
node_cli -->|"initializes"| node_database
node_cli -->|"uses"| node_workspace_service
node_dashboard -->|"queries"| node_database
node_workspace_api -->|"delegates"| node_workspace_service
node_workspace_service -->|"materializes"| node_workspace_defaults
node_workspace_service -->|"records"| node_audit
node_workspace_service -->|"persists"| node_database
node_auth_api -->|"authenticates"| node_auth_service
node_auth_service -->|"issues session"| node_user
node_plugin_installer -.->|"validates"| node_plugin_manifest
node_plugin_registry -->|"parses"| node_plugin_manifest
node_plugin_registry -->|"stores trust"| node_database
node_plugin_runtime -.->|"checks"| node_permissions
node_plugin_data -->|"checks"| node_permissions
node_router -->|"checks availability"| node_plugin_registry
node_router -->|"validates capability"| node_plugin_manifest
node_prompt_executor -->|"uses routing"| node_router
node_workflow_engine -->|"reads and writes"| node_database
node_workflow_approvals -->|"resumes runs"| node_workflow_engine
node_workflow_approvals -->|"accesses records"| node_database
node_workflow_validator -.->|"validates definitions"| node_workflow_engine
node_artifacts -->|"stores metadata"| node_database
node_progress -->|"updates jobs"| node_database
node_settings -->|"persists settings"| node_database
node_permissions -->|"provides context"| node_progress

click node_cli "https://github.com/yasir196/yg-plug-play/blob/main/tools/yg/cli.py"
click node_dashboard "https://github.com/yasir196/yg-plug-play/blob/main/dashboard/routes.py"
click node_workspace_api "https://github.com/yasir196/yg-plug-play/blob/main/core/workspace/api.py"
click node_workspace_service "https://github.com/yasir196/yg-plug-play/blob/main/core/workspace/service.py"
click node_workspace_defaults "https://github.com/yasir196/yg-plug-play/blob/main/core/workspace/defaults.py"
click node_audit "https://github.com/yasir196/yg-plug-play/blob/main/core/audit/service.py"
click node_auth_api "https://github.com/yasir196/yg-plug-play/blob/main/core/auth/app.py"
click node_auth_service "https://github.com/yasir196/yg-plug-play/blob/main/core/auth/service.py"
click node_plugin_manifest "https://github.com/yasir196/yg-plug-play/blob/main/core/plugin_registry/manifest.py"
click node_plugin_registry "https://github.com/yasir196/yg-plug-play/blob/main/core/plugin_registry/registry.py"
click node_plugin_installer "https://github.com/yasir196/yg-plug-play/blob/main/core/plugin_registry/installer.py"
click node_plugin_runtime "https://github.com/yasir196/yg-plug-play/blob/main/core/plugin_runtime/manager.py"
click node_permissions "https://github.com/yasir196/yg-plug-play/blob/main/core/plugin_runtime/permissions.py"
click node_plugin_data "https://github.com/yasir196/yg-plug-play/blob/main/core/plugin_data/service.py"
click node_router "https://github.com/yasir196/yg-plug-play/blob/main/core/routing/router.py"
click node_prompt_executor "https://github.com/yasir196/yg-plug-play/blob/main/core/prompt_executor/executor.py"
click node_workflow_engine "https://github.com/yasir196/yg-plug-play/blob/main/core/workflow/engine.py"
click node_workflow_approvals "https://github.com/yasir196/yg-plug-play/blob/main/core/workflow/approvals.py"
click node_workflow_validator "https://github.com/yasir196/yg-plug-play/blob/main/core/workflow/validator.py"
click node_artifacts "https://github.com/yasir196/yg-plug-play/blob/main/core/artifacts/store.py"
click node_progress "https://github.com/yasir196/yg-plug-play/blob/main/core/progress/service.py"
click node_settings "https://github.com/yasir196/yg-plug-play/blob/main/core/settings/service.py"
click node_data_root "https://github.com/yasir196/yg-plug-play/blob/main/core/config/data_root.py"
click node_database "https://github.com/yasir196/yg-plug-play/blob/main/core/database/models.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_workspace_api,node_workspace_service,node_workspace_defaults toneBlue
class node_plugin_manifest,node_plugin_registry,node_plugin_installer,node_plugin_runtime,node_permissions,node_plugin_data toneAmber
class node_router,node_prompt_executor,node_workflow_engine,node_workflow_approvals,node_workflow_validator,node_artifacts,node_progress toneMint
class node_cli,node_dashboard,node_audit,node_auth_api,node_auth_service,node_settings,node_data_root,node_database toneRose
class node_user toneIndigo
```

## Components

### Workspace

- [Workspace API](https://github.com/yasir196/yg-plug-play/blob/main/core/workspace/api.py): `core/workspace/api.py`
- [Workspace Service](https://github.com/yasir196/yg-plug-play/blob/main/core/workspace/service.py): `core/workspace/service.py`
- [Demo Defaults](https://github.com/yasir196/yg-plug-play/blob/main/core/workspace/defaults.py): `core/workspace/defaults.py`

### Plugin Platform

- [Manifest Validation](https://github.com/yasir196/yg-plug-play/blob/main/core/plugin_registry/manifest.py): `core/plugin_registry/manifest.py`
- [Plugin Registry](https://github.com/yasir196/yg-plug-play/blob/main/core/plugin_registry/registry.py): `core/plugin_registry/registry.py`
- [Plugin Installer](https://github.com/yasir196/yg-plug-play/blob/main/core/plugin_registry/installer.py): `core/plugin_registry/installer.py`
- [Plugin Runtime](https://github.com/yasir196/yg-plug-play/blob/main/core/plugin_runtime/manager.py): `core/plugin_runtime/manager.py`
- [Runtime Permissions](https://github.com/yasir196/yg-plug-play/blob/main/core/plugin_runtime/permissions.py): `core/plugin_runtime/permissions.py`
- [Plugin Data](https://github.com/yasir196/yg-plug-play/blob/main/core/plugin_data/service.py): `core/plugin_data/service.py`

### Content Production

- [Purpose Router](https://github.com/yasir196/yg-plug-play/blob/main/core/routing/router.py): `core/routing/router.py`
- [Prompt Executor](https://github.com/yasir196/yg-plug-play/blob/main/core/prompt_executor/executor.py): `core/prompt_executor/executor.py`
- [Workflow Engine](https://github.com/yasir196/yg-plug-play/blob/main/core/workflow/engine.py): `core/workflow/engine.py`
- [Workflow Approvals](https://github.com/yasir196/yg-plug-play/blob/main/core/workflow/approvals.py): `core/workflow/approvals.py`
- [Workflow Validator](https://github.com/yasir196/yg-plug-play/blob/main/core/workflow/validator.py): `core/workflow/validator.py`
- [Artifact Store](https://github.com/yasir196/yg-plug-play/blob/main/core/artifacts/store.py): `core/artifacts/store.py`
- [Job Progress](https://github.com/yasir196/yg-plug-play/blob/main/core/progress/service.py): `core/progress/service.py`

### Platform Services

- [CLI](https://github.com/yasir196/yg-plug-play/blob/main/tools/yg/cli.py): `tools/yg/cli.py`
- [Dashboard Routes](https://github.com/yasir196/yg-plug-play/blob/main/dashboard/routes.py): `dashboard/routes.py`
- [Audit Service](https://github.com/yasir196/yg-plug-play/blob/main/core/audit/service.py): `core/audit/service.py`
- [Auth API](https://github.com/yasir196/yg-plug-play/blob/main/core/auth/app.py): `core/auth/app.py`
- [Auth Service](https://github.com/yasir196/yg-plug-play/blob/main/core/auth/service.py): `core/auth/service.py`
- [Settings Service](https://github.com/yasir196/yg-plug-play/blob/main/core/settings/service.py): `core/settings/service.py`
- [Data Root](https://github.com/yasir196/yg-plug-play/blob/main/core/config/data_root.py): `core/config/data_root.py`
- [SQLite Persistence](https://github.com/yasir196/yg-plug-play/blob/main/core/database/models.py): `core/database/models.py`

### Other components

- **Operator**

## Connections

- Operator → CLI: operates (evidence: `tools/yg/cli.py`)
- Operator → Dashboard Routes: uses (evidence: `dashboard/routes.py`)
- CLI → Data Root: configures (evidence: `tools/yg/cli.py`)
- CLI → SQLite Persistence: initializes (evidence: `tools/yg/cli.py`)
- CLI → Workspace Service: uses (evidence: `tools/yg/cli.py`)
- Dashboard Routes → SQLite Persistence: queries (evidence: `dashboard/routes.py`)
- Workspace API → Workspace Service: delegates (evidence: `core/workspace/api.py`)
- Workspace Service → Demo Defaults: materializes (evidence: `core/workspace/service.py`)
- Workspace Service → Audit Service: records (evidence: `core/workspace/service.py`)
- Workspace Service → SQLite Persistence: persists (evidence: `core/workspace/service.py`)
- Auth API → Auth Service: authenticates (evidence: `core/auth/app.py`)
- Auth Service → Operator: issues session (evidence: `core/auth/service.py`)
- Plugin Installer → Manifest Validation: validates
- Plugin Registry → Manifest Validation: parses (evidence: `core/plugin_registry/registry.py`)
- Plugin Registry → SQLite Persistence: stores trust (evidence: `core/plugin_registry/registry.py`)
- Plugin Runtime → Runtime Permissions: checks
- Plugin Data → Runtime Permissions: checks (evidence: `core/plugin_data/service.py`)
- Purpose Router → Plugin Registry: checks availability (evidence: `core/routing/router.py`)
- Purpose Router → Manifest Validation: validates capability (evidence: `core/routing/router.py`)
- Prompt Executor → Purpose Router: uses routing (evidence: `core/prompt_executor/executor.py`)
- Workflow Engine → SQLite Persistence: reads and writes (evidence: `core/workflow/engine.py`)
- Workflow Approvals → Workflow Engine: resumes runs (evidence: `core/workflow/approvals.py`)
- Workflow Approvals → SQLite Persistence: accesses records (evidence: `core/workflow/approvals.py`)
- Workflow Validator → Workflow Engine: validates definitions
- Artifact Store → SQLite Persistence: stores metadata (evidence: `core/artifacts/store.py`)
- Job Progress → SQLite Persistence: updates jobs (evidence: `core/progress/service.py`)
- Settings Service → SQLite Persistence: persists settings (evidence: `core/settings/service.py`)
- Runtime Permissions → Job Progress: provides context (evidence: `core/progress/service.py`)
