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