Skip to content

MetalKnightCat/Global-CO2-Emissions-Dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌍 Global CO2 Emissions Dashboard

This project aims to help explore carbon dioxide (CO2) emissions data from countries around the world. You can see how much CO2 each country produces, how it changes over time, and compare emissions between countries.


🚀 What You'll See

  1. CO2 Emissions Data:

    • Total CO2 emissions for a selected country and year.
    • CO2 emissions per person (per capita).
    • CO2 emissions relative to the country's economy (per GDP).
  2. Interactive Charts:

    • A line chart showing how CO2 emissions have changed over time for a selected country (from 2000 to the current year).
    • A world map showing CO2 emissions for all countries in a selected year.
  3. Dark Theme:

    • The app has a sleek, dark design with red accents for a modern look.

🛠️ How to Run the Project

You can run the project with just one click! Follow these steps:

1. Install Dependencies

Make sure you have Python installed. Then, open a terminal and run:

pip install -r requirements.txt

2. Run the Backend and Frontend

Use the button below to start both the backend and frontend servers:


run.sh

To make it easy to run the backend and frontend, create a run.sh script:

#!/bin/bash
# Start the backend
echo "🚀 Starting the backend..."
cd backend
uvicorn main:app --reload &
# Wait for the backend to start
sleep 5
# Start the frontend
echo "🚀 Starting the frontend..."
cd ../frontend
streamlit run app.py

This will:

  • Start the backend server (provides the data).
  • Start the frontend server (displays the dashboard).

3. 🖥️ Using the Dashboard

Select a Country: Use the dropdown menu in the sidebar to choose a country.

Select a Year: Use the slider to pick a year (from 2000 to the current year).

Explore the Data: The dashboard will show:

  • Key metrics (total CO2, CO2 per capita, CO2 per GDP).

  • A line chart of CO2 emissions over time.

  • A world map of CO2 emissions for the selected year.

3. 💻 How It Works

  • Backend: The backend fetches CO2 emissions data from a public dataset and serves it to the frontend.

  • Frontend: The frontend displays the data in an interactive dashboard using Streamlit and Plotly.

4. 📂 Project Structure

  • Backend: Handles data fetching and serves it via an API.

  • Frontend: Displays the data in a user-friendly dashboard.

5. Outro

  • Data Source: Our World in Data

  • Built with: Python, FastAPI, Streamlit, and Plotl

About

Global CO2 Emissions Dashboard

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages