<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Federico</title>
    <description>The latest articles on DEV Community by Federico (@federicot).</description>
    <link>https://dev.to/federicot</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1391401%2Fb52d25a5-17cc-4279-8027-67f5f4a05488.jpg</url>
      <title>DEV Community: Federico</title>
      <link>https://dev.to/federicot</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/federicot"/>
    <language>en</language>
    <item>
      <title>Turning flight booking emails into a flight log, without letting strangers spend my AI quota</title>
      <dc:creator>Federico</dc:creator>
      <pubDate>Sat, 14 Nov 2026 08:43:44 +0000</pubDate>
      <link>https://dev.to/federicot/turning-flight-booking-emails-into-a-flight-log-without-letting-strangers-spend-my-ai-quota-16c3</link>
      <guid>https://dev.to/federicot/turning-flight-booking-emails-into-a-flight-log-without-letting-strangers-spend-my-ai-quota-16c3</guid>
      <description>&lt;p&gt;I built FlyLog (&lt;a href="https://fly-log.netlify.app" rel="noopener noreferrer"&gt;https://fly-log.netlify.app&lt;/a&gt;), a free app that logs every flight you take. It draws your routes on a world map, adds up your distance, and replays your trips on a globe.&lt;/p&gt;

&lt;p&gt;The maps were the fun part. Getting flights into the app was the hard part.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frs3rkrqq3o6ma6faw5wr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frs3rkrqq3o6ma6faw5wr.png" alt="FlyLog's world map showing flight routes from Sydney to Europe and Asia" width="800" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem: your flights are stuck in your inbox
&lt;/h2&gt;

&lt;p&gt;Most people don't remember their flight numbers or dates. The details sit in a confirmation email from the airline or a travel agent. To log a flight, you open the email, find the airport codes, the date, the airline and the flight number, and type each one into a form. A return trip with a connection means doing that four times.&lt;/p&gt;

&lt;p&gt;Most people give up after a few flights, and then the map and the stats show nothing worth looking at.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix: let an AI read it
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg42nyc0zv2a23it511gc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg42nyc0zv2a23it511gc.png" alt="The Describe tab: a trip typed in plain words, turned into two flights ready to save" width="800" height="743"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I added a "Describe" tab. You paste the text from your booking email, or type the trip in your own words, like "Sydney to London via Singapore on Qantas, 3 March, back on the 20th". FlyLog fills in every flight, and you check them before saving.&lt;/p&gt;

&lt;p&gt;Behind it, Gemini 2.5 Flash Lite reads the text through Firebase AI Logic. A JSON schema makes it return the same fields every time: airports, dates, times, airline, flight number and cabin. The prompt splits connections into separate flights, writes out the return leg, and never invents a flight number or a time that isn't in the text.&lt;/p&gt;

&lt;h2&gt;
  
  
  The new problem: anyone could use my quota
&lt;/h2&gt;

&lt;p&gt;Every call to Gemini costs money, and the call comes from the browser. Anyone can open the network tab, copy the request and run it in a loop, or use my key in their own app. The same goes for the live flight status feature, which calls AeroDataBox through a Netlify function.&lt;/p&gt;

&lt;h2&gt;
  
  
  Proving the request comes from my site
&lt;/h2&gt;

&lt;p&gt;Firebase App Check makes the browser prove it is running FlyLog before it can call either service. It gets that proof from reCAPTCHA Enterprise, which only works on the domains I allow. With App Check enforcement turned on for Firebase AI Logic, Firebase rejects any Gemini call without a valid token.&lt;/p&gt;

&lt;p&gt;For the Netlify function I check the token myself. App Check tokens are signed JWTs, so the function only needs Firebase's public keys and the &lt;code&gt;jose&lt;/code&gt; library rather than &lt;code&gt;firebase-admin&lt;/code&gt; and a service-account secret:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;jwks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createRemoteJWKSet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="no"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"https://firebaseappcheck.googleapis.com/v1/jwks"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;jwtVerify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;jwks&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;algorithms&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"RS256"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;issuer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`https://firebaseappcheck.googleapis.com/${projectNumber}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;audience&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sb"&gt;`projects/${projectNumber}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sb"&gt;`projects/${projectId}`&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  One catch: deploy previews
&lt;/h2&gt;

&lt;p&gt;reCAPTCHA has no wildcards. Each Netlify deploy preview gets its own address, like &lt;code&gt;deploy-preview-83--fly-log.netlify.app&lt;/code&gt;, so previews get no token and the AI tab fails there. Allowing all of &lt;code&gt;netlify.app&lt;/code&gt; would let any Netlify site use my key. So when a pull request needs the real APIs, I add that one preview address, and the PR gets a checkbox reminding me to remove it when it closes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;FlyLog is free, works in English and Italian, and the code is on GitHub: &lt;a href="https://github.com/FedericoTartarini/fly-log" rel="noopener noreferrer"&gt;https://github.com/FedericoTartarini/fly-log&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Paste your next booking email into it, and tell me if it gets a flight wrong. FlyLog doesn't store the text you paste. It only saves the flights you confirm.&lt;/p&gt;

</description>
      <category>react</category>
      <category>firebase</category>
      <category>showdev</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
