Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

🌿 Carbon Footprint Tracker

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.


🚀 Features

  • 📊 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.


🛠️ Tech Stack

  • Frontend: React.js (Vite)
  • Backend / Database: Firebase (Authentication & Firestore)
  • Charts & Visualization: Recharts
  • Routing: React Router DOM
  • Styling: CSS3 (Custom Modules)

⚙️ Installation & Setup

Prerequisites

  • Node.js (v16+ recommended)
  • A Firebase project (Authentication & Firestore enabled)

1️⃣ Clone the Repository

git clone https://github.com/yourusername/carbon_footprint_tracker.git
cd carbon_footprint_tracker

2️⃣ Install Dependencies

npm install

3️⃣ Configure Firebase

Create 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.


4️⃣ Run the Application

npm run dev

Open http://localhost:5173 in your browser to view the app.


📂 Project Structure

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

🤝 Contributing

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.


📄 License

This project is open-source and available under the MIT License.

🌿 Carbon Footprint Tracker

React Vite Firebase Recharts License Status

About

A personal sustainability tracker built with React and Firebase. Calculates daily carbon emissions and visualizes trends using interactive charts to help users reduce their environmental impact.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages