T1 Electrical SolutionsT1 Platform Docs
Platform

Architecture

How controllers, services, entities, subscribers, and integrations fit together.

Architecture

The application is a Symfony 7 monolith using Doctrine ORM, Twig, EasyAdmin-style portal controllers, API Platform, Auth0 authentication, Messenger-ready services, Webpack Encore assets, and Xero integrations.

Layers

LayerResponsibilityExamples
ControllersRoute handling, request parsing, page rendering, portal orchestrationPortal/AdminPortalController.php, Portal/AdminClientManagementController.php, Portal/ClientController.php, Portal/PayrollController.php, Api/V2/ElectricianController.php
EntitiesDatabase-mapped domain stateClient, Project, Timesheet, TimeEntry, ClientAllowance, TimesheetAllowanceLine, TimesheetCalculation
RepositoriesDoctrine access patterns and active-rule lookupClientAllowanceRepository, ClientOrdinaryHoursRuleRepository, ClientShiftRuleRepository, TimesheetCalculationRepository
ServicesReusable domain logicAllowanceMatrixCalculator, AwardTimesheetCalculator, TimesheetEditPolicy, TimesheetChangeLogger, PayrollInvoiceService
Subscribers/listenersAutomatic side effects on persistenceTimesheetAllowanceCalculationSubscriber, TimesheetAwardCalculationSubscriber, notification listeners, risk subscriber
CommandsBackfills, recalculation, diagnostics, seedersapp:allowances:recalculate-timesheets, app:award:recalculate-timesheets, app:seed-master-configuration
External integrationsAuth0, Xero, Expo notifications, Google geocodingAuth0ManagementService, XeroIntegrationService, ExpoPushNotificationService

Request flow pattern

A typical web portal mutation follows this shape:

  1. User hits a route under /admin, /client, /supervisor, /payroll, /finance, or /electrician.
  2. Symfony security authenticates through the portal firewall using Auth0WebAuthenticator and AdminUserProvider.
  3. The controller checks role/scope, reads request input, fetches entities, and mutates domain objects.
  4. Doctrine flush triggers subscribers.
  5. Allowance, award, notification, audit, and risk side effects run from subscribers/listeners or explicit services.
  6. The controller redirects back to a list/detail page with flash feedback.

A typical mobile API mutation follows the same domain path, but starts under /api/v2/electrician or /api/v2/supervisor and uses stateless JWT authentication through Auth0Authenticator and UserProvider.

Coupling points

The graphify analysis shows the largest coupling points are portal controllers and core entities:

NodeWhy it is central
ClientControllerClient portal project, timesheet, invoice, and configuration workflows converge here.
AdminClientManagementControllerAdmin client setup includes projects, materials, cost codes, rates, allowances, ordinary hours, work conditions, event rates, timesheets, and expenses.
PayrollController and PayrollFinanceControllerPayroll review, reports, payslips, finance matrices, approvals, and Xero workflows converge here.
FinanceControllerInvoice, weekly report, cost-code adjustment, and finance timesheet review flows converge here.
Timesheet, Project, UserMost workflows eventually resolve one of these records.
TimesheetHoursCalculatorShared timesheet hour derivation used across payroll, review, finance, risk, and display surfaces.

Design consequence

The controllers are broad orchestration layers. The safest place to document and change business behavior is usually the service/subscriber/entity pair behind the controller, not the route method itself. For example, allowance behavior belongs to AllowanceMatrixCalculator, ClientAllowance, TimesheetAllowanceLine, and TimesheetAllowanceCalculationSubscriber; controller allowance pages only configure the inputs.

On this page