A comprehensive web application that helps users track and reduce their digital carbon footprint through daily activity monitoring, personalized recommendations, and gamification.
The Carbon Footprint Tracker estimates COโ emissions from digital activities like emails, video streaming, coding, video calls, cloud usage, gaming, and social media. Users can log activities, visualize their impact, receive actionable tips, set reduction goals, and earn badges for sustainable behavior.
- Manual Entry: Log daily digital activities with intuitive sliders and inputs
- API Integrations: Automatic tracking via Gmail and GitHub APIs
- Quick Entry: Fast logging for common activities
- Real-time Calculations: Instant COโ footprint calculations
- Interactive Dashboard: Charts showing daily, weekly, and monthly trends
- Activity Breakdown: Pie charts displaying emissions by category
- Progress Tracking: Visual progress indicators and comparisons
- Real-world Equivalents: Contextualize emissions (e.g., "like driving X km")
- Personalized Recommendations: Tips based on your highest impact activities
- Categorized Advice: Organized by activity type (emails, streaming, etc.)
- Impact Calculations: Potential savings for each tip
- Interactive Application: Track which tips you've applied
- Weekly Goals: Set percentage reduction targets
- Progress Tracking: Visual goal progress with motivational messaging
- Achievement Badges: Earn badges for consistent tracking and reductions
- Point System: Accumulate points for various achievements
- Difficulty Levels: Easy, medium, and hard goals to choose from
- Google Login: Secure authentication with Google OAuth
- GitHub Integration: Connect GitHub for automatic coding activity tracking
- User Profiles: Personalized experience with preferences
- Data Security: Secure storage with Firebase
- Next.js 15 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Chart.js - Interactive data visualizations
- React Charts 2 - Chart components for React
- Firebase - Authentication and Firestore database
- Next.js API Routes - Server-side functionality
- Cloud Functions - Serverless computing (if needed)
- Gmail API - Email activity tracking
- GitHub API - Coding activity monitoring
- Google OAuth - Secure authentication
- ESLint - Code linting
- Prettier - Code formatting
- TypeScript - Static type checking
src/
โโโ app/ # Next.js App Router
โ โโโ layout.tsx # Root layout
โ โโโ page.tsx # Main page
โ โโโ globals.css # Global styles
โโโ components/
โ โโโ auth/ # Authentication components
โ โโโ charts/ # Data visualization
โ โโโ dashboard/ # Dashboard components
โ โโโ forms/ # Activity input forms
โ โโโ gamification/ # Badges and goals
โ โโโ layout/ # Navigation and layout
โ โโโ tips/ # Recommendation system
โโโ hooks/ # Custom React hooks
โโโ lib/
โ โโโ api/ # External API integrations
โ โโโ calculations/ # Carbon footprint logic
โ โโโ firebase/ # Firebase configuration
โ โโโ gamification/ # Badge evaluation system
โโโ types/ # TypeScript type definitions
โโโ constants/ # App constants and data
- Node.js 18+ and npm
- Firebase project
- Google Cloud Console project (for APIs)
-
Clone the repository
git clone <repository-url> cd cabon-tracker
-
Install dependencies
npm install
-
Set up environment variables
cp .env.local.example .env.local
Fill in your Firebase and API credentials:
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_domain NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_bucket NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id -
Configure Firebase
- Create a Firebase project
- Enable Authentication with Google provider
- Set up Firestore database
- Configure security rules
-
Set up Google APIs
- Enable Gmail API in Google Cloud Console
- Configure OAuth consent screen
- Add authorized domains
-
Run the development server
npm run dev
Open http://localhost:3000 to view the application.
- Create collections in Firestore:
users- User profiles and preferencesactivities- Individual activity logscarbon_footprints- Daily footprint calculationsweekly_goals- User reduction goalsuser_badges- Earned achievements
- Gmail API:
gmail.readonlyscope for email counting - GitHub API:
read:userandreposcopes for activity tracking
The app uses research-based COโ emission factors:
| Activity | Emission Factor |
|---|---|
| 4g COโ per email | |
| Video Streaming | 36g COโ per hour |
| Coding/Development | 15g COโ per hour |
| Video Calls | 150g COโ per hour |
| Cloud Storage | 0.5g COโ per GB/day |
| Gaming | 60g COโ per hour |
| Social Media | 12g COโ per hour |
- Environmental: Reduction achievements
- Consistency: Daily tracking streaks
- Social: Tip application and sharing
- Milestones: Time-based achievements
- Set weekly reduction targets (10-90%)
- Track progress with visual indicators
- Motivational messaging based on progress
- Achievement rewards for meeting goals
- Green color palette representing nature and sustainability
- Earth tones and natural gradients
- Floating leaf animations for visual interest
- Clean, minimal design reducing cognitive load
- Mobile-first responsive design
- Intuitive navigation with clear icons
- Progressive disclosure of complex features
- Immediate feedback for user actions
npm run build
# Deploy to VercelThe app can be deployed to any platform supporting Next.js:
- Netlify
- AWS Amplify
- Google Cloud Run
- Traditional hosting with Node.js
- Social Features: Share achievements, compete with friends
- Advanced Analytics: Detailed emission breakdowns and trends
- Offset Marketplace: Purchase carbon offsets directly
- IoT Integration: Smart home device monitoring
- Corporate Dashboard: Team and organization tracking
- Mobile App: Native iOS and Android applications
- Spotify API for music streaming tracking
- Slack API for workplace communication
- Cloud provider APIs (AWS, Azure, GCP) for detailed usage
- Transportation APIs for commute tracking
๐ฑ Join Hacktoberfest 2025 and help make digital sustainability accessible!
This project welcomes contributions during Hacktoberfest! We have issues suitable for all skill levels:
- Add new activity types (music streaming, online shopping)
- Create new eco-friendly tips and badges
- Improve UI/UX with dark mode and accessibility
- Add data export and visualization features
- Build PDF report generation
- Implement social features and sharing
- Create mobile responsiveness improvements
- Add API integrations
- Real-time collaboration features
- AI-powered recommendations
- Mobile app development
- Advanced analytics and ML
๐ See HACKTOBERFEST_ISSUES.md for detailed issue ideas!
We welcome contributions from developers of all skill levels! Here's how to get started:
# 1. Fork this repository
# 2. Clone your fork
git clone https://github.com/YOUR_USERNAME/carbon-footprint-tracker.git
# 3. Install dependencies
npm install
# 4. Start development server
npm run dev
# 5. Open http://localhost:3000 and start coding!- Check Issues for tasks to work on
- Comment on an issue to get assigned
- Fork the repository and create a feature branch
- Make your changes following our Contributing Guidelines
- Test thoroughly and ensure code quality
- Submit a Pull Request with a clear description
- Respond to feedback and iterate as needed
- ๐ข
good first issue- Perfect for newcomers - ๐ก
enhancement- New features and improvements - ๐ด
bug- Something isn't working - ๐ฃ
design- UI/UX improvements - โช
hacktoberfest- Hacktoberfest eligible
๐ Read our full Contributing Guide for detailed guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
- COโ emission factors based on research from various environmental organizations
- Icons and emojis used throughout the application
- Open source libraries and frameworks that made this project possible
- Environmental awareness campaigns that inspired this project
For support, feedback, or questions:
- Create an issue in the GitHub repository
- Contact the development team
- Check the documentation and FAQ
Made with ๐ for a sustainable digital future