<?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: Lavay Garg</title>
    <description>The latest articles on DEV Community by Lavay Garg (@0xshellghost).</description>
    <link>https://dev.to/0xshellghost</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%2F4160849%2F122cb219-2a83-4608-9a7f-fdddea165a47.png</url>
      <title>DEV Community: Lavay Garg</title>
      <link>https://dev.to/0xshellghost</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/0xshellghost"/>
    <language>en</language>
    <item>
      <title>Built Mess Macro Coach For My Friend Jatin</title>
      <dc:creator>Lavay Garg</dc:creator>
      <pubDate>Sun, 04 Oct 2026 17:45:48 +0000</pubDate>
      <link>https://dev.to/0xshellghost/built-mess-macro-coach-for-my-friend-jatin-419b</link>
      <guid>https://dev.to/0xshellghost/built-mess-macro-coach-for-my-friend-jatin-419b</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-weekend-2026-10-01"&gt;Hacktoberfest Weekend Challenge: Build for a Friend&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;Mess Macro Coach is a protein tracker for hostel food, built for my friend Jatin.&lt;/p&gt;

&lt;p&gt;Jatin is 72 kg and goes to the campus gym 5 days a week. A lifter his size aiming for 2 g of protein per kg needs &lt;strong&gt;144 g a day&lt;/strong&gt;. He eats at our hostel mess like the rest of us, and I wanted to know what that food actually gives him.&lt;/p&gt;

&lt;p&gt;You paste the week's mess menu, or upload a photo of the noticeboard, and the app shows the protein for every meal and every day, then suggests cheap canteen add-ons to close the gap.&lt;/p&gt;

&lt;p&gt;For our hostel's weekly menu (BH-2 and BH-3), mess food alone averages &lt;strong&gt;81 g a day&lt;/strong&gt;. That is about 63 g short of his target. His best day is 96.6 g and his worst is 64.7 g.&lt;/p&gt;

&lt;p&gt;The reason is dal. Mess dal is watery, and in my food table a katori of moong dal gives about 5 g of protein, not the 15 g people tend to assume.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Live app (hosted on Google Cloud Run): &lt;a href="https://mess-macro-coach-341031291694.asia-southeast1.run.app" rel="noopener noreferrer"&gt;https://mess-macro-coach-341031291694.asia-southeast1.run.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select the "IIIT Prayagraj weekly schedule" menu, press &lt;strong&gt;Analyze Menu Nutrition&lt;/strong&gt;, and click any day to see its meals.&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%2Fmoqm663099845qh5dd28.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%2Fmoqm663099845qh5dd28.png" alt=" " width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;{% embed https://github.com/0xshellghost/Mess_Macros_Coach %}&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;The main design decision is that &lt;strong&gt;the model reads and the code calculates&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mess menu (text or noticeboard photo)
        │
        ▼
Gemini 3.8 Flash (or local Gemma 2 / Qwen2-VL) reads the menu → a clean list of dish names, no numbers
        │
        ▼
Deterministic engine: looks up each dish in a table of 65+ Indian foods
(IFCT 2017 + USDA values) and does the math
        │
        ▼
Daily protein totals + budget canteen add-ons
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The model never writes a nutrition number.&lt;/strong&gt; Asking a model to "estimate the protein in this plate" invents numbers, so I only let it turn messy menu text into dish names.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The code does all the math&lt;/strong&gt; from a table of 65+ Indian foods based on the ICMR-NIN Indian Food Composition Tables (IFCT 2017) and USDA FoodData Central.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unknown dishes count as 0 g and are flagged&lt;/strong&gt;, so Jatin doesn't get false comfort from a dish the table can't match.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The portion sizes (a 150 g katori, a 35 g roti) are my own estimates, and so are items like mess milk (6.8 g / 190 ml). You can change the quantity of any item in the app with portion multipliers.&lt;/p&gt;

&lt;p&gt;Tech stack: React 19, TypeScript, Vite, Tailwind CSS v4, Node.js (Express server), and the &lt;code&gt;@google/genai&lt;/code&gt; SDK.&lt;/p&gt;

