Globetrotter: A Flight Tracker That Runs in the Browser
Flight history tends to scatter. A few trips live in email confirmations, some in a calendar, and some only in memory. Apps that collect it all in one place usually want an account and keep your data on their servers. I wanted a personal view of my own flying that I could open in a browser, with the data staying on my machine. That is why I built Globetrotter.
Why I built it
I like the passport-style view in Flighty: a map, some stats, a sense of where you have been. I wanted something in that spirit that I fully control. My constraints were simple: no backend, no build step, no account. If I can open index.html and it works, I never have to maintain a server or a toolchain for a side project.
What it does
- World map. A Leaflet map shows great-circle flight routes and the airports I have visited. A day/night terminator is recomputed every minute from the actual solar position.
- Local clocks. A large home-base clock sits in the header, and a scrolling strip shows a clock for every airport visited. Each is styled sunlit-gold or starlit-navy depending on whether it is day or night there right now.
- Boarding pass. A golden-ticket-style card summarizes flight count, distance, flight time, airports, airlines and countries, with a foil shimmer and a cursor-tracking tilt.
- Dashboard. Flights by year, top airlines, Boeing vs. Airbus vs. other, domestic vs. international, continents covered, longest and shortest flight, busiest year and top routes.
- Travel Wrapped. Pick a year and get a shareable card with flights, distance, flight time, countries, continents, top airline, favourite route, longest flight and busiest month. It downloads as a PNG, or can be shared directly from a phone where the browser supports image sharing.
- Flight log. Every flight, newest first, with edit and delete.
How it works
The stack is vanilla HTML, CSS and JavaScript, plus Leaflet for the map and Esri tiles for the basemap, which need no API key. There are no frameworks, no bundler and no package manager. The code is split into plain script files with clear jobs:
app.jsholds state, rendering and event handling.geo.jsholds distance and great-circle math, the solar terminator and timezone conversions.airports.jsis the built-in airport database: code, name, city, country, latitude and longitude, and timezone.airlines.jsmaps ICAO airline codes to display names for the importer.continents.jslooks up a continent from a country, for the continents card.csvImport.jsparses CSV and calendar imports.wrapped.jsdraws the share card onto a canvas for PNG export.seedFlights.jsis a starter flight history.
Storage without a server
Flights and settings live in the browser's localStorage. Nothing is sent anywhere. Settings offers a JSON export and import, so a backup is one file. On the first open in a browser with no saved flights, the app seeds itself from seedFlights.js so it does not start empty. After that, everything comes from what I add, edit or import.
Getting durations right across time zones
The add-flight form asks for departure and arrival local times, not just a date. Each airport record carries an IANA timezone, so the app can convert both times and compute the exact duration even when the flight crosses zones. That is why the airport database stores a timezone next to the coordinates. If a code is missing, Settings lets me add a custom airport with its code, name, city, country, coordinates and IANA timezone.
Importing existing history
Typing in every flight by hand would put people off, so the importer accepts a Flighty CSV export, any spreadsheet CSV with From, To and Date columns, or a calendar .ics file. Dates, times, airlines and aircraft are parsed directly. Re-importing updates existing flights instead of duplicating them, which means I can import again later without cleaning up. Unrecognized airport or airline codes are listed after the import so I can fill the gaps.
What I learned
- A static app can be a full app. With
localStorageplus a JSON backup, I got persistence, privacy and zero hosting complexity. The trade-off is that data lives in one browser, so the backup feature matters. - Store the timezone with the place. Putting an IANA timezone on every airport makes duration, local clocks and day/night styling all fall out of the same data.
- Make imports idempotent. Updating existing flights on re-import is what makes bulk import safe to repeat.
- Think about what exports contain. Flighty's export can include PNR or booking reference codes. The repository's
.gitignoreexcludes anydata/directory so a raw export cannot be committed by accident. That is a small habit worth having whenever personal data passes through a project. - Skipping the toolchain has a cost and a benefit. With no build step, a plain local server is enough to run it. I serve it with
python3 -m http.server 8000, which also avoids occasionalfile://quirks in some browsers.
Try it
The app is live at globetrotter.iramesh.com. Because it seeds itself on a fresh browser, you will see a populated map and dashboard straight away. From there you can add a flight, import your own CSV or calendar file, or open Travel Wrapped for a year you have flown. Your data stays in your browser.
Conclusion
Globetrotter started as a wish for a private, Flighty-like view of my own travel. Keeping it to static files and browser storage made it simple to build and easy to run. If you have a side project that handles personal data, consider whether it needs a server at all. For this one, it did not.