Public Access
Page:
ARCHITECTURE
Clone
8
ARCHITECTURE
Jonathan Miller edited this page 2026-06-09 16:54:58 +00:00
Architecture
System design and directory layout for mokoplatform.
Directory Structure
mokoplatform/
bin/moko # CLI entry point
cli/ # 54 command scripts
lib/
CliBase.php # Simple base class
Common.php # Shared utilities
Enterprise/
CliFramework.php # Full enterprise framework
AuditLogger.php # Audit trail
CheckpointManager.php # Resumable operations
Config.php # Configuration
ErrorRecovery.php # Error recovery
ManifestReader.php # manifest.xml parser
MetricsCollector.php # Metrics
MokoGiteaAdapter.php # Gitea API client
PackageBuilder.php # ZIP builder
PluginRegistry.php # Plugin system
RetryHelper.php # Retry with backoff
SecurityValidator.php # Security checks
TransactionManager.php # Transaction support
UnifiedValidation.php # Validation framework
validate/ # 20+ validators
automation/ # Bulk automation
deploy/ # Deployment tools
fix/ # Auto-fix scripts
maintenance/ # Maintenance tools
release/ # Release helpers
templates/ # Boilerplate (joomla, makefiles, configs, schemas)
wrappers/ # Thin wrappers for CI
mcp/servers/ # 7 MCP servers
tests/ # PHPUnit (19 tests)
Two-Tier CLI Framework
CliBase (Simple)
For standalone scripts needing basic CLI features:
class MyTool extends CliBase
{
protected function run(): int
{
if ($this->dryRun) {
$this->info('Dry run - no changes');
return 0;
}
return 0;
}
}
Provides: argument parsing, --dry-run, --verbose, colored output, exit codes.
Enterprise/CliFramework (Full)
For complex tools with plugins, checkpoints, metrics, and transactions:
class MyComplexTool extends CliFramework
{
protected function configure(): void
{
$this->addPlugin(new ManifestPlugin());
$this->enableCheckpoints();
$this->enableMetrics();
}
protected function execute(): int
{
$this->transaction(function () {
// transactional operations
});
return 0;
}
}
Provides: plugin system, checkpoint/resume, metrics, audit logging, error recovery, retry logic, transactions, config validation.
Plugin System
Plugins implement ProjectPluginInterface:
- ManifestPlugin - reads .mokogitea/manifest.xml
- MokoStandardsPlugin - reads .moko-standards
- SecurityPlugin - security validators
- MetricsPlugin - operation metrics
Configuration
templates/configs/- default config templatesgovernance.yml- org-level rules- Env vars:
GA_TOKEN,GH_TOKEN,GRAFANA_URL,GRAFANA_TOKEN
Pages
- ARCHITECTURE
- BULK-OPERATIONS
- CLI-AUTOMATION
- DEPLOY-SCRIPTS
- DRY-RUN-PATTERN
- Documentation-Standards
- File-Header-Standards
- Home
- JOOMLA-SYNC
- MINIFICATION
- MONITORING-SCRIPTS
- NEW-SCRIPTS
- QUICKSTART-ORG-PROJECTS
- RELEASE-MANAGEMENT
- RUNNERS
- VALIDATION
- Version-Standard
- WORKFLOW-STANDARDS
-
api
- api-automation-index
- api-definitions-default-index
- api-definitions-sync-index
- api-deploy-index
- api-fix-index
- api-index
- api-maintenance-index.-
- api-maintenance-index
- api-plugin-index.-
- api-plugin-index
- api-tests-index.-
- api-tests-sample-index.-
- api-tests-sample-index
- api-validate-index.-
- maintenance-index
- automation
- features
- guides
- operations
- reference
- standards
- templates
-
workflows
- workflows-README.-
- workflows-README
- workflows-auto-release.-
- workflows-auto-release
- workflows-branch-protection.-
- workflows-branch-protection
- workflows-build-release.-
- workflows-build-release
- workflows-cascade-dev.-
- workflows-cascade-dev
- workflows-changelog-management.-
- workflows-changelog-management
- workflows-demo-deployment.-
- workflows-demo-deployment
- workflows-dev-branch-tracking.-
- workflows-dev-branch-tracking
- workflows-dev-deployment.-
- workflows-dev-deployment
- workflows-index.-
- workflows-index
- workflows-release-system.-
- workflows-release-system
- workflows-renovate.-
- workflows-renovate
- workflows-reusable-workflows.-
- workflows-reusable-workflows
- workflows-rs-deployment.-
- workflows-rs-deployment
- workflows-secret-scanning.-
- workflows-secret-scanning
- workflows-shared-workflows.-
- workflows-shared-workflows
- workflows-standards-compliance.-
- workflows-standards-compliance
- workflows-static-analysis.-
- workflows-static-analysis
- workflows-sub-issue-management.-
- workflows-sub-issue-management
- workflows-update-server.-
- workflows-update-server
- workflows-workflow-architecture.-
- workflows-workflow-architecture