<?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: Tristan</title>
    <description>The latest articles on DEV Community by Tristan (@tristan_e2f7a70d8d9513a6c).</description>
    <link>https://dev.to/tristan_e2f7a70d8d9513a6c</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%2F3953745%2Fed87955d-f8ba-4a7a-8bbd-f97f8fb61f55.png</url>
      <title>DEV Community: Tristan</title>
      <link>https://dev.to/tristan_e2f7a70d8d9513a6c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tristan_e2f7a70d8d9513a6c"/>
    <language>en</language>
    <item>
      <title>Building a source-backed restaurant nutrition calculator with Next.js</title>
      <dc:creator>Tristan</dc:creator>
      <pubDate>Tue, 04 Aug 2026 11:24:56 +0000</pubDate>
      <link>https://dev.to/tristan_e2f7a70d8d9513a6c/building-a-source-backed-restaurant-nutrition-calculator-with-nextjs-5dj0</link>
      <guid>https://dev.to/tristan_e2f7a70d8d9513a6c/building-a-source-backed-restaurant-nutrition-calculator-with-nextjs-5dj0</guid>
      <description>&lt;p&gt;Restaurant nutrition tools look simple: choose an item, add the numbers, and show a total. The difficult part is making the result trustworthy.&lt;/p&gt;

&lt;p&gt;I built &lt;a href="https://eatwisecalc.com/" rel="noopener noreferrer"&gt;EatWise&lt;/a&gt; to explore that problem. It currently provides free calculators for restaurant menus such as Chick-fil-A, Arby's, and Starbucks. The main goal is not to invent nutrition data, but to make published information easier to combine and understand.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Keep the source next to every menu item
&lt;/h2&gt;

&lt;p&gt;A calculator becomes fragile when nutrition values are copied into anonymous rows. For EatWise, each normalized item keeps its nutrition facts together with the source URL. When a restaurant publishes a PDF or nutrition page, that source remains visible in the product instead of disappearing inside the data pipeline.&lt;/p&gt;

&lt;p&gt;The normalized shape is deliberately boring: item name, category, calories, protein, carbohydrates, fat, sodium, serving information, and source metadata. Generated TypeScript data lets the calculator render quickly without waiting for a database request, while repeatable refresh scripts make future updates less error-prone.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Treat totals as estimates, not medical truth
&lt;/h2&gt;

&lt;p&gt;Adding menu items is deterministic, but the real meal may not be. Portions vary, recipes change, and customizations can be prepared differently between locations.&lt;/p&gt;

&lt;p&gt;That means the UI needs to explain its limits. EatWise shows estimate disclosures and source links near the calculator experience. This is more useful than hiding caveats in a footer, because the user sees them while making a decision.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Keep calculator state plain
&lt;/h2&gt;

&lt;p&gt;The calculation layer does not need a complicated abstraction. Each selected item has a quantity, and the total is a reduction across the selected rows. Keeping that model simple makes it easier to verify calories and macros independently.&lt;/p&gt;

&lt;p&gt;The same principle applies to the interface: visible labels, clear selected states, keyboard-accessible controls, and tap targets that work on mobile. Nutrition data is already dense, so the interaction should not add more cognitive load.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Make evidence part of the product
&lt;/h2&gt;

&lt;p&gt;A source-backed tool should answer three questions without making users hunt:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where did this number come from?&lt;/li&gt;
&lt;li&gt;When was the source updated?&lt;/li&gt;
&lt;li&gt;What can make the real value different?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those questions shaped the page design more than decorative features did. Source links and estimate language are not legal afterthoughts; they are core product features.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Test the rendered result
&lt;/h2&gt;

&lt;p&gt;The current stack uses Next.js 16, React 19, and TypeScript. The test workflow builds the production site and checks rendered HTML for important content, metadata, and source disclosures. I also check desktop and mobile layouts because calculator controls that work with a mouse can still fail on a phone.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;The most important lesson is that data tools earn trust through traceability. A perfectly styled total is not very useful if nobody can tell where it came from.&lt;/p&gt;

&lt;p&gt;My next steps are to improve freshness checks, expand customization support, and keep simplifying the mobile flow.&lt;/p&gt;

&lt;p&gt;You can try the live calculator at &lt;a href="https://eatwisecalc.com/" rel="noopener noreferrer"&gt;EatWise&lt;/a&gt;. I would especially appreciate feedback on source visibility, mobile usability, and which restaurant calculator would be most useful next.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;EatWise is an independent tool and is not affiliated with the restaurant brands it covers. Nutrition values are estimates based on published information and can change.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>nextjs</category>
      <category>buildinpublic</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
