Skip to content

Tutorials‐Setup

Michael Collins edited this page Jan 11, 2024 · 5 revisions

Welcome 🎉

Welcome to the project, we're glad you're here 🙂

This tutorial is going to be a short walkthrough to get your environment and development space setup.

We'll cover:

  1. Cloning the repo
  2. Setting up Node & NPM
  3. Installing Dependencies
  4. Environment Variables
  5. Making sure everything works

Assumptions

In an effort to keep this tutorial as simple as possible we're going to assume a few things are already setup before starting:

  1. You are developing in a "linux like" environment that is OSX, Linux or WSL.
  2. You have appropriate password protected ssh keys setup and linked with your github account
  3. Your github account already has access to the project (if necessary)
  4. You have access to Vercel

If any of these are not the case please endeavour to resolve them before continuing

Setting up your environment

Clone the repo

git clone [email protected]:KlimaDAO/klimadao.git
cd klimadao

Setup Node & NPM

Our project uses newer features of node and npm (namely workspaces). So we will need to make sure you are running the correct version.

  1. Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bash_profile 

Note: replace .bash_profile with .zshrc or .bashrc as necessary, or restart your terminal

  1. Execute NVM
nvm

We recommend using NVM however if you wish to manage node versions yourself you can find the version inside /.nvmrc and configure it manually.

Install Dependencies

Now that you have the right version of node lets install the project dependencies

npm install

Environment Variables

All of our environment variables for the project are stored as secrets within Vercel. In order to run the project you will need to download these.

Note if you do not have access to Vercel you will need to request these manually from someone in the project who does

  1. Install vercel cli
npm install -g vercel
  1. Link to the relevant project
vercel link
  1. Select the following options (We will use Carbonmark as the project for this tutorial.. you will need to type "Carbonmark" at this step)
? Set up “~/klimadao”? [Y/n] y
? Which scope should contain your project? KlimaDAO
? Link to existing project? [y/N] y
? What’s the name of your existing project? Carbonmark
  1. Pull the environment variables
vercel env pull --environment development carbonmark/.env.local

You should now have downloaded the environment variables into the /carbonmark directory.

Running the project

Making sure everything works

Now it's time to make sure everything has been set up correctly

  1. Launch Carbonmark
npm run dev-carbonmark
  1. Navigate to http://localhost:3002

Assuming all went well you should see the following:

image

Congratulations 🥂

You are now ready to start developing