<?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: Sukh Ramghria</title>
    <description>The latest articles on DEV Community by Sukh Ramghria (@sukh_ramghria_c0958a88327).</description>
    <link>https://dev.to/sukh_ramghria_c0958a88327</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%2F3885370%2F996dec97-4f61-4d34-9029-5ac98971697c.png</url>
      <title>DEV Community: Sukh Ramghria</title>
      <link>https://dev.to/sukh_ramghria_c0958a88327</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sukh_ramghria_c0958a88327"/>
    <language>en</language>
    <item>
      <title>EcoSync, a carbon footprint tracker</title>
      <dc:creator>Sukh Ramghria</dc:creator>
      <pubDate>Sun, 19 Apr 2026 05:56:19 +0000</pubDate>
      <link>https://dev.to/sukh_ramghria_c0958a88327/ecosyncm-a-carbon-footprint-tracker-4jlp</link>
      <guid>https://dev.to/sukh_ramghria_c0958a88327/ecosyncm-a-carbon-footprint-tracker-4jlp</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;I created &lt;strong&gt;EcoSync&lt;/strong&gt;, a carbon footprint tracker that uses &lt;strong&gt;Google Gemini AI&lt;/strong&gt; to analyze daily activities and provide personalized eco-tips.&lt;/p&gt;

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

&lt;p&gt;In this project, I combined the power of the &lt;strong&gt;MERN stack&lt;/strong&gt; with &lt;strong&gt;Google Gemini AI&lt;/strong&gt; to create a seamless experience. Here's how the core components work: &lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;AI Analysis with Gemini Pro&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I implemented a backend route in Node.js that communicates with the Gemini API. To ensure stability, I used a direct REST integration with the Google AI beta v1 endpoint.&lt;br&gt;
&lt;strong&gt;The Logic&lt;/strong&gt;&lt;br&gt;
The backend receives a raw string from the user (e.g., "I drove 5km today"), wraps it in a structured prompt, and asks Gemini to return a &lt;strong&gt;strict JSON response&lt;/strong&gt;. This allows the frontend to display the carbon value and eco-tips easily.&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.amazonaws.com%2Fuploads%2Farticles%2Ftxrun6riq3jxl8k5duzq.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.amazonaws.com%2Fuploads%2Farticles%2Ftxrun6riq3jxl8k5duzq.png" alt="AI integration " width="800" height="606"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;Secure Auth with Auth0&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To protect user data and provide a personalized dashboard, I integrated &lt;strong&gt;Auth0&lt;/strong&gt;. It handles the entire authentication lifecycle (Login, Logout, and Session Management), so I could focus on building the core features.&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.amazonaws.com%2Fuploads%2Farticles%2Frfefnunmuncd7rixokan.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.amazonaws.com%2Fuploads%2Farticles%2Frfefnunmuncd7rixokan.png" alt="Auth0 integration " width="541" height="858"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. &lt;strong&gt;Frontend with Ant Design&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;For the UI, I chose Ant Design. Its component-driven approach allowed me to build a professional-looking dashboard with real-time feedback and loading states during AI processing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project Links&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/its-meet0123/Ecosync" rel="noopener noreferrer"&gt;Ecosync&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Building EcoSync was about creating a bridge between complex environmental data and a simple user experience. Here is the step-by-step logic behind the development:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Development Environment "GitHub Codespaces"&lt;/strong&gt;
​To ensure a seamless and efficient development experience, I built EcoSync entirely using GitHub Codespaces. This cloud-hosted environment was a game-changer for this challenge for several reasons:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Zero-Config Setup:&lt;/strong&gt; I didn't have to spend time configuring local Node.js or React environments. With a pre-configured container, I could jump straight into coding the Gemini and Auth0 integrations.&lt;br&gt;
​&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Portability &amp;amp; Speed:&lt;/strong&gt; Since the environment is hosted in the cloud, I could test my backend API and frontend transitions instantly without draining my local machine's resources.&lt;br&gt;
​&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Consistency:&lt;/strong&gt; Using Codespaces ensured that my development environment perfectly matched the production-ready structure, making it easier to push clean code to my repository.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;​2. &lt;strong&gt;Architecting the "Brain" (Gemini AI Integration)&lt;/strong&gt;&lt;br&gt;
​The core challenge was converting vague user inputs (like "I used the AC for 4 hours") into structured data.&lt;/p&gt;

&lt;p&gt;​The Choice: I chose Google Gemini Pro because of its superior natural language understanding.&lt;br&gt;
​The Strategy: Instead of just asking for a summary, I engineered a specific "JSON-only" prompt. This ensures the AI acts as a data processor, returning estimated carbon values and actionable tips that my React frontend can immediately display without manual calculation.&lt;/p&gt;

&lt;p&gt;​3. &lt;strong&gt;Establishing a Secure Foundation (Auth0)&lt;/strong&gt;&lt;br&gt;
​Security and personalization were high priorities.&lt;/p&gt;

&lt;p&gt;​The Choice: I integrated Auth0 for the identity layer.&lt;br&gt;
​The Strategy: By using the Auth0 React SDK, I was able to wrap my entire application in a secure provider. This ensures that only authenticated users can access the analysis dashboard, protecting the API from bot abuse and setting the stage for future features like personalized history tracking.&lt;/p&gt;

&lt;p&gt;​4. &lt;strong&gt;Designing for Impact (React &amp;amp; Ant Design)&lt;/strong&gt;&lt;br&gt;
​Environmental apps need to feel intuitive and clean to encourage daily use.&lt;/p&gt;

&lt;p&gt;​The Choice: I used React (Vite) for its speed and Ant Design for the UI components.&lt;br&gt;
​The Strategy: Ant Design’s professional component library (like Cards, Inputs, and Spinners) allowed me to build a responsive, dashboard-style interface very quickly. I focused on a "Green &amp;amp; Clean" color palette to stay consistent with the Earth Day theme.&lt;/p&gt;

&lt;p&gt;​5. &lt;strong&gt;Solving Technical Hurdles&lt;/strong&gt;&lt;br&gt;
​The biggest technical hurdle was a versioning mismatch with the AI SDK.&lt;/p&gt;

&lt;p&gt;​The Solution: I pivoted from using the high-level library to a direct REST API implementation using Axios. By targeting the v1 stable endpoint of the Google Generative Language API, I achieved 100% stability and learned a lot about how AI endpoints handle headers and payloads.&lt;/p&gt;

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

&lt;p&gt;The entire project was developed in the cloud using GitHub Codespaces, making it a truly modern, cloud-native submission.&lt;br&gt;
​I am submitting my project for the following categories:&lt;br&gt;
​&lt;strong&gt;1. Best Use of Auth0 for Agents&lt;/strong&gt;&lt;br&gt;
​EcoSync is more than just a landing page; it's a secure platform. I integrated Auth0 to provide a robust authentication layer. By securing the AI analysis dashboard, I ensured that every interaction is tied to a verified user, preventing API abuse and creating a foundation for personalized carbon-tracking history. My implementation demonstrates how Auth0 can be the security backbone for AI-driven applications.&lt;br&gt;
​&lt;strong&gt;2. Best Use of Gemini&lt;/strong&gt;&lt;br&gt;
​I utilized Google Gemini Pro to solve a real-world problem: making environmental data accessible. Instead of complex forms, users can talk to EcoSync in natural language. I implemented a direct REST API integration and sophisticated prompt engineering to ensure the AI returns structured JSON, making the app both smart and reliable.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>gemini</category>
      <category>auth0challenge</category>
    </item>
  </channel>
</rss>
