Steps to get started on a Windows OS (If you already have an Ubuntu, skip to step 2):
NOTE: If you want to have it on the menu as well, click the 9 dots on the bottom left corner (if your menu is still on the left side) and find VS Code. Right-click it and hit “Add to favorites”. Now it will stay on your menu tab
a. sudo apt update --- this will make sure your apt is up to date
b. sudo apt install git --- this will install git
Find the GitHub repository that you want to clone and copy it.
Now in VS Code, open a new window. There will be a button that says, “Clone git repository”. Click that and paste the GitHub repository into the box. Save it in a good spot.
Now back in the terminal, we need to install:
NOTE: If needed, close and reopen a new Terminal to see if the change occurred or not
asdf
In Terminal, write the command: sudo apt install curl git
Clone this git with this command:
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1
Then navigate to your bashrc file by doing this command:
nano ~/.bashrc
Scroll all the way to the bottom and add the following lines:
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
SAVE THE FILE!!!
Close and reopen a new terminal
node
Way 1:
Way 2:
direnv
In Terminal, write the command: sudo apt-get install direnv
Then in root, type the command: nano ~/.bashrc
Scroll all the way down and add the following lines:
#direnv
eval "$(direnv hook bash)"
SAVE THE FILE!!!
You MUST close and reopen the terminal for this install to work
You will know this works when you open up the project folder and there is a red warning saying you need to run: direnv allow
Run: direnv allow
If there are no results, then it was done incorrectly. Restart the process.
If you'll be working on legacy Yggdrasil repo then install yarn, else install pnpm (the same command just pnpm instead of yarn)
Go to npmjs.org and create an account. After creating an account, click the drop-down menu on the top right and click “Access Tokens”. Click “Generate New Token” and a new npm token will be generated for you. Click your token and it will be automatically copied.
Back in VS Code, create a new file in the service folder (e.g. midgard) called .env
In .env, you will type the following: NPM_TOKEN= <PASTE YOUR TOKEN HERE>
If your mentor wants you to do staging, they will tell you the other links to post here
MAKE SURE THE SAVE THE FILE!!!
Everything should be set up now. Start a brand-new terminal and do the following:
Navigate to your project
Make sure yarn is installed
Make sure to do: direnv allow
Make sure there are results
Navigate to the service you are working on
Make sure your node version is correct
Finally launch using: yarn dev
Open up any browser (preferably Google Chrome) and go to localhost:3004 (or whichever port the project is using). This will take a minute or a couple of seconds. Then you are on your way!