Skip to content

Latest commit

 

History

History
46 lines (27 loc) · 3.59 KB

getting-started.md

File metadata and controls

46 lines (27 loc) · 3.59 KB

Getting started

Klimatkollen is for the most part a self-contained web application. This means you can run it on your own computer and see your own copy in your web brower. This page will outline how to do that from scratch. If you haven't done some of these things before, it might feel like a long process before you get to launch the page. Almost all of it is one-time setup, meaning once you get through it, contributing in the future is much easier.

The steps will be as follows:

  • Getting the source code
  • Installing Node.js
  • Installing other dependencies
  • Running Klimatkollen

If you get stuck at any point, don't hesitate to ask on the Discord which is linked in the main README. Really - we want to help!

Downloading Node.js

Klimatkollen is written mostly in JavaScript. To execute JavaScript directly on your computer, you need Node.js. Just press the big "download" button and follow the instructions. After the installation, start a new terminal or command prompt to verify that it went well. You should be able to run the commands "node" and "npm" successfully. Just remember to start a new terminal.

Getting the source code

Klimatkollen is open source and the source code is hosted on GitHub. The absolute easiest way to get it is to just press the big green "Code" button on that page and select "Download ZIP". If you don't plan on making any of your own contributions, this is enough and you can skip to the next section.

If you do want to contribute code, or even check out other people's work-in-progress, you will need to use git, which is a system that manages source code history and enables collaboration. If you're not faimiliar with git, here are some links that can get you started. Don't feel like you have to spend a lot of time learning git. A basic understanding is enough to get by in most cases.

There are many ways to use git and everyone has their favorites. One suggestion is to use GitHub Desktop which is a quick and simple way to get started. The following guide shows you how to "clone" a "repository" with GitHub Desktop. The term "clone" means to download a copy that is managed by git, and a "repository" is what we call that copy, both locally and on GitHub.

No matter if you use the Desktop app, ZIP, or some other method, you need to have a copy of the code somewhere on your computer in the end. The rest of the instructions assume you have located that directory and moved inside it using a terminal.

Installing other dependencies

To build and run Klimatkollen, some dependencies are required apart from Node.js itself. The main ones are as follows:

The full list is in "package.json" which is a file that npm can understand. To have it install all of the dependencies at the right versions, run npm run ci.

Running the Klimatkollen webapp.

If all the dependencies were installed without issues, you should be able to run npm run dev. This will de a little slow the first time, but ifeverything goes well it will tell you it is serving the app from "localhost:3000". Type that address in your browser and you should see your local copy of Klimatkollen in its full glory!