&lt;p&gt;While building the parser, I noticed menu entries like &lt;code&gt;"Egg Curry / Kadhai Paneer"&lt;/code&gt;. The slash represents an "either/or" mess option, so the parser was tuned to handle mutual exclusions rather than double-counting both proteins.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;I can swap the model.&lt;/strong&gt; Because the model is strictly limited to vision OCR and returns structured JSON strings, swapping between Gemini 3.8 Flash in the cloud and open models like Gemma 2 or Qwen2-VL locally via Ollama is a one-setting change. A messy noticeboard photo taken under poor hostel corridor lighting is a niche input, so having open vision models available is essential.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The food table is open and auditable.&lt;/strong&gt; Commercial calorie apps lock their food databases behind paywalls. Mine is an open TypeScript table (&lt;code&gt;messFoods.ts&lt;/code&gt;) that anyone can read. A student at IIT or NIT can check the exact grams, adjust the katori bowl size for their specific mess contractor, or submit a pull request with regional recipes (like Litti Chokha or Medu Vada).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Runs locally with Ollama.&lt;/strong&gt; The live demo is hosted on Google Cloud Run for convenience, but the codebase supports running fully offline with Ollama and Docker, ensuring Jatin's eating logs and timetable photos never leave his machine.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;These numbers are &lt;strong&gt;calculated from the menu, not logged intake&lt;/strong&gt;. I haven't measured what Jatin actually ate.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Day 1&lt;/th&gt;
&lt;th&gt;Day 2&lt;/th&gt;
&lt;th&gt;Day 3&lt;/th&gt;
&lt;th&gt;Average&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Mess food only&lt;/td&gt;
&lt;td&gt;87.8 g&lt;/td&gt;
&lt;td&gt;64.7 g&lt;/td&gt;
&lt;td&gt;66.3 g&lt;/td&gt;
&lt;td&gt;73.0 g&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;With canteen add-ons&lt;/td&gt;
&lt;td&gt;172.8 g&lt;/td&gt;
&lt;td&gt;159.7 g&lt;/td&gt;
&lt;td&gt;154.3 g&lt;/td&gt;
&lt;td&gt;162.3 g&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Add-on spend&lt;/td&gt;
&lt;td&gt;₹24&lt;/td&gt;
&lt;td&gt;₹45&lt;/td&gt;
&lt;td&gt;₹45&lt;/td&gt;
&lt;td&gt;~₹38/day&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The add-ons overshoot the 144 g target, so Jatin would only need about half of them. The cheapest ones:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;2 boiled eggs: ₹14, +13 g&lt;/li&gt;
&lt;li&gt;50 g soya chunks boiled in a hostel kettle: ₹10, +26 g&lt;/li&gt;
&lt;li&gt;Roasted chana (50 g): ₹15, +10 g&lt;/li&gt;
&lt;li&gt;Egg bhurji or omelette: ₹30, +14 g&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What Jatin Said
&lt;/h2&gt;

&lt;p&gt;I showed Jatin the app in our hostel room yesterday evening and ran our actual IIIT Prayagraj BH-2/3 menu through it right in front of him. When Tuesday's total showed just 64.7 g against his 144 g target, he stared at the screen for a moment and said:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Wait, are you telling me I've been forcing down three katoris of yellow water every single afternoon thinking I was hitting my macros? That is depressing, man. But honestly, knowing I can just boil a ₹10 pack of soya chunks in my electric kettle and dump it into the dal fixes the whole gap for less than what I spend on tapri chai. I'm keeping a packet in my room from tomorrow."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;More regional dishes in the open table (especially regional South Indian and North-Eastern hostel staples)&lt;/li&gt;
&lt;li&gt;Editable portion sizes per hostel contractor&lt;/li&gt;
&lt;li&gt;Step-by-step local setup with Ollama and Docker Compose in the README&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>hf26challenge</category>
    </item>
  </channel>
</rss>
