Skip to content

Flaburgan/disco2very

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

281 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

disCO2very

A free software game designed to explore the orders of magnitude of CO2 footprints in our daily lives and raise awareness about climate change.

This application is based on the work of Thomas James Watson (thank you! ❤️) for wikitrivia. Original source code available on github.

About

This project uses open data provided by ADEME (Agence de l'Environnement et de la Maîtrise de l'Énergie, the French state agency working on climate change). The raw data is available on the ADEME website, either through a user-friendly website, or via an API. To enable offline gameplay and reduce redundant API calls (since the data doesn't change frequently), the information is stored within the app and manually updated regularly. The last update was performed on 2025-09-30.

⚠️ Note: Since the data is provided by ADEME, the CO2 values are based on France's characteristics. A key difference compared to other countries is France’s low-carbon electricity sources. In contrast, countries relying on other electricity sources such as coal-fired power plants will have significantly higher CO2 footprints for electricity-related activities.

Contributions

Contributions to the project are very welcome! By contributing, you agree that your work will be licensed under the AGPL license (see the LICENSE file for details).

Technical informations

This project is using the Next.js framework, itself based on React. NodeJS 18.17.0 or higher is required to build and run the project.

Prerequisites

npm install
npm run i18n-compile

Development

npm run dev

Then visit http://localhost:3000/ to preview the website.

Translations

disCO2very uses Lingui to manage translations. If you add or modify any text in the app, you must run:

npm run i18n-extract

This will modify the english keys in locales/en/messages.po. Look for entries starting with #~: these are now outdated and should be removed. Then open the other languages files like locales/fr/messages.po and look for empty strings "" to add the missing translations.

Once done, run:

npm run i18n-compile

Static build

To build a static version of the website to the out folder, that you can then deploy anywhere (it's plain HTML + JS, no server needed) run:

npm run build

Update data

The data used is hardcoded in the code to allow to play offline. That's why it's important to regularly pull the latest data from the ImpactCO2 github repository.

  1. For the data, use the ADEME API documentation page to execute queries.
    • Start with the /thematiques route, click on Try it out and then compare the categories with data/ademe/0-categories.json and complete the file if needed
    • Then use the /thematiques/ecv/{id} route, execute it with the detail parameter set to 1 for each category number and each language, and copy paste the response to the corresponding file in data/ademe/{language}/{thegoodfile}.json
    • git diff your changes to check the ids used in footprintDetail, it has to have a matching ID in data/ademe/footprintDetailCategories.json. If you are missing it here, you have to investigate in the ImpactCO2 website to find what the new category is, as they are not providing them in the API
  2. For the icons,
    • Download all the SVG icons from the github repository public/icons folder and save them in public/images/ademe
    • Execute the ./clean-ademe-image.sh script, as not all the ADEME images are used in disCO2very, so no need to bundle them
  3. Finish by updating the date above in this file, to inform people of the last time the data has been updated

About

A game to discover CO2 footprint of our daily lives

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors

Languages

  • TypeScript 68.7%
  • SCSS 18.1%
  • PHP 12.1%
  • Other 1.1%