Delivered remotely for a business based in Edinburgh, United Kingdom. Names withheld by agreement.
Project Overview
Industry: Transportation and logistics — asset-intensive commercial fleet operations.
Solution summary: A centralized PHP and MySQL Web & API fleet management platform with a Bootstrap and jQuery operational interface, backed by CircleCI and Capistrano release automation on Apache.
Commercial logistics operators managing heavy goods vehicles, trailers, and specialized plant cannot afford reactive guesswork. Every missed periodic maintenance inspection risks regulatory sanctions, while every unlogged driver defect or missing spare part turns a routine service bay slot into an extended vehicle-off-road event. Spreadsheets and disconnected workshop binders break down rapidly once vehicles move between regional depots. We engineered a unified web and API fleet management platform that consolidates asset registers, dual-trigger preventive maintenance scheduling, workshop job cards, parts inventory, and statutory compliance records into a single authoritative system.
Fleet Maintenance & Compliance Gaps
Calendar-only tracking missed heavy-usage wear. Tracking services solely by fixed calendar intervals failed vehicles running high-mileage trunking routes, while tracking strictly by mileage overlooked time-sensitive statutory safety checks on standby trailers.
Workshop and stores blind spots. Mechanics frequently stripped parts or opened job cards without real-time visibility into depot bin stock, leading to stalled bay turnarounds and inaccurate per-vehicle maintenance cost accounting.
Fragmented defect-to-repair accountability. Paper walk-around defect slips collected at depot gates rarely linked cleanly to open workshop job cards, leaving fleet compliance officers scrambling during audits to prove reported faults had been rectified before dispatch.
Fragile manual deployments. Updating legacy operational tools via manual FTP uploads during active shift handovers risked broken pages and unverified database schema changes right when dispatchers needed vehicle availability data.
Architectural Strategy
Relational integrity at the core. Fleet operations revolve around strict relationships between vehicles, trailers, depots, maintenance templates, job cards, and parts ledgers. Modelling these inside MySQL InnoDB with foreign-key constraints and transactional boundaries guarantees financial and compliance consistency.
Pragmatic server-rendered speed enhanced with AJAX. Rather than introducing heavy client-side state duplication for tabular back-office workflows, PHP renders structured Bootstrap views rapidly on the server while jQuery handles inline job-card line additions, live asset filtering, and modal inspections without full-page reloads.
Automated CI/CD as an operational safeguard. Wrapping the PHP codebase in CircleCI automated checks and Capistrano atomic symlink deployments ensures every change reaches Apache production nodes cleanly without interrupting live depot shifts.
API-ready ingestion layer. Separating external telemetry, fuel-log, and mobile defect ingestion into authenticated HTTP endpoints keeps core mileage and utilization counters fresh without requiring manual keyboard entry.
Core Capabilities
Comprehensive asset dossiers. Every tractor unit, rigid vehicle, and trailer maintains a unified record covering VIN/registration details, depot assignment, lease or ownership terms, tyre histories, odometer progression, and complete repair logs.
Dual-trigger preventive maintenance planner. Fleet controllers configure service templates combining elapsed days, mileage intervals, and engine hours; interactive workshop calendars highlight upcoming statutory checks and overdue inspections by depot.
End-to-end workshop job cards. Supervisors assign mechanics, log labour hours, attach diagnostic notes, link rectified driver defects, and record sign-off checks before returning an asset to Available status.
Depot parts and stock ledger. Storekeepers track bin quantities, minimum reorder thresholds, and purchase receipts, while mechanics issue parts directly onto job cards with automatic cost roll-up to the vehicle.
Defect triage and compliance audit trail. Reported defects categorize into roadworthiness-critical VOR holds versus monitorable minor items, preserving immutable sign-off timestamps for transport compliance inspections.
Technical Architecture
The platform runs on Apache serving PHP application tiers backed by MySQL, delivering Bootstrap and jQuery interfaces to desktop and workshop tablet browsers alongside JSON/HTTP endpoints for automated telemetry feeds.
Flow: External odometer/fuel feed or depot user submits update -> Apache routes request via mod_rewrite to PHP application controller -> Domain layer validates depot RBAC and evaluates maintenance interval / stock rules -> MySQL InnoDB executes transactional reads/writes across vehicles, job_cards, and inventory_movements -> PHP renders updated Bootstrap partial or JSON response for jQuery UI refresh -> Code changes merge through CircleCI test pipeline and deploy atomically via Capistrano onto Apache nodes.
Workshop job-card screens load core asset metadata synchronously and fetch dense historical tabs—past invoices, defect archives, and telemetry logs—lazily via jQuery AJAX calls, keeping initial render times snappy even on vehicles with years of service history.
Technology Stack
| Category | Technology detail |
|---|---|
| Backend language | PHP handling domain rules, workshop workflows, compliance scheduling, and API endpoints |
| Relational database | MySQL with composite indexing and ACID transactions for maintenance histories and parts stock |
| Web server | Apache HTTP Server with tuned virtual hosts, mod_rewrite routing, and PHP-FPM/module execution |
| Frontend scripting | JavaScript and jQuery powering asynchronous job-card updates, dynamic filters, and modal workflows |
| UI framework | Bootstrap responsive grid and component system adapted for dense fleet tables and workshop tablets |
| Continuous integration | CircleCI running automated PHP test suites, schema checks, and build verification on every commit |
| Release automation | Capistrano executing atomic symlinked zero-downtime deployments and rollback hooks across Apache nodes |
| Data ingestion & APIs | Authenticated HTTP endpoints ingesting odometer telemetry, fuel logs, and roadside defect reports |
Engineering Trade-offs & Solutions
| Architectural Challenge | Engineering Decision & Rationale |
|---|---|
| Single-page frontend rewrite vs. PHP + Bootstrap + jQuery | Chose server-rendered PHP enhanced with modular jQuery AJAX partials and Bootstrap grids, delivering rapid screen transitions and responsive workshop tablet usability without dual-stack overhead. |
| Optimistic stock counters vs. pessimistic MySQL row locking | Used InnoDB SELECT ... FOR UPDATE transactions when issuing spare parts to job cards, eliminating race conditions and negative bin balances during busy morning workshop rushes. |
| Ad-hoc server patching vs. CircleCI + Capistrano pipeline | Standardized automated CircleCI validation followed by Capistrano symlinked releases, eliminating partial-deploy outages on Apache and enabling instant rollbacks. |
| Expensive live aggregation queries vs. indexed projection views | Added targeted composite indexes and lightweight status summary caches for depot dashboards so compliance overviews remain instantaneous as years of history accumulate. |
Security, Auditability & Data Integrity
Depot-scoped role authorization. Access controls enforce strict boundaries between fleet controllers, workshop mechanics, storekeepers, and external repair vendors. Every query filters by authorized depot identifiers at the PHP service layer rather than relying on hidden UI controls.
CSRF, SQL injection, and input hardening. All form submissions and jQuery AJAX mutations validate server-issued CSRF tokens, while MySQL interactions rely exclusively on parameterized prepared statements.
Immutable compliance logs. Once a statutory inspection or safety-critical defect rectification is signed off, records lock against silent alteration; any subsequent amendment appends a timestamped corrective entry linked to the responsible user.
Database Performance & Deployment Pipeline
Query profiling and composite indexing. Multi-criteria fleet searches—filtering simultaneously by depot, vehicle class, roadworthiness status, and next service window—run against tuned MySQL composite indexes, avoiding full table scans across growing inspection archives.
Zero-downtime Apache releases. Capistrano maintains isolated release directories (releases/<timestamp>) alongside shared configuration and upload paths. Migrations execute cleanly prior to the atomic symlink swap, and Apache OPcache resets predictably via post-deploy hooks so users never encounter mixed code versions.
Pre-merge verification in CircleCI. Automated pipeline stages lint PHP syntax, verify database migration scripts against clean MySQL test instances, and execute regression checks covering maintenance interval calculations and parts-ledger math before code reaches production.
Operational Outcomes
Fleet controllers gained an immediate, depot-wide picture of vehicle availability, upcoming statutory inspections, and active workshop bottlenecks from one operational console. Workshop teams eliminated stock discrepancies and paper job-card delays by linking defect resolution, mechanic labour, and spare-parts allocation directly inside transactional workflows. Combined with disciplined CircleCI verification and atomic Capistrano deployments, the engineering team delivers continuous feature enhancements safely without disrupting round-the-clock transport operations.