This is the official source code for klimatkollen.se.
Klimatkollen is an open source and citizen-driven climate data platform aimed at visualising local climate data in Sweden.
The problem: Sweden’s 290 cities and municipalities are not slashing carbon emissions fast enough to be in line with the Paris Agreement. Climate data that can help us is often locked behind paywalls, or sits in complex government databases. If we can’t clearly see how much CO2 is being emitted, from which sources and how quickly we need to decarbonise – we can’t create a public opinion strong enough to change the course of our future. This needs to change.
That’s why we’re building a data-driven movement of climate-savvy developers to help us find and visualise climate data for the public. Climb aboard!
Join our Discord and set our climate data free!
If you're starting from scratch, and working with GitHub, NodeJS and so on is new to you, read doc/getting-started.md.
We use next.js and Typescript and it's pretty straightforward to get started. After cloning the repo run:
npm ci
npm run dev
This opens up a webserver on http://localhost:3000. Just edit the code and see the live refresh.
The project can also be run with docker compose
with --watch
(v2.22.0+) for live refresh:
docker compose up --build --watch
In very general terms, Klimatkollen presents:
The toplevel directory contains a lot of files and folders. You can just ignore most of them. Take note of:
README.md
- this document.data
: Our data processing pipeline, written in Python. This can more or less be used/edited independently of the rest of the repository. See data/README.md
.
data/facts
: Copies of source datasets.doc
: Documentation and guides, they might answer many questions.
doc/getting-started.md
: Detailed setup instructions for the web project.doc/contributing.md
: Good to know before making your first contribution.pages
and components
: Source code for almost everything visible on the website's pages.public
: Files that will be served directly on the website.
public/locales
: Language files defining translations of the website.How does everything fit together, code-wise?
data/facts
.data
to produce data/output/climate-data.json
from those datasets.data/output/climate-data.json
is always checked into version control.data/output/climate-data.json
.next.js
is used to compile actual HTML pages at runtime.next.js
caches each page for serving, to serve it faster for each new visitor.The idea behind Klimatkollen is to give citizens access to the climate data we need to meet the goals of the Paris Agreement – and save our own future.
Do you have an idea for a feature you think should be added to the project? Before jumping into the code, it's a good idea to discuss your idea in the Discord server. That way you can find out if someone is already planning work in that area, or if your suggestion aligns with other people's thoughts. You can always submit an issue explaining your suggestion. We try to review the issues as soon as possible, but be aware that the team is at times very busy. Again, feel free to ask for a review on Discord!
Looking for ideas on what needs to be done? We appreciate help on existing issues very much. If you pick one up, remember to leave a comment saying you're working on it, and roughly when you expect to report progress. This helps others avoid double work and know what to expect.
Testing, bug fixes, typos or fact checking of our data is highly appreciated.
See doc/contributing.md before making your first contribution.
Join the Discord server in the introduction or send an email to hej@klimatkollen.se.
This work wouldn't have been possible without the support from
Google.org, Postkodstiftelsen.
We'd also like to thank our current and former partners
ClimateView, Klimatklubben.se, Researcher's Desk, Exponential Roadmap, WWF, We Don't Have Time, Våra Barns Klimat, Argand, StormGeo, Iteam, Precisit.
MIT Copyright (c) Klimatbyrån