<?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: Nisha Singh</title>
    <description>The latest articles on DEV Community by Nisha Singh (@nisha_singh_9a4941c043e16).</description>
    <link>https://dev.to/nisha_singh_9a4941c043e16</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3886366%2Fbce96bd4-d187-4b3d-91a2-b93c0e14561b.png</url>
      <title>DEV Community: Nisha Singh</title>
      <link>https://dev.to/nisha_singh_9a4941c043e16</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nisha_singh_9a4941c043e16"/>
    <language>en</language>
    <item>
      <title>What If Every Purchase Showed Its Real Environmental Cost? I Built That.</title>
      <dc:creator>Nisha Singh</dc:creator>
      <pubDate>Mon, 20 Apr 2026 04:30:26 +0000</pubDate>
      <link>https://dev.to/nisha_singh_9a4941c043e16/what-if-every-purchase-showed-its-real-environmental-cost-i-built-that-33od</link>
      <guid>https://dev.to/nisha_singh_9a4941c043e16/what-if-every-purchase-showed-its-real-environmental-cost-i-built-that-33od</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/weekend-2026-04-16"&gt;Weekend Challenge: Earth Day Edition&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




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

&lt;p&gt;Most sustainability tools show you dashboards &lt;em&gt;after&lt;/em&gt; the damage is done.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GreenGate&lt;/strong&gt; sits at the source — the moment someone is about to approve a procurement order. You type a product and quantity. Before you click approve, it tells you exactly how many trees get felled, how many litres of water get consumed, and how much CO₂ gets emitted. Then it offers a greener alternative, authenticates an AI agent to draft the replacement Purchase Order, and logs the saved impact to an immutable vault.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Sustainability failures at institutions aren't usually malice. They're friction. Nobody calculated what 800 reams of virgin paper costs the planet because nobody had a tool at the moment of decision. GreenGate is that tool.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  The full agentic flow
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;What happens&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;You enter a product + quantity (or pick one of 7 presets)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Google Gemini&lt;/strong&gt; runs a Lifecycle Assessment — trees felled, water consumed, CO₂ emitted, sustainable alternative&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Backboard&lt;/strong&gt; checks the result against stored institutional sustainability limits — fires a warning if you're about to breach them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;An &lt;strong&gt;animated world scene&lt;/strong&gt; makes the numbers physical — lumberjack chopping, water tanks filling, chimneys smoking — all scaled to real data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;You click &lt;strong&gt;Approve Sustainable Alternative&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Auth0 for Agents&lt;/strong&gt; authenticates the AI via M2M to draft the replacement PO — no human credentials exposed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Snowflake&lt;/strong&gt; logs the full transaction: original request, alternative selected, trees saved, water saved, carbon avoided&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;No API keys required — everything ships with mock fallbacks and 7 pre-computed presets.&lt;/p&gt;




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

&lt;p&gt;&lt;a href="https://youtu.be/J4a7WFIh1yI" rel="noopener noreferrer"&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.amazonaws.com%2Fuploads%2Farticles%2Fki37gpxgs0am9sjpylbo.jpg" alt="GreenGate Demo" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;demo video link: &lt;a href="https://youtu.be/J4a7WFIh1yI" rel="noopener noreferrer"&gt;https://youtu.be/J4a7WFIh1yI&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Run it yourself in 30 seconds:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/Nishu3005/Dev-to-Weekend-challenge-Earthday-edition.git
&lt;span class="nb"&gt;cd &lt;/span&gt;Dev-to-Weekend-challenge-Earthday-edition
python start.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Opens at &lt;code&gt;http://localhost:5173&lt;/code&gt;. No &lt;code&gt;.env&lt;/code&gt; needed. To activate real Gemini LCA, paste your key in the &lt;strong&gt;API Keys &amp;amp; Credentials&lt;/strong&gt; panel and click &lt;strong&gt;Test connection&lt;/strong&gt; — you'll get a live green/red status instantly.&lt;/p&gt;


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


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Nishu3005" rel="noopener noreferrer"&gt;
        Nishu3005
      &lt;/a&gt; / &lt;a href="https://github.com/Nishu3005/Dev-to-Weekend-challenge-Earthday-edition" rel="noopener noreferrer"&gt;
        Dev-to-Weekend-challenge-Earthday-edition
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;GreenGate 🌿&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Autonomous Procurement Guardian&lt;/strong&gt; — Earth Day Weekend Challenge&lt;/p&gt;

&lt;p&gt;GreenGate intercepts institutional procurement requests, calculates the real hidden ecological cost using Gemini AI, checks against sustainability goals, and lets an AI agent securely draft a greener Purchase Order — all visualised in a live animated world scene.&lt;/p&gt;




&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Quick Start&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt; Python 3.8+ and Node.js 18+&lt;/p&gt;

&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;python start.py&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;That's it. The script installs all dependencies on first run, starts both servers, and opens the browser automatically.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Frontend → &lt;a href="http://localhost:5173" rel="nofollow noopener noreferrer"&gt;http://localhost:5173&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Backend  → &lt;a href="http://localhost:3001" rel="nofollow noopener noreferrer"&gt;http://localhost:3001&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Press &lt;strong&gt;Ctrl+C&lt;/strong&gt; to stop&lt;/li&gt;
&lt;/ul&gt;




&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;API Keys (all optional)&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;The app ships with mock fallbacks — runs fully without any keys. To activate real integrations, enter them in the &lt;strong&gt;API Keys &amp;amp; Credentials&lt;/strong&gt; panel in the UI. No &lt;code&gt;.env&lt;/code&gt; editing required.&lt;/p&gt;

&lt;p&gt;&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;br&gt;
&lt;thead&gt;
&lt;br&gt;
&lt;tr&gt;
&lt;br&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;br&gt;
&lt;th&gt;Effect&lt;/th&gt;
&lt;br&gt;
&lt;/tr&gt;
&lt;br&gt;
&lt;/thead&gt;
&lt;br&gt;
&lt;tbody&gt;
&lt;br&gt;
&lt;tr&gt;
&lt;br&gt;
&lt;td&gt;Gemini API Key&lt;/td&gt;
&lt;br&gt;
&lt;td&gt;Real LCA on any product you type&lt;/td&gt;
&lt;br&gt;
&lt;/tr&gt;
&lt;br&gt;
&lt;tr&gt;
&lt;br&gt;
&lt;td&gt;Backboard API Key + Project ID&lt;/td&gt;
&lt;br&gt;
&lt;td&gt;Live institutional goal checks&lt;/td&gt;
&lt;br&gt;
&lt;/tr&gt;
&lt;br&gt;
&lt;tr&gt;
&lt;br&gt;
&lt;td&gt;Auth0 Domain / Client / Secret&lt;/td&gt;
&lt;br&gt;
&lt;/tr&gt;
&lt;br&gt;
&lt;/tbody&gt;
&lt;br&gt;
&lt;/table&gt;&lt;/div&gt;…&lt;/p&gt;
&lt;/div&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Nishu3005/Dev-to-Weekend-challenge-Earthday-edition" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;github link: &lt;a href="https://github.com/Nishu3005/Dev-to-Weekend-challenge-Earthday-edition" rel="noopener noreferrer"&gt;https://github.com/Nishu3005/Dev-to-Weekend-challenge-Earthday-edition&lt;/a&gt;&lt;/p&gt;




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

&lt;h3&gt;
  
  
  Stack
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;🧠 AI Brain&lt;/td&gt;
&lt;td&gt;Google Gemini 2.5 Flash&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🧠 Memory&lt;/td&gt;
&lt;td&gt;Backboard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🔐 Execution&lt;/td&gt;
&lt;td&gt;Auth0 for Agents (M2M)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🗄️ Data Vault&lt;/td&gt;
&lt;td&gt;Snowflake&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🎨 Frontend&lt;/td&gt;
&lt;td&gt;React + Vite + Tailwind CSS + Framer Motion&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;⚙️ Backend&lt;/td&gt;
&lt;td&gt;Node.js + Express&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🤖 Dev&lt;/td&gt;
&lt;td&gt;GitHub Copilot&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  Backend: one pipeline, four sponsors chained
&lt;/h3&gt;

&lt;p&gt;The backend is two Express routes. &lt;code&gt;/analyze&lt;/code&gt; chains Gemini → Backboard. &lt;code&gt;/execute&lt;/code&gt; chains Auth0 → Snowflake. API keys come per-request from the UI body, falling back to &lt;code&gt;.env&lt;/code&gt; — the same code handles demo mode and live mode with zero config switches.&lt;/p&gt;

&lt;p&gt;Gemini gets a strict JSON prompt so there's no parsing ambiguity:&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="nx"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`
You are the GreenGate Lifecycle Assessment Engine.
Calculate the hidden ecological cost of procuring: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; x &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;productName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.
Return ONLY a valid JSON object strictly matching this schema:
{
  "deforestationCostTrees": number,
  "waterCostLiters": number,
  "carbonCostKg": number,
  "sustainableAlternative": string,
  "reasoning": string
}`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I also built a &lt;code&gt;/api/test-gemini&lt;/code&gt; smoke-test endpoint — the UI calls it when you click "Test connection" so you know your key is valid before any real LCA request fires.&lt;/p&gt;




&lt;h3&gt;
  
  
  Frontend: making numbers feel real
&lt;/h3&gt;

&lt;p&gt;The centrepiece is &lt;code&gt;CombinedWorldScene.jsx&lt;/code&gt; — a fully SVG-based animated world where every visual element is mathematically driven by LCA output. Three characters, three ecological costs:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🪓 The Axeman&lt;/strong&gt; — always chopping, tree count scaling to &lt;code&gt;deforestationCostTrees&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;💧 Water Operator&lt;/strong&gt; — 6 tanks filling from a river intake, scaled to &lt;code&gt;waterCostLiters&lt;/code&gt;. Uses SVG &lt;code&gt;clipPath&lt;/code&gt; with &lt;code&gt;clipPathUnits="userSpaceOnUse"&lt;/code&gt; for the fill animation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🏭 Factory Worker&lt;/strong&gt; — inside the factory building, smoke rings scaling to &lt;code&gt;carbonCostKg&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  One Framer Motion gotcha worth knowing
&lt;/h4&gt;

&lt;p&gt;Never mix an &lt;code&gt;initial&lt;/code&gt; prop with keyframe &lt;code&gt;animate&lt;/code&gt; arrays. It causes a visible flash on mount — Framer tries to interpolate from the &lt;code&gt;initial&lt;/code&gt; state to the first keyframe. Use pure keyframe arrays with &lt;code&gt;times&lt;/code&gt; only, no &lt;code&gt;initial&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  GitHub Copilot
&lt;/h3&gt;

&lt;p&gt;Copilot was my pair programmer throughout. It handled the repetitive-but-exact work that makes up most of a project like this: Express route boilerplate, Snowflake schema SQL, SVG path coordinates for the characters, and Tailwind class strings for the API keys panel. The SVG world scene especially — Copilot's ability to continue coordinate patterns from context saved hours.&lt;/p&gt;




&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;🥇 Best Use of Google Gemini&lt;/strong&gt; — Gemini 2.5 Flash is the LCA engine. Every ecological cost flows through a structured JSON prompt. The animated world is entirely Gemini's output made physical.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🥇 Best Use of Backboard&lt;/strong&gt; — Backboard stores the institution's quarterly sustainability goals and checks every LCA result against them at runtime. It's the app's institutional memory — the difference between a one-off analysis and a compliance system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🥇 Best Use of Auth0 for Agents&lt;/strong&gt; — The AI uses Auth0 M2M credentials to draft the Purchase Order autonomously. The human approves; the agent executes. No human credentials ever touch the vendor system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🥇 Best Use of Snowflake&lt;/strong&gt; — Every approved transaction is written to &lt;code&gt;procurement_logs&lt;/code&gt; with full impact data. Trees saved. Water saved. Carbon avoided. Agent auth ID. This is the ledger that makes sustainability auditable over time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🥇 Best Use of GitHub Copilot&lt;/strong&gt; — Used throughout as a development accelerator for boilerplate, schemas, SVG geometry, and Tailwind styling. Particularly valuable for the coordinate-heavy SVG animation work.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Happy Earth Day 🌍 — every purchase is a vote for the kind of planet we're building.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>snowflake</category>
      <category>backboard</category>
    </item>
  </channel>
</rss>
