Internship · Starwatch Technologies · 2024
Live fleet tracking. From 13.4 seconds to 2.1.
A live map of 150+ vehicles, built at Starwatch for a state government’s transport team. I built most of the frontend, and moved the slow part of it to the server.
- Role
- Full-stack developer intern, team of 3
- Timeline
- Feb – Apr 2024
- Stack
- Next.js, React, FastAPI, Python, Leaflet, Material UI
- Company
- Starwatch Technologies
01 · Context and problem
The browser was doing the server’s job.
Officials in a state government’s transport team used the app to assign drivers to trips and watch every vehicle live: where it went, where it stopped, and what it spent on fuel and repairs. Delays in that data were a real problem.
The app sent every vehicle’s data to the browser, and added it up and filtered it there. With 150+ vehicles reporting live, the page took 13.4 seconds to load, and each update took about 6.8 seconds to arrive.
- A team of three
- 150+ vehicles, live
- Four kinds of users
Hover to slow the road down.
02 · My part
Full-stack developer intern, team of 3
A team of three: our team lead, another intern and me.
- 01I built most of the frontend: the live map, the theme, the charts, the Excel export, and what each kind of user can see.
- 02I also built the backend module that does the filtering, in FastAPI.
03 · Key decisions
The calls that shaped it.
- q1
Where should the filtering happen?
On the server. The browser was downloading every vehicle, then adding up and filtering the data itself. I moved that work to a FastAPI backend, so the browser gets only what the screen needs. Lookups there find a vehicle by its key instead of scanning a list.Trade-off · More work on the server, and one more API to look after. - q2
Which map library?
Leaflet, through react-leaflet. It’s free and open source, needs no API key, the team already used it in other products, and I had used it before.Trade-off · None of the extras a paid map service gives you out of the box. - q3
Who should see what?
Four roles. A super admin sees everything and manages the other admins and their regions. A route admin manages the drivers in one region. The KYC team handles drivers’ KYC requests and legal matters. And the drivers themselves.Trade-off · Every screen and every query has to respect the role and the region. - q4
How do officials report to their seniors?
With Excel files the app exports. Each admin can download their region’s records: fuel and repair costs, trip times, and how many stops and breaks each driver took.Trade-off · One more format to keep correct whenever the data changes.
04 · Outcome
The same map, six times faster.
Officials saw their live map in about two seconds instead of thirteen, and could export their region’s records for senior officials.
Measured with browser DevTools and Postman, before and after the change.
05 · In hindsight
In hindsight
It was one of the biggest stretches I had taken on at the time. I took on more than I was comfortable with, and it worked out.