Services
Service classes own routes and orchestrate Actions and Containers.
Each route resolves to a Service class in services/. The router instantiates the Service and calls main() to drive the response.
Minimal Service
class Dashboard extends JX_Serivce implements JX_service
{
public function main()
{
include "containers/dashboard/dashboard.php";
}
}
Save as services/dashboard.php and visit /dashboard (or ?route=dashboard).
Typical Flow
Services often select an Action based on the action query parameter, then load a Container.
$action = is_null($Url->get('action')) ? 'home' : $Url->get('action');
include 'containers/dashboard/dashboard.php';
Naming
Service class names align with their route and file name. Multi-segment routes (like /api/v1/health) still map to the first segment.
Actions
Actions encapsulate specialized logic and can be invoked inside the Service.
Explore Actions →Containers
Containers render UI output and keep templates close to the Service.
Explore Containers →Current service enhancement: AppDev Editor
The appdev service now routes action=editor to a dedicated code editor container and action=editor-api to JSON operations for list/read/save/create/rename/delete.