A modern, responsive web application that helps organizations track and calculate their carbon dioxide (CO₂) emissions. Built with Preact, TypeScript, and Tailwind CSS.
Carbon Calculator is an open-source Progressive Web App (PWA) designed to make carbon footprint tracking accessible and intuitive. Organizations can:
- Track multiple organizations with different countries and emission factors
- Add modular consumption data for various categories (food, energy, transport, equipment, etc.)
- Calculate CO₂ emissions based on country-specific emission factors
- Compare emissions between organizations with visual charts and analytics
- Export and import data for backup and sharing
- Work offline thanks to PWA technology
- Use multiple languages (English, German, Italian, Spanish, Swedish)
- Node.js 20.0 or higher
- npm or yarn
- Clone the repository:
git clone https://github.com/yourusername/carbon-calculator.git
cd carbon-calculator- Install dependencies:
npm installStart the development server:
npm run devThe app will open at http://localhost:5173/
npm run buildThis creates an optimized production build in the dist/ directory.
npm run previewcarbon-calculator/
├── src/
│ ├── components/ # Reusable UI components
│ ├── pages/ # Page views (Dashboard, Settings, etc.)
│ ├── data/
│ │ ├── factors/ # Country-specific emission factors (JSON)
│ │ ├── moduleCatalog.ts # Module definitions
│ │ └── factors.ts # Factor loading
│ ├── locales/ # Translation files (i18n)
│ ├── app.tsx # Root component
│ ├── store.ts # State management (Preact Signals)
│ ├── types.ts # TypeScript type definitions
│ └── main.tsx # Entry point
├── public/ # Static assets
├── package.json
├── vite.config.ts
└── tsconfig.json
- Framework: Preact - Fast 3kB React alternative
- State Management: @preact/signals - Fine-grained reactivity
- Styling: Tailwind CSS - Utility-first CSS
- Build Tool: Vite - Lightning fast build tool
- PWA: vite-plugin-pwa - PWA support
- Charts: Recharts - React charting library
- Language: TypeScript - Type-safe JavaScript
- 🇦🇹 Austria
- 🇮🇹 Italy
- 🇪🇸 Spain
- 🇸🇪 Sweden
- 🇬🇧 English
- 🇩🇪 Deutsch
- 🇮🇹 Italiano
- 🇪🇸 Español
- 🇸🇪 Svenska
The app can be installed on any device as a Progressive Web App:
- Installable on desktop, iOS, and Android
- Offline Support - Works without internet connection
- App-like Experience - Full-screen, native feel
- Fast Performance - Pre-cached assets, instant load times
Emission factors are customizable per country and stored in JSON format. Currently supported:
- Pizza/Food consumption
- Coffee and beverages
- Paper usage
- Technology (computers, laptops, servers, printers)
- Mobility/Transportation
- Electricity by source
- Water usage
- Heating
- And more...
This project was developed as part of the Erasmus+ program. We welcome contributions!
For issues, questions, or suggestions, please open an issue on GitHub.