AI-powered Carbon Footprint Calculator built with Next.js, Gemini AI, Recharts, and jsPDF.
EcoTrack AI helps users understand and reduce their environmental impact by calculating carbon emissions from:
- β‘ Electricity Consumption
- π Transportation Usage
βοΈ Air Travel
The application provides personalized sustainability insights using Google Gemini AI, visual emission breakdowns, carbon scoring, sustainability goal tracking, and downloadable PDF reports.
Built for the Hack2Skill Virtual PromptWars Challenge.
Vercel Deployment: https://ecotrack-ai-green.vercel.app
https://github.com/Jan1827/ecotrack-ai
Calculate estimated carbon emissions based on:
- Electricity Units Consumed
- Vehicle Kilometers Travelled
- Number of Flights Taken
Powered by Google Gemini AI.
Generates personalized recommendations to:
- Reduce emissions
- Improve sustainability habits
- Encourage eco-friendly practices
Users are categorized into:
| Score | Category |
|---|---|
| < 200 kg COβ | Green Hero π’ |
| 200β399 kg COβ | Eco Explorer π‘ |
| β₯ 400 kg COβ | Carbon Heavy π΄ |
Tracks progress toward maintaining emissions below the sustainability target.
Interactive Pie Chart displaying:
- Electricity Emissions
- Transportation Emissions
- Flight Emissions
Generate and download a sustainability report containing:
- Total Carbon Footprint
- Carbon Score
- Sustainability Summary
- Next.js 16
- React 19
- TypeScript
- Tailwind CSS
- Google Gemini API
- Recharts
- jsPDF
- Jest
- React Testing Library
- Vercel
User Input β Carbon Emission Calculation β Emission Breakdown β Carbon Score Analysis β Goal Tracking β Gemini AI Insights β PDF Report Generation
- Environment Variables for API Keys
- Input Validation
- Protection Against Negative Inputs
- Realistic Value Constraints
- Server-side AI Requests
- Semantic Headings
- Accessible Form Labels
- ARIA Labels for Interactive Elements
- Improved Component Structure
- Better Screen Reader Support
The project includes unit tests using Jest and React Testing Library.
β CarbonScore
β GoalTracker
β CarbonChart
β StatsCards
β AIInsights
β DownloadReport
β Carbon Calculation Utility
- 14+ Passing Tests
- 6 Test Suites Passing
npm testgit clone https://github.com/Jan1827/ecotrack-ai.gitcd ecotrack-ainpm installCreate:
.env.localAdd:
GEMINI_API_KEY=YOUR_API_KEYnpm run devOpen:
http://localhost:3000
npm run build- User Authentication
- Historical Carbon Tracking
- Weekly Sustainability Reports
- Carbon Offset Recommendations
- Community Leaderboards
- Personalized Sustainability Challenges
Hack2Skill Virtual PromptWars
AI-Powered Sustainability Assistant
To help users understand, visualize, and reduce their carbon footprint using AI-driven insights and sustainability analytics.
Janhavi Ojha
LinkedIn: https://www.linkedin.com/in/janhavi-ojha-9baa53417/
GitHub: https://github.com/Jan1827
Track. Analyze. Improve. Sustain.