Inspiration
Knowing your carbon footprint is critical to understanding your impact on the planet and yet there still seems to be some confusion over what it means. A carbon footprint is a certain amount of gaseous emissions that are relevant to climate change and associated with human production or consumption activities. It is an environmental indicator of the volume of greenhouse gases — those gases in our atmosphere that trap and release heat and contribute to climate change. Offsetting the carbon emissions from your lifestyle is a critical step toward fighting climate change.
Humanity’s global carbon footprint is the headline index for climate change. The carbon footprint has been on a soaring trend in the 21st century, with the exception of a brief drop in 2020 because of the COVID-19 lockdown. So, how do we reduce our impact on the Earth?
Individual action on climate change begins from their choices in many areas, such as diet, travel, household energy use, consumption of goods and services, and family size. High-consumption lifestyles have a greater environmental impact, with the richest 10% of people emitting about half the total lifestyle emissions. People who wish to reduce their carbon footprint can take high-impact actions, such as avoiding frequent flying and petrol-fuelled cars, eating a plant-based diet, and avoiding meat and dairy foods. They can engage in local and political advocacy around issues of climate change.
This project is an endeavor to support the cause by providing an approximate of the carbon footprints you generate in your day-to-day activities. It tries to explain the bleak consequence and suggests ways to transform it into a productive influence. This is an elementary version of a product that may take future turns with more details and scientific research along with a user-preferred interface.
"We're running the most dangerous experiment in history right now, which is to see how much carbon dioxide the atmosphere can handle before there is an environmental catastrophe."
What it does
GHG emissions are most likely made up of the energy used for electricity and travel, in addition to the energy required to produce food and all the other stuff you buy. These are called direct emissions however, the true carbon footprint of something would take into account all of the indirect emissions of a product, such as the extraction and processing of oil used in manufacture and transport.
Though the entire lifetime’s value of emissions should be taken into account, this project report deals on a very small scale and provides a rough estimate of their carbon footprints to an ordinary user. If it is meant to be considered for any scientific research, modifications may be included in future developments.
The data used here is obtained from Our World In Data.
The activities which are examined in the report are:
- Electricity Consumption
- Food Consumption
- Activities on Internet
- Travel and Commute
How we built it
Working Rule:
Register and Login: Takes user data from the frontend and sends request to the backend. If new user, serializer verifies if their is a user with the same username and if not, it sends the data to the model for storing in the user table. If existing user, serializer checks the data with the database and sends a JWT token for authorization (after authorization). Till the time the token is valid, the user can view certain pages and add their data for the purpose. If the user is not authorized, it sends back again to the login page.
Calculation of Footprints:
- Takes necessary data from the user using a Flutter frontend.
- Performs calculations as specified in the Python code and the JSON data file to find the weight of carbon footprints (in grams) and number of trees.
- Stores the data in an SQL Database.
- Serializes the data from Django REST Framework to the frontend.
- Displays the carbon footprints and number of trees.
The communication is majorly through status codes.
We began with deciding the app functionalities and features. We further designed a relationship model for the database (MySQL) that uses two tables, one for user data and other for footprint data with user_id having a one-to-many relationship from user table to footprint table. Next, we described a Custom User Model for our database from the scratch. Further, we went on to developing the application programming interface (API) endpoints for requests and responses using Django, beginning from the serializers to the view. We tried and tested all of these requesting from Postman.
Later, we designed a basic framework for the app's user interface using Figma. Following the design, we moved on to coding for the frontend using Flutter. We first simply had a base and then we connected it to our backend by changing the settings in Django project and adding API URLs and models to the the flutter project. Then, we had multiple hot reloads and tweaking the codes a bit to improvise the nuances.
Challenges we ran into
First week of the project was spent terribly with the authorization part in Django which allowed us to learn more about the authorization process in the platform. Ultimately, we landed up creating a custom user manager and model for the project.
We had troubles defining the parameters and their format to store in the footprint table for better optimization. We have activity, type of activity, and a float parameter associated with it, along with the time of entry. And, for storage and accessibility concerns, we have indexed the activities and their types with an integer each. Serializers also had tough time building up for this.
Frontend made us understand the dictionary structure and some typical form elements like dropdown and slider. The main part was sending and receiving the data to and from the backend respectively, which provided us with the opportunity to learn about secure storage for tokens and the concept of caching.
Accomplishments that we're proud of
We are proud about the fact that this project turned out to be a reality. The inspiration from the environment behind this project is paralleled with our to drive to learn and implement in a time span we had been allotted. Django and Flutter both were new to us and having to experience the first on-hands app development project renders us a confidence that fuels our motivation to continue on this development journey.
What we learned
The entire project was a learning process. We learned more in depth about our project idea, i.e. carbon footprint. We learned that it is not only the the industries and vehicles that generate carbon offsets but also, our daily activities impact our footprint. And, every footprint matters for sustainability. The entire framework, Django and Flutter was new to us and we had a great time learning the nuances of both with respect to not only these platform but the development journey as whole (concepts like, database structure, relationship model, http, server, requests, api, serializers, cache, authorization, etc.). We learned how the server communicates with the client and how efficient should it be to handle multiple requests. We came across other applications as well like Postman for testing the API and Figma for designing our UI.
What's next for Carbon Footprint Calculator
- Add more activities such as generating waste and also, activities such as walking and planting trees with negative carbon offset.
- Add a normalization term in the carbon footprint calculation for the factors like energy per capita with respect to the location of the user.
- Include data for different plants and trees to generate accurate results for number of trees to be planted for a particular activity.
- Introduce feature of blogs for environment conservation.
- Incorporate an AI model that understands an activity and gives an automated response after every insertion of activity for the user to understand the impact of the activity and how the user can improve.
- Allow sharing the progress among users.
- Add email or mobile authentication.
"There is no footprint so small that it can not leave an impact on the planet."
Log in or sign up for Devpost to join the conversation.