Green Meter is a carbon calculator designed to estimate your carbon footprint for flights and vehicle travel. The calculator uses real-time carbon emissions data from the Carbon Interface API to provide users with accurate estimates of their carbon emissions.
To get started with Green Meter, you will need to set up your development environment and configure your environment variables.
Before you can set up Green Meter, you will need to have the following software installed on your machine:
- Node.js
- PostgreSQL
To install Green Meter, follow these steps:
- Create
.env
file (copy.env.example
) - Create postgres database (e.g. via https://www.elephantsql.com/)
- Sign up to https://clerk.com/ and add your api keys to env file
- Sign up to https://docs.carboninterface.com/ and add api key
- Run
npm i
- Run
npm prisma db push
- Run
npm run dev
- Next.js
- TypeScript
- Prisma
- NextAuth
- trpc
This project uses the t3stack. You can read the documentation here https://create.t3.gg/en/introduction
We also recommend to learn about trpc (https://trpc.io/docs/) and tansack query (used by trpc under the hood) (https://tanstack.com/query/latest/docs/react/overview)
npx prisma studio (starts the data browser) https://www.prisma.io/docs/concepts/components/prisma-studio
Sometimes the linter breaks and you get errors that shouldn't be there. When experiencing this you need to restart the es-lint server
or typescript server
in VS code:
CMD
+ p
, then enter > restart
![image](https://private-user-images.githubusercontent.com/98182227/238125528-2aedb802-29a2-4702-b634-312e366f5ec8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUzMDM0MzgsIm5iZiI6MTcyNTMwMzEzOCwicGF0aCI6Ii85ODE4MjIyNy8yMzgxMjU1MjgtMmFlZGI4MDItMjlhMi00NzAyLWI2MzQtMzEyZTM2NmY1ZWM4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTAyVDE4NTIxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkzZTljN2YzYmQwNmM1NmJiNGJhNzE5OTMyYzI3NWEyNzcyOTc2NzI0YWU1ZGRhYTkxNzNhNzFlMjRhYzQ5ZTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Noayxnssi3aT212xSpvOjC8qJeCMXpUALQC7e5jZlUY)
Contributions to the project are welcome! To contribute:
- Fork the repository to your own account.
- Create a new branch for your feature or bug fix.
- Make changes to your forked repository.
- Submit a pull request to the main repository with a description of your changes.
This project is licensed under the MIT License.