Skip to main content
CASE STUDY

HowWeBuildanIoTGPSFleetTrackingPlatform

This is the playbook behind Pixytan, our own GPS platform that tracks 30,000+ vehicles in real time. Geofencing alerts, driver scoring, fuel monitoring, and the engineering trade-offs that make it hold up at that scale.

Overview
DomainIoT / Fleet Management
Typical Timeline8 months full stack
Team Shape2 Flutter + 2 Node.js + 1 Embedded
Market Range$100K to $160K

This is how we build a real-time fleet tracking platform with our team, and it is the same engineering that runs Pixytan, where we track 30,000+ vehicles. The numbers up top are how a build like this usually shapes up. The rest of the page is the part under the hood. The protocol choices, the database we landed on, the bits we got wrong the first time and had to redo.

The Problem We Keep Seeing

A fleet of tens of thousands of vehicles, and almost no real-time visibility into any of them. Drivers phone in their own location. Dispatch runs on radio and guesswork. A truck breaks down on a highway and the operations room hears about it whenever the driver gets around to calling, which can be hours. Fuel goes missing. Routes drift. And because nobody is measuring how people actually drive, the accident rate just sits there.

The off-the-shelf GPS boxes on the market tend to fall down in the same three places. The hardware is third-party with locked firmware, so you cannot wire in your own sensors or pull OBD-II engine diagnostics. The dashboards were built for small fleets of fifty or a hundred vehicles and they buckle once you point real volume at them. And the alerts come over SMS with a 30 to 60 second lag, which is a lifetime when a vehicle has just crossed a boundary it should not have.

So the brief runs well past dots-on-a-map. Position updates every 10 seconds. Geofence alerts that fire in under 2 seconds, not half a minute. Driver scoring off real acceleration and braking and cornering. Fuel monitoring that can actually catch a siphon. Maintenance warnings that read engine data instead of a fixed calendar. And a mobile app, because the people running a fleet are rarely at a desk. All of it has to stay up while every device in the fleet reports at once. That last constraint is the one that decides everything after it.

How We Build It

We build it as a full-stack platform. Custom hardware, mobile apps, backend, and a web dashboard, all one system rather than glued-together parts. The GPS device is designed in-house with an OBD-II port for engine data, an accelerometer for driver behavior, and a SIM cellular link to get the data out. Each unit reports its position every 10 seconds over MQTT, which is a lightweight messaging protocol built for exactly this. Tiny devices, thin pipes, lots of them.

The backend is Node.js with a Mosquitto MQTT broker doing the device connections. AWS IoT Core handles registration, auth, and message routing once the device count climbs. Location data drops into TimescaleDB, a PostgreSQL extension tuned for time-series, which squeezes months of GPS coordinates into a fraction of what a plain table would eat. A Redis layer holds the latest position for every vehicle, so when a manager opens the dashboard the whole fleet paints in under a second instead of hammering the database for it.

Two front ends, two jobs. The React web dashboard is the operations-room view. Vehicle clusters on a map, fleet-wide analytics, geofence setup, maintenance scheduling. The Flutter mobile app is for the manager who is out in the field, with live tracking, push alerts, trip history, and driver scorecards in their pocket. Both pull live updates over WebSocket, and both reconnect on their own when the network drops, because on mobile it will.

Tech Stack

Flutter, Node.js, MQTT (Mosquitto), PostgreSQL, TimescaleDB, Redis, AWS IoT Core, React dashboard, custom GPS hardware with OBD-II, WebSocket, Firebase Cloud Messaging

The Decisions That Mattered

MQTT over HTTP, and the gap is not subtle at scale. Run an HTTP request from 30,000 devices every 10 seconds and you are opening something like 180,000 TCP connections a minute. MQTT keeps one persistent connection per device alive with 2-byte keepalive packets. The overhead drops from roughly 800 bytes per HTTP request to about 4 bytes per MQTT publish. At fleet scale that is the difference between a few hundred megabytes of pure protocol chatter per minute and well under a megabyte. HTTP would have buried us.

TimescaleDB over plain PostgreSQL or MongoDB for the location store, and we would make that call again. GPS data is time-series by nature. Lat, long, speed, heading, timestamp, over and over. TimescaleDB's hypertables split it into time-based chunks automatically, and its native compression knocks storage down dramatically once data ages past a week. A query like "give me every position for vehicle X in the last 24 hours" comes back in milliseconds even with billions of rows behind it. The same query on vanilla PostgreSQL crawls into the seconds, which is the difference between a usable dashboard and a spinner.

Geofencing runs server-side, not on the device. Every incoming coordinate gets checked against the active fences for that vehicle's fleet. A fleet can have thousands of fences, and a naive point-in-polygon sweep across all of them would be far too slow. So we put the fences behind an R-tree spatial index, which turns the check from O(n) into O(log n). A single coordinate tested against thousands of geofences finishes in well under a millisecond. That is what lets the under-2-second alert promise actually hold.

Custom hardware added about 3 months, and it was worth every week. Generic trackers cannot read OBD-II engine data. RPM, coolant temperature, fuel level, trouble codes, none of it. Our device folds GPS, GSM, an accelerometer, and an OBD-II reader into one unit. That sensor data is what driver scoring, fuel-theft detection, and predictive maintenance all stand on. Without the custom board, those features are just marketing words. (We have shipped enough of these to know the off-the-shelf route quietly caps what the platform can ever do.)

What Gets Built

Real-Time Vehicle Tracking

Every vehicle reports its position every 10 seconds. The React dashboard paints them on a map with color-coded status. Green for moving, yellow for idle, red for stopped, gray for offline. Click any vehicle and you get live speed, heading, nearest address, current driver. The map clusters markers when you are zoomed out and breaks them apart as you zoom in, which is the only way 30,000 markers stay smooth in a browser. Historical playback lets a manager replay any route for the past 90 days, with the animation speed under their control.

Geofencing and Instant Alerts

Managers draw fences right on the map. Circles, rectangles, custom polygons. Cross one, in or out, and the alert fires within 2 seconds across three channels at once. Push to the Flutter app, email to the manager, popup on the dashboard. The usual jobs are depot entry and exit, restricted-zone monitoring, route-corridor enforcement, and a heads-up when a vehicle reaches a customer site. We design the engine to run those checks for the whole fleet against thousands of live fences with no lag a human would notice.

Driver Behavior Scoring

The accelerometer reads three axes of motion non-stop. The backend turns that into harsh braking (deceleration past 0.4G), rapid acceleration, sharp cornering, and speeding. Each trip lands a 0 to 100 score weighted on how often and how hard those happen. Drivers see a simplified version of their own. Managers get the full ranking, trend lines for who is improving and who is sliding, and an automatic flag on anyone under 60. The target here is fewer hard stops and steadier driving across the fleet. A score nobody trusts changes nothing, so we build it to be explainable.

Fuel Monitoring and Theft Detection

OBD-II hands us a fuel-level reading every 30 seconds. The system learns each vehicle's normal consumption against distance, engine load, and how it is being driven. When the level drops faster than that baseline says it should, which usually means a siphon, or a refuel shows up that does not match any authorized stop, it flags right away. The manager gets the alert with a timestamp, a location, and an estimated volume. We design this to catch the quiet leakage that a monthly fuel report never surfaces in time to do anything about.

Predictive Maintenance Alerts

The OBD-II feed carries engine RPM, coolant temperature, battery voltage, and diagnostic trouble codes. The system watches those over time and flags the patterns that matter. Coolant creeping up across a week, voltage sagging below a line, a trouble code that keeps coming back. The whole point is to warn before the breakdown, not file a report after it. Managers get a per-vehicle service calendar built from real engine behavior instead of a fixed every-N-kilometers rule that ignores how each truck is actually doing.

Fleet Analytics Dashboard

The React dashboard rolls up the fleet-wide picture. Distance per day, fuel trends, average driver scores, idle-time percentages, maintenance spend. Custom reports run for any date range and export to PDF or CSV. Comparison views stack one vehicle against the fleet average, or one driver against their peers. We design it to load in a couple of seconds even for a large fleet, leaning on TimescaleDB continuous aggregates for the pre-computed metrics and Redis for the views people open most.

Mobile Fleet Manager App (Flutter)

Managers are not at a desk, so the Flutter app carries the essentials. Live vehicle positions on a map, push alerts for geofence events and driver violations, trip history with route playback, driver scorecards. A quick-action button fires a message straight to a specific driver. An offline mode caches the last known position of every vehicle, so even with no signal a manager can still see roughly where the fleet is. We build the mobile experience to a real app-store quality bar, not a wrapped webpage.

What the Build Is Engineered to Do

These are the design targets we hold the system to, the engineering it takes to make fleet tracking fast and dependable at scale. They describe the architecture and the one stat we can state as fact, the 30,000+ vehicles we track on Pixytan. They are not a specific customer's savings figure.

CapabilityTargetHow
Vehicles tracked30,000+Real, on Pixytan, each reporting every 10 seconds
Position cadenceEvery 10 secondsMQTT publish on persistent device connections
Alert deliveryUnder 2 secondsR-tree geofence index, push out the moment it trips
History queryMillisecondsTimescaleDB hypertables over billions of rows
Driver scorePer trip, 0 to 100Transparent weighting on accelerometer data
Dashboard loadUnder a secondRedis caches the latest position per vehicle

Build Custom, or Use AWS IoT Core?

Custom platform or a managed cloud one? It comes down to device count. Cloud platforms bill per message and per device, which is friendly when you are small and brutal when you are not. A custom stack costs more up front and far less at the margin as you grow. Here is the honest version.

ApproachCostTimelineCustomizationBest For
Custom IoT Platform$80K to $180K upfront4 to 7 monthsFull control5,000+ devices with custom protocols or hardware
AWS IoT Core$5 to $10/device/mo at scale2 to 6 weeksModerate (AWS ecosystem lock-in)Prototypes and fleets under 1,000 devices
Azure IoT Hub$5 to $12/device/mo at scale2 to 6 weeksModerate (Azure ecosystem)Enterprises already on the Microsoft stack
Particle.io$0.35 to $0.69/device/mo + hardware1 to 2 weeksLow (their hardware plus cloud)Quick prototyping, small-scale deployments

Those are market figures to reason with, not a Geminate Solutions quote. The crossover is roughly a thousand devices. Run 500 devices reporting every 5 seconds and a managed cloud platform's message fees alone can climb into the tens of thousands a year, while a custom MQTT broker on dedicated infrastructure carries the same load for a few thousand. Below the line, cloud wins on speed. Above it, owning the stack wins on cost. (Where your line sits depends on report frequency and retention, so do the math on your own numbers before anyone's slide deck does it for you.)

The time-series pipeline here travels well past GPS. The same shape powers manufacturing sensor systems, energy smart-meter platforms, and agricultural monitoring networks. If you are weighing a partner for an IoT build, the thing to look for is a team that has actually shipped hardware and software together. Pure software teams underestimate the firmware, and the gap between a clean simulation and a device rattling around at 80 km/h is exactly where most IoT projects come apart.

What We've Learned Building These

IoT has a hardware-software feedback loop that pure software never deals with. An early batch of our GPS devices had an antenna placement that lost signal inside metal truck cabins, and no clever code fixes a hardware problem. We could not write our way out of it. It took a board revision and a few weeks we had not planned for. The lesson stuck. Prototype the hardware in the real world early, because a lab bench does not behave like a steel cab doing highway speed.

MQTT quality-of-service levels matter more than they look. QoS 0, fire and forget, drops a tiny fraction of messages under normal load, which is fine for position updates since the next one is 10 seconds out. But losing a single geofence alert or maintenance warning is not fine. So we split it. QoS 1, at-least-once, for the alerts that have to land. QoS 0 for the routine position stream. That keeps the bandwidth lean while guaranteeing the messages that actually matter always arrive.

The data volume from a large fleet reporting every 10 seconds is enormous. We are talking hundreds of millions of location rows a day. Ordinary database hygiene, the vacuums and index rebuilds that work fine for a normal app, just fall over at that scale. TimescaleDB's automatic chunk management and compression were not a nice-to-have, they were the whole reason it stayed affordable and fast. Skip them and storage balloons and queries rot within weeks.

Driver scoring only works if drivers trust it. Our first version flagged every hard brake, including the emergency stop that probably saved someone. Drivers said it was unfair, and they were right. So we added context. Braking near a traffic signal, a stop sign, or a known hazard stopped counting against the score. A hard stop on an open highway still did. That one change is what turned the feature from something drivers resented into something they actually engaged with, which is when fleet managers finally saw driving patterns start to move.

Frequently Asked Questions

How long does it take to build a GPS fleet tracking platform?

Plan on around 8 months for a full system with custom hardware, a Flutter app, a Node.js backend, and a React dashboard. A software-only MVP on off-the-shelf GPS hardware, with basic tracking and geofencing, can launch in 12 to 16 weeks. The custom GPS device with OBD-II integration is what adds roughly 3 months. Skip the hardware and you skip that stretch.

How much does a fleet management system cost to build?

In the market today a full-stack platform with custom hardware, mobile apps, backend, and dashboard runs about $100,000 to $160,000 for the first build. Software-only, on off-the-shelf trackers, is closer to $60,000 to $90,000. Infrastructure for a fleet in the tens of thousands of vehicles lands around $1,500 to $2,500 a month depending on report frequency and retention. These are market ranges to plan against, not a Geminate Solutions quote.

What technology powers real-time tracking of 30,000+ vehicles?

MQTT carries device-to-server traffic with almost no overhead, which is its entire reason for existing. TimescaleDB, a PostgreSQL extension for time-series data, stores the location history without the storage bill getting silly. AWS IoT Core manages the connections at scale. The Flutter app draws live positions over WebSocket against the Node.js backend, and Redis caches the latest position per vehicle for sub-second loads. We run 30,000+ vehicles on this exact stack with Pixytan.

How does driver behavior scoring work in this system?

The GPS hardware reads acceleration, braking, cornering G-forces, and speed off an accelerometer. The backend scores each trip 0 to 100, weighing harsh braking (deceleration past 0.4G), rapid acceleration, sharp turns, and speeding. Managers get a ranking and the system flags anyone under 60 for coaching. We design the scoring to be transparent, so a manager can see exactly why someone got flagged instead of trusting a black box.

Can Geminate Solutions build a similar fleet tracking system for our business?

Yes. The MQTT pipeline, the real-time tracking layer, and the analytics engine behind Pixytan are patterns we build with our team and carry from one product to the next. Geminate Solutions has shipped 50+ products. A fleet platform usually runs $60,000 to $160,000 depending on whether you need custom hardware, and a software-only build launches in 12 to 16 weeks. Start at geminatesolutions.com/get-started for a free project assessment.

Is it worth building custom IoT tracking instead of using AWS IoT Core alone?

AWS IoT Core handles the connection layer, and that part is genuinely useful. But it does not give you firmware, data pipelines, geofencing logic, or dashboards. Patient device monitoring, warehouse tracking, cold-chain delivery, they all need business logic the managed service has no opinion about. In our experience it covers maybe a fifth of what a production IoT platform actually needs.

What are the ongoing costs of running an IoT fleet platform?

SIM data plans land around $3 to $8 per device a month. Hardware wears out and needs replacing every 3 to 4 years. And the time-series database plus broker is a recurring hosting line that grows with your data. Most teams underestimate device maintenance specifically. A fair rule of thumb is 15 to 20 percent of the initial build each year for firmware, hardware swaps, and scaling. Treat those as market planning figures, not a fixed quote.

When does it make sense to build custom IoT versus use a cloud platform?

When you need to own the data or you have logic the cloud cannot express. A team building an IoT MVP can absolutely start on a cloud platform and ship faster. But once you have compliance requirements, custom hardware, or device counts in the thousands, the per-device cloud bill usually overtakes the cost of owning the stack. Campus IoT, multi-vendor device fleets, and fleet tracking past a few hundred devices all tend to cross that line.

How do you choose a partner to build IoT software?

Ask for proof of real hardware-software integration, not just app screenshots. Push on MQTT at scale, firmware OTA updates, and time-series pipelines, because those are where IoT projects quietly die. A partner who has shipped fleet tracking, device monitoring, and high-volume telemetry knows the gap between a lab demo and a device bouncing down a highway. Be wary of an app shop treating IoT as a side quest.

What a Build Like This Costs in the Market

For planning, a full-stack fleet platform with custom hardware, mobile apps, backend, and dashboard sits in the $100,000 to $160,000 range in the market right now. The hardware design and manufacturing is what pushes it up. A software-only build on off-the-shelf trackers runs lower, closer to $60,000 to $90,000. Running it lands somewhere around $1,500 to $2,500 a month for hosting, the MQTT broker, TimescaleDB storage, and AWS IoT Core, with a few hundred more on top for firmware work and device-fleet upkeep. These are market ranges to budget against, not a Geminate Solutions quote. The real number depends on device count, report frequency, and how much custom hardware you need.

The more useful comparison is against renting one. Off-the-shelf GPS subscriptions run roughly $15 to $30 per vehicle a month in the market, with locked features and no OBD-II, and you never own the data or the platform. At large fleet sizes that recurring line gets big fast. So the build-versus-rent question is less about the upfront number and more about whether you want fleet tracking to stay an operational cost forever or become an asset you control. That is exactly the trade-off we would rather lay out honestly up front than oversell.

Why Teams Bring This to Us

An IoT build like this needs firmware, cloud architecture, and mobile, all living in the same set of heads at the same time. That mix is genuinely hard to assemble in a hurry, and harder still to assemble in people who have actually shipped IoT at scale rather than read about it. More often, though, the issue is not skill at all. The in-house engineers are already buried in the core product, and pulling them onto a tracking platform would stall the roadmap for months. Building it with our team keeps the product moving while the platform gets built in parallel, by people who have done this exact shape of thing before.

We build it with Pixytan ourselves, so this is not theory for us. We work as a product partner, not a code shop taking a spec over the wall and hoping. That is usually why the suggestion to split MQTT QoS levels, or to put the geofences behind a spatial index, or to score braking with context, comes from our side rather than yours. We have already watched which decisions hold up once real devices are out in the world, and we would rather tell you before you hit them than after.

Thinking about building one?

The architecture, the technology choices, and the scaling patterns on this page are the same ones we build with our team for your fleet. Tell us what you are trying to track and we will tell you, honestly, what it takes.

Ready to get started?

Start a Project