One Dart proxy between our Flutter app and every data supplier
We just launched AVICLIMAR, a map that shows live aircraft (ADS-B), ships (AIS) and weather layers together, on Android, iOS and the web from one Flutter codebase. The most useful decision we made was one we almost skipped: the app never talks to a data supplier directly.
The problem
Every layer on the map comes from a paid real-time API: aircraft positions, vessel positions, weather and air quality. Calling them straight from the app would mean shipping API keys inside an APK, an IPA and a web bundle, where anyone can pull them out. It would also mean every user's map viewport becomes its own supplier request, and supplier plans are priced per request.
One Dart proxy in front of everything
Every supplier call goes through a small proxy written in pure Dart. It is compiled ahead of time and runs in a container on AWS behind CloudFront. The app only knows the proxy's URL and sends the signed-in user's ID token with each request. The proxy holds the supplier keys and decides what to forward.
Writing it in Dart paid off more than we expected: the proxy and the app share models and tests, and one person can work across both without switching languages.
Making nearby users share one request
Map viewports almost never match exactly, so caching on the raw bounding box hits almost nothing. Instead, the app widens each viewport outward onto a fixed grid before asking for data. The proxy fetches on that same grid, so two people looking at roughly the same area ask for the identical box, and the second one is served from cache. The grid is coarse enough to collide often and fine enough that the extra area stays cheap.
Metering each user
A shared supplier quota is easy for one enthusiastic user to burn through. The proxy meters actions per user as credits: free users get a rolling daily allowance and can top up by watching an ad, and Pro covers heavier use. Every limit lives in configuration rather than code, so we can tune it without a release.
What we'd do differently
- Put the proxy in from day one. Retrofitting it meant touching every data layer at once.
- Design the grid snapping alongside the cache, not after it. They only work together.
- Treat supplier timeouts as normal. Real-time APIs stall, and the app should show the last good data rather than an error.
Try it
- Web: https://map.aviclimar.com (needs a free account)
- Android: https://play.google.com/store/apps/details?id=com.aviclimar
- iOS: https://apps.apple.com/us/app/aviclimar/id6814744397
I'm one of the developers, and I'm happy to answer questions about the Flutter side, the proxy or the map layers in the comments.