Overview of Local API Development Setup
Download WSL2
Download Windows Terminal (optional)
Install node
Install yarn
Install redis server
Clone github repository
Copy and paste the .env config file
Download WSL2
- Navigate to the Windows Powershell in the start menu and run as administrator
- Run the following command to install WSL and Ubuntu:
wsl --install -d ubuntu
- Restart your computer
- Create a username and password within the Ubuntu terminal
Reccomended
- Create a source directory and enter it using the following commands:
mkdir src cd src
https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-10#1-overview
Optional: Download Windows Terminal
- Go to the Microsoft app store and download windows terminal to use for multiple tabs of WSL Ubuntu.
- Create tabs using the dropdown arrow in the top tab and selecting Ubuntu
Install Node, Yarn, and Redis
- If you created a src directory, make sure to run the following commands within it
sudo apt install nodejs sudo apt install npm sudo npm install -g yarn sudo apt install redis-server
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-the-yarn-package-manager-for-node-js
https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-redis-on-ubuntu-18-04
Clone the Titan scouting Red-Alliance-API github repository
- Run the following commands to clone the repository then open it up in vscode:
git clone https://github.com/titanscouting/red-alliance-api.git cd red-alliance-api code .
Paste in the environment file
- Ask a titanscouting API member (Shaan, Blessita, or Dev) to send you the .env file
- Copy this file and paste it into your directory, making sure the name is .env
To run for development
- Open up windows terminal and create two tabs of Ubuntu
- cd into your src directory for both terminals if you created one, and then into the red-alliance-api directory
- In one window, open up VScode through the command terminal using code .
- In the other window, run the following command:
redis-server
- Within VScode, open up the terminal and run the following:
yarn start
- You should see a success message saying "Redis Client Connected!"
- you are now ready to begin API Development. Happy Coding!
Troubleshooting
- If your setup doesn't work, try the links above to see what's wrong
- If problems persist, contact a Titan Scouting API Member (Shaan, Blessita, Dev)