-
Notifications
You must be signed in to change notification settings - Fork 73
Tutorials‐Setup
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:
- Cloning the repo
- Setting up Node & NPM
- Installing Dependencies
- Environment Variables
- 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:
- You are developing in a "linux like" environment that is OSX, Linux or WSL.
- You have appropriate password protected ssh keys setup and linked with your github account
- Your github account already has access to the project (if necessary)
- You have access to Vercel
If any of these are not the case please endeavour to resolve them before continuing
git clone git@github.com:KlimaDAO/klimadao.git
cd klimadao
Our project uses newer features of node and npm (namely workspaces). So we will need to make sure you are running the correct version.
- 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
- 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.
Now that you have the right version of node lets install the project dependencies
npm install
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
- Install vercel cli
npm install -g vercel
- Link to the relevant project
vercel link
- 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
- Pull the environment variables
vercel env pull --environment development carbonmark/.env.local
You should now have downloaded the environment variables into the /carbonmark
directory.
Now it's time to make sure everything has been set up correctly
- Launch Carbonmark
npm run dev-carbonmark
- Navigate to
http://localhost:3002
Assuming all went well you should see the following:
You are now ready to start developing