Flight Carbon Offset Tracker is an open-source application that securely reads your Gmail or G Suite account to extract flight confirmation emails, compile a list of your flights, calculate the total carbon emissions from those flights, and provide options to offset the carbon footprint. This project is currently a work in progress and aims to integrate with the Ethereum Attestation Service (EAS) to create blockchain attestations of your carbon footprint and the corresponding offsets.
- OAuth-based Gmail or G Suite access.
- Reads flight confirmation emails from your inbox.
- Generates a list of all flights you've taken.
- Calculates the carbon footprint of your flights.
- Provides options to offset the calculated carbon emissions.
- Plans to integrate with Ethereum Attestation Service (EAS) to record flight and offset data.
The application requires high-level permission to read your emails. It only accesses flight confirmation emails and does not store or access any other email data. However, given the high-security nature of email access, we recommend using the application carefully and only after reviewing its source code.
- Node.js >= v14
- Google Cloud Platform (GCP) credentials for OAuth
-
Clone the repository:
git clone https://github.com/your-username/flight-carbon-offset-tracker.git cd flight-carbon-offset-tracker
-
Install dependencies:
npm install
-
Set up your Google OAuth credentials by following this guide.
- You'll need to enable Gmail API and set up OAuth credentials on the GCP console.
-
Create a
.env
file to store your credentials:GMAIL_CLIENT_ID=your-client-id GMAIL_CLIENT_SECRET=your-client-secret GMAIL_REDIRECT_URI=your-redirect-uri
-
Start the application:
npm start
Once the application is running, it will prompt you to authenticate with your Gmail or G Suite account via OAuth. After authentication, it will scan your emails for flight confirmation messages and display a list of all your flights along with the carbon footprint of each flight.
You will also be able to choose from various carbon offsetting options, which will be factored into the final calculations. Future updates will include generating attestations on the Ethereum blockchain using the Ethereum Attestation Service (EAS).
- Ethereum Attestation Service (EAS) Integration: Automatically create blockchain-based attestations of your flights and carbon offsets.
- Flight Offset Marketplace: Integration with third-party services to provide multiple carbon offsetting options.
- Improved Email Parsing: Enhanced algorithms to detect a wider range of flight confirmation formats.
Contributions are welcome! Feel free to submit pull requests or open issues to help improve the project.
- Fork the repo.
- Create a new branch:
git checkout -b feature-branch
- Make your changes and commit:
git commit -m "Add some feature"
- Push to the branch:
git push origin feature-branch
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
This is a Next.js project bootstrapped with create-next-app
.
You will need to register with the relevant google apis also, but this is the NextJs part:
First, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying pages/index.tsx
. The page auto-updates as you edit the file.
API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.ts
.
The pages/api
directory is mapped to /api/*
. Files in this directory are treated as API routes instead of React pages.
This project uses next/font
to automatically optimize and load Inter, a custom Google Font.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.