Inspiration
Climate change can feel like an abstract and overwhelming problem. It's hard to know where to start or if our small actions even make a difference. But our daily choices impact the planet. Every choice we make and every step we take has an effect. We created an application to prove that to you.
People track their steps, calories, and sleep to get a clear picture of their health and make targeted improvements. Let's do the same for our carbon footprint!
That's how Carbon Health was born. We created a tool that transforms the abstract concept of a "carbon footprint" into a tangible, personal, and manageable "health metric." Instead of just showing you data, it provides you a 'prescription' for improvement. This led us to our core idea: integrating a powerful AI like Google's Gemini to act as a personal sustainability doctor, analyzing a user's unique data to provide intelligent, tailored recommendations for a healthier carbon lifestyle.
What it does
Carbon Health is a web application that serves as the backend for a personal carbon footprint tracking application.
- ** Daily Logging:** Users can log their daily activities across three main categories:
- Transportation (car, bus, rail)
- Power Usage (devices like computers, TVs)
- Food (servings of different meat types)
- ** Emission Calculation & Tracking:** The application calculates the CO2 emissions for each activity and tracks your CO2 emission throughout the day.
- ** Data Summaries:** Users can retrieve their emission history for any given week or month, allowing them to see their progress and identify patterns over time.
- ** AI-Powered Recommendations:** This is the core feature where the user is provided tailored and relevant as well as actionable tips to help them reduce their largest sources of emissions.
How we built it
- Backend Framework: We used Python with FastAPI for its incredible performance, ease of use.
- Database: We chose Google Firestore as our NoSQL database for its flexible, scalable structure and easy integration with Python. We designed a data model centered around a
daily_emissioncollection with a composite key (username_date) to allow for efficient "upsert" operations. - Authentication: User security is handled with JWT (JSON Web Tokens) for securing the API endpoints. We implemented the standard OAuth2 password flow for token generation.
- AI Engine: The recommendation feature is powered by the *Google Gemini * model via its Python SDK. We created a dynamic prompt that provides the AI with the user's profile, their aggregated emission data, and a clear set of instructions to return a structured JSON response.
Challenges we ran into
Our major hurdle wasn't technical, but scientific. The concept of a "carbon footprint" is complex, and our biggest initial challenge was translating abstract daily actions into concrete numbers. We had to dive into environmental science research to understand the primary factors behind personal emissions and find a reliable way to quantify them. This led us to the concept of emission factors—standardized values (from sources like the EPA) that convert an activity, like driving a mile or consuming a serving of beef, into a specific amount of CO2. Deciding on a simplified, user-friendly model that was still scientifically grounded was a significant design challenge.
Accomplishments that we're proud of
In a short timeframe, we're incredibly proud of building a functional and feature-rich application from the ground up. Specifically, we're proud of:
- Building a Full-Featured, Secure API: We built a complete REST API using FastAPI with multiple endpoints for user management, data logging, and summaries.
- Implementing Robust Data Handling: We successfully designed a scalable NoSQL data model in Google Firestore.
- Integrating an Intelligent AI Agent: The core of our project is the AI recommendation engine. We're proud of successfully integrating the Google Gemini API and crafting a sophisticated, context-aware prompt that transforms the general-purpose AI into a specialized sustainability coach, providing genuinely personalized and useful advice based on user data.
- Delivering a Complete End-to-End Solution: Beyond just the code, we're proud of the complete solution we conceptualized and delivered. We started with scientific research into carbon emission factors and ended with a fully functional, well-designed API that is ready to power a real-world application. Tying all these complex components together into a cohesive product was our biggest achievement.
What we learned
This project was a fantastic learning experience. We learned the importance of designing NoSQL schemas around an application's specific query patterns. We gained hands-on experience implementing a secure, token-based authentication flow from scratch.
Most importantly, we witnessed the power of modern LLMs. We learned that the quality of an AI's output is directly proportional to the quality of the prompt. Crafting a detailed, context-aware prompt for Gemini transformed it from a general chatbot into a specialized and genuinely helpful recommendation engine.
What's next for Carbon Health
We're incredibly excited about the foundation we've built and have a clear vision for how to make Carbon Health an even more powerful tool for positive change.
Automatic Tracking
The biggest leap forward will be to eliminate manual logging. We plan to develop features that passively and automatically track a user's activities. This would include using a phone's GPS and activity recognition APIs to automatically detect and calculate emissions from car or bus trips, and integrating with utility or smart home APIs to pull in electricity usage data without any user input. This transforms the app from a manual diary into an intelligent, effortless background service.
Native Android App
To support automatic tracking and provide a richer user experience, developing a native Android app is a top priority. This would allow us to leverage phone sensors for tracking and engage users more effectively with features like push notifications for new AI-powered recommendations and weekly summary reports.
Predictive Forecasting
We want to empower users to be proactive, not just reactive. We plan to implement a data science model to forecast a user's total monthly carbon emissions based on their activity in the first few weeks. Using time-series models like ARIMA or XGBoost, the app could warn a user if they are trending higher than their goal, giving them the motivation and time to adjust their behavior before the month is over.

Log in or sign up for Devpost to join the conversation.