1
Architecture
Jonathan Miller edited this page 2026-06-29 16:42:26 +00:00

Architecture

Repository Layout

source/
├── pkg_mokosuitefield.xml              (package manifest)
├── script.php                          (install/update/uninstall script)
├── components/
│   └── com_mokosuitefield/             (site component)
│       ├── access.xml
│       ├── com_mokosuitefield.xml
│       ├── config.xml
│       ├── language/en-GB/
│       ├── services/provider.php
│       ├── src/
│       │   ├── Controller/DisplayController.php
│       │   └── View/
│       │       ├── FieldAgreements/HtmlView.php
│       │       ├── FieldChecklists/HtmlView.php
│       │       ├── FieldDashboard/HtmlView.php
│       │       ├── FieldDispatches/HtmlView.php
│       │       ├── FieldEquipment/HtmlView.php
│       │       ├── FieldParts/HtmlView.php
│       │       ├── FieldTechnicians/HtmlView.php
│       │       └── FieldWorkorders/HtmlView.php
│       └── tmpl/                       (site view templates)
├── packages/
│   ├── com_mokosuitefield/             (admin component)
│   │   ├── admin/
│   │   │   ├── access.xml
│   │   │   ├── config.xml
│   │   │   ├── services/provider.php
│   │   │   ├── src/
│   │   │   │   ├── Controller/DisplayController.php
│   │   │   │   ├── Model/FieldDashboardModel.php
│   │   │   │   └── View/
│   │   │   │       ├── Checklists/HtmlView.php
│   │   │   │       ├── Dispatches/HtmlView.php
│   │   │   │       ├── Equipment/HtmlView.php
│   │   │   │       ├── FieldDashboard/HtmlView.php
│   │   │   │       ├── Parts/HtmlView.php
│   │   │   │       ├── PmAgreements/HtmlView.php
│   │   │   │       ├── Technicians/HtmlView.php
│   │   │   │       ├── TruckInventory/HtmlView.php
│   │   │   │       └── WorkOrders/HtmlView.php
│   │   │   └── tmpl/                   (admin view templates)
│   │   └── mokosuitefield.xml
│   ├── plg_system_mokosuitefield/      (system plugin)
│   │   ├── mokosuitefield.xml
│   │   ├── services/provider.php
│   │   ├── sql/
│   │   │   ├── install.mysql.sql
│   │   │   └── uninstall.mysql.sql
│   │   └── src/Extension/Field.php
│   └── plg_webservices_mokosuitefield/ (webservices plugin)
│       ├── mokosuitefield.xml
│       ├── services/provider.php
│       └── src/Extension/MokoSuiteField.php
└── plugins/
    ├── system/mokosuitefield/          (system plugin - source)
    │   ├── mokosuitefield.xml
    │   ├── services/provider.php
    │   ├── sql/
    │   │   ├── install.sql
    │   │   └── uninstall.sql
    │   └── src/Extension/MokoSuiteField.php
    └── webservices/mokosuitefield/     (webservices plugin - source)
        ├── mokosuitefield.xml
        ├── services/provider.php
        └── src/Extension/MokoSuiteField.php

MVC Overview

Admin Views (9 views)

View Purpose
FieldDashboard Overview dashboard with summary metrics
WorkOrders Work order list and management
Equipment Equipment registry and tracking
Technicians Technician profiles and status
Parts Parts inventory and stock levels
TruckInventory Per-technician vehicle parts inventory
Checklists Checklist template management
PmAgreements Preventive maintenance agreements
Dispatches Dispatch board and offer tracking

Site Views (8 views)

View Purpose
FieldDashboard Customer/technician portal dashboard
FieldWorkorders Work order viewing
FieldEquipment Equipment details
FieldTechnicians Technician profiles
FieldParts Parts catalog
FieldChecklists Checklist viewing
FieldAgreements Service agreement details
FieldDispatches Dispatch status

Service Providers

Each extension uses Joomla 6 dependency injection via services/provider.php:

  • Component — Registers the MVC factory, router, and component dispatcher
  • System Plugin — Registers the plugin extension class with database schema management
  • Webservices Plugin — Registers the API route provider

Plugin Hooks

System Plugin (plg_system_mokosuitefield)

  • Manages database schema via install/uninstall SQL scripts
  • Namespace: Moko\Plugin\System\MokoSuiteField

Webservices Plugin (plg_webservices_mokosuitefield)

Registers CRUD API routes via onBeforeApiRoute:

Endpoint View Methods
v1/mokosuitefield/workorders fieldworkorders GET, POST, PATCH, DELETE
v1/mokosuitefield/technicians fieldtechnicians GET, POST, PATCH, DELETE
v1/mokosuitefield/equipment fieldequipment GET, POST, PATCH, DELETE
v1/mokosuitefield/parts fieldparts GET, POST, PATCH, DELETE
v1/mokosuitefield/checklists fieldchecklists GET, POST, PATCH, DELETE
v1/mokosuitefield/agreements fieldagreements GET, POST, PATCH, DELETE
v1/mokosuitefield/dispatches fielddispatches GET, POST, PATCH, DELETE

All API routes require authentication (public: false).

Namespaces

Extension Namespace
System Plugin Moko\Plugin\System\MokoSuiteField
Webservices Plugin Moko\Plugin\WebServices\MokoSuiteField

Dependencies

  • Joomla 6 CMS Framework (MVC, Router, Plugin, DI)
  • PHP 8.3+ (typed properties, enums, named arguments)
  • InnoDB / utf8mb4 database engine