--- since: 1.0.6 --- # Architecture ## Layers ```text ┌───────────────────────────────────────────┐ │ CLI layer │ │ dplay/cli.py │ │ │ │ Typer application + command registration │ └───────────────────────┬───────────────────┘ │ ▼ ┌───────────────────────────────────────────┐ │ Command layer │ │ dplay/commands/ │ │ │ │ http / ssl / worker / certs / logs │ │ system doctor / system reset │ └───────────────────────┬───────────────────┘ │ ▼ ┌───────────────────────────────────────────┐ │ Core + environment │ │ │ │ repo_detector │ │ process_manager │ │ config_loader │ │ venv_detector │ │ diagnostics │ └───────────────────────┬───────────────────┘ │ ▼ ┌───────────────────────────────────────────┐ │ Utility layer │ │ │ │ env / Redis / static / SSL / browser │ │ logs / subprocess / startup display │ └───────────────────────┬───────────────────┘ │ ▼ ┌───────────────────────────────────────────┐ │ DjangoPlay host repository │ │ │ │ webapp/manage.py │ │ webapp/paystream/security/encrypt_env.py │ │ webapp/logs/*.log │ │ Celery / Redis / PostgreSQL │ └───────────────────────────────────────────┘ ``` ## Single-responsibility split | Module | Responsibility | |---|---| | `cli.py` | Typer application, command registration, version | | `repo_detector.py` | Locate and validate DjangoPlay Git repository | | `venv_detector.py` | Require active virtual environment | | `config_loader.py` | Load `~/.dplay/config.yaml` and `.secrets` | | `process_manager.py` | Celery/Django process lifecycle | | `env_manager.py` | Invoke host environment encryption | | `redis_manager.py` | Flush Redis | | `static_manager.py` | Invoke Django `collectstatic` | | `ssl_manager.py` | Generate/validate/trust local TLS certificates | | `log_manager.py` | Resolve, parse, filter and stream logs | | `browser.py` | Open development URL | | `dev_startup.py` | Display startup environment |