HomeCase studiesDepot-Wide Fleet Operations and Preventive Maintenance Management...

Case study · Edinburgh, United Kingdom

Depot-Wide Fleet Operations and Preventive Maintenance Management Platform

Transportation and logistics — asset-intensive fleet operations

Asset-intensive logistics operators run tight margins where an unscheduled roadside breakdown or missed statutory vehicle inspection sidelines revenue-earning capacity immediately. We engineered a centralized web and API fleet management platform on PHP, MySQL, JavaScript, jQuery, and Bootstrap, backed by automated CircleCI testing and zero-downtime Capistrano deployments to Apache servers. Fleet controllers, workshop mechanics, and compliance managers now coordinate preventive service intervals, defect repairs, parts allocation, and multi-depot asset histories inside a single high-integrity operational system.

Industry
Transportation and logistics — asset-intensive fleet operations
Solution
A centralized Web & API fleet operations and workshop maintenance platform built with PHP, MySQL, Bootstrap, and jQuery, delivered via CircleCI and Capistrano.
Platforms
Web & API
Stack
PHP · JavaScript · jQuery · Bootstrap · MySQL · CircleCI
Location
Edinburgh, United Kingdom · delivered remotely
Role
Engineering, with the team behind for mobile and QA

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.

01 — Questions

asked about this kind of project

Why build the platform on PHP, MySQL, Bootstrap, and jQuery instead of a heavy single-page JavaScript framework?

Fleet managers and workshop supervisors spend hours scanning dense vehicle schedules, multi-tabbed service histories, and printable inspection sheets across varied depot hardware. Server-rendered PHP paired with targeted jQuery AJAX endpoints and Bootstrap layouts delivered fast initial page loads, straightforward form handling, and predictable long-term maintainability without unnecessary frontend build complexity.

How does the system prevent two workshop mechanics from allocating the last spare part to different job cards?

Parts reservations and stock deductions run inside explicit MySQL InnoDB transactions using row-level locking (`SELECT ... FOR UPDATE`) on the depot inventory ledger. If two mechanics submit conflicting allocations simultaneously, the database serializes the stock check so the second request receives an immediate out-of-stock notice rather than corrupting inventory counts.

How are preventive maintenance schedules calculated when fleet assets vary between high-mileage trucks and low-mileage depot equipment?

The scheduling engine evaluates dual-trigger service rules per vehicle class—whichever threshold arrives first between elapsed calendar days (for statutory inspections) and accumulated odometer or engine hours fed via API and fuel-card imports. Forecasting queries flag upcoming due dates across 30-day workshop windows so supervisors balance bay capacity in advance.

How do Capistrano and CircleCI keep releases safe when workshops operate across early-morning and late-night shifts?

Every pull request must pass automated CircleCI checks before merging. Once approved, Capistrano builds the release into a timestamped directory on the Apache hosts, runs idempotent database migrations, warms caches, and flips an atomic `current` symlink—eliminating half-uploaded file states and allowing instant rollback if an anomaly appears.

How did you keep MySQL queries fast as multi-year vehicle maintenance and defect records accumulated?

We combined composite indexes aligned to the most frequent depot filter paths—such as `(depot_id, status, next_service_due)`—with summary projection tables for dashboard KPIs and paginated AJAX data tables that avoid full-table scans on historical service logs.

How is multi-depot access controlled across regional managers and external workshop contractors?

Role-based access control binds every authenticated session to permitted depot IDs and functional capabilities. Regional managers see only their assigned depots, workshop contractors access only job cards routed to their bay, and every compliance sign-off writes an immutable audit trail entry.

03 — Similar project?

describe what is different about yours

Build yours.

Tell me what exists, what you need and the deadline. Fixed price for a defined scope, or $55/day (8–9 hours work) with a written plan first.

Solitaire Corporate Park, Makarba, Ahmedabad, Gujarat 380015, India · IST (UTC+5:30) · --:-- IST · Mon–Fri 09:00–18:00 IST · US & EU overlap daily

No newsletter, no CRM. Just a reply.