Carbon Footprint Tracker is a React-based web application that helps individuals monitor and reduce their environmental impact. Users can log daily activities related to transportation, energy usage, and lifestyle choices, then visualize their carbon emissions over time through interactive dashboards.
-
📊 Interactive Dashboards Visualize emission trends using Bar, Line, and Pie charts powered by Recharts.
-
📝 Activity Logging Simple and intuitive forms to log daily activities such as driving, electricity consumption, and waste generation.
-
🔐 Authentication Secure user sign-up and login using Firebase Authentication.
-
☁️ Real-time Data Storage User activity data is stored and retrieved securely using Firebase Firestore.
-
⚡ Fast & Responsive Built with Vite for blazing-fast development and optimized production builds.
- Frontend: React.js (Vite)
- Backend / Database: Firebase (Authentication & Firestore)
- Charts & Visualization: Recharts
- Routing: React Router DOM
- Styling: CSS3 (Custom Modules)
- Node.js (v16+ recommended)
- A Firebase project (Authentication & Firestore enabled)
git clone https://github.com/yourusername/carbon_footprint_tracker.git
cd carbon_footprint_trackernpm installCreate a firebase.js file inside the src/ directory and add your Firebase credentials:
// src/firebase.js
import { initializeApp } from "firebase/app";
import { getAuth } from "firebase/auth";
const firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_PROJECT_ID.firebaseapp.com",
projectId: "YOUR_PROJECT_ID",
storageBucket: "YOUR_PROJECT_ID.appspot.com",
messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
appId: "YOUR_APP_ID"
};
const app = initializeApp(firebaseConfig);
export const auth = getAuth(app);
export default app;
⚠️ Tip: Never commit your Firebase keys to a public repository. Use environment variables (.env) for production.
npm run devOpen http://localhost:5173 in your browser to view the app.
src/
│── pages/
│ ├── EmissionTrends.jsx # Dashboard with visual analytics
│ ├── LogActivity.jsx # Activity logging form
│
│── context/ or hooks/
│ └── useAuth.js # Authentication & user session logic
│
│── firebase.js # Firebase configuration
Contributions are welcome! If you have ideas such as:
- 🌱 Gamification (badges, streaks)
- 🏆 Carbon reduction goals
- 👥 Social sharing & comparisons
Feel free to fork the repository, create a feature branch, and submit a pull request.
This project is open-source and available under the MIT License.