Carbon Database
Carbon Database has a goal to create a public database with carbon emissions of cars to educate people about carbon emissions, and make them pay more attention when they consider buying a vehicle.
Inspiration
We aimed to empower individuals to contribute to a public database filled with carbon emission data of vehicles. Finding car emission data for each car is highly time-consuming. We thought people who consider their car purchases on carbon emission may have a hard time when there's not a source that shows each vehicle's carbon emission. So we decided to use the power of individuals and let users contribute a pool of carbon emission data for cars.
What it does
The Carbon Database has a single goal: letting people learn about the carbon emissions of cars. To do that, we utilize from knowledge of other people.
Users connect their Metamask wallet on the Hedera network and gain access to fill out a carbon emission form to add an entry to the public database.
People who want only to grab information and don't want to contribute don't have to log in.
How we built it
Carbon Database has a simple tech stack. We use Next.js for development. MongoDB for the database, and Hedera Guardian for policies.
The first thing built was the policy. A unique schema was created from Managed Guardian Service according to the data schema that was going to be used later in the project. Then a correct form of Mongo schema is coded that has the same data fields as the policy. The last part was coding the front-end and connecting it to our back-end service which communicates with the Mongo database.
How to run Carbon Database
First, clone the Github repository. Then rename the .env.template file to .env.local and fill the necessary fields.
.env file contains 2 necessary fields: URL and Mongo URI. URL is localhost:3000 as default. For Mongo URI, developers can use Mongo Atlas or local Mongo, it depends on their choice.
Then you can install dependencies via npm: npm install
Lastly, start the application via the command npm run dev.
Challenges we ran into
- Managing Metamask API in Next.js.
- Caching problems on MongoDB in the production version.
Accomplishments that we're proud of
- Successfully storing carbon emission data of users.
- Being able to show carbon emission data to whoever visits the website.
What we learned
Carbon Database made me learn a lot about carbon credits which I've never heard before. It was the first time I dived into the Hedera environment. It was the first project I've done for environmental rather than financial purposes.
What's next for Carbon Database
The future of the Carbon Database is so bright. There are a couple of updates I want to develop in the future:
- A reporting system for wrong information.
- A reward mechanism to reward those who contribute actively.
- A free public API for developers to access carbon emission data
Built With
- javascript
- mongodb
- next
- vercel
Log in or sign up for Devpost to join the conversation.