Budibase Dev Environment Setup
Budibase is a low code platform you’ll enjoy using. Budibase is an open source low-code platform, and the easiest way to build internal apps that improve productivity.
### Short Story
This tutorial is intended for new users on Fedora or Linux any distro, as it took me a while to get rolling with Fedora. Initially I had problem setting up budibase dev enviroment in Windows as I’m a windows guy, I was adviced by my mentor to make a switch to Unix enviroment since Windows is not recommended; So I tried Fedora, Debian and Ubuntu - since its quite popular and I felt the support would be great; I wasn’t wrong though about Ubuntu, but I just did’nt fancy the OS, having used Kali Linux in High school. So I finally reinstalled Fedora as it has a higher rating for software development. Kindly follow the process step by step as I’m currently repeating the same process on a fresh system
### Setup Fedora
This process is also intended for fresh install of Fedora and should work fine on older ones too.
- Run a System Update on Fedora: This is actually a standard practice and shouldn’t take much of your time in any new installation for any Linux distribution.
sudo dnf update
- Enable RPM Fusion (Free & Non-Free): Fedora only allows packages which follows certain standards as such, not all packages are available on the official repositories. RPM Fusion tries to solve this by providing most of these packages rejected by the official repo.
- Free software:sudo rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
- Non-free software:sudo rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
- Enable Fastest Mirror Plugin by running `fastestmirror=true`. Fastest mirror fetches the nearest mirror to your location.
- Restart your Fedora machine.
### Dev Setup
For the purpose of this tutorial, I’ll advice you have a basic understanding of git and Open source contribution.
- Fork Budibase
After you’ve forked budibase repo “https://github.com/Budibase/budibase” - Install NVM
Head back to your terminal and runcurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
Close the terminal and open it again after installing to enable us usenvm
- Install Node
Runnvm install 14
to install node.js version 14. NVM makes it very easy to install node.js and also switch easily between different versions of node, for the purpose of contributing to budibase, please stick to ‘version14’ for now. - Install npm requirements forBudibase
Runnpm install -g yarn jest lerna
to install those packages globally in our system. - Install Docker and Docker Compose
Kindly not that I won’t be installing the GUI version (Docker Desktop) in this tutorial as it’s not necessary for the project. Run the following commands: 1.sudo dnf -y install dnf-plugins-core
2.sudo dnf config-manager \
3.
--add-repo \
https://download.docker.com/linux/fedora/docker-ce.reposudo dnf install docker-ce docker-ce-cli containerd.io docker-compose-plugin
4.sudo systemctl start docker
5.sudo systemctl enable docker
6.sudo docker run hello-world
- Clone Repo
Now is time to clone our forked repo:cd ~/Documents
then rungit clone https://github.com/<github username>/budibase.git
thencd budibase
andyarn setup
Handling Errors
— Redis connection failed
I got an error after running yarn setup
“Redis connection failed” || “Redis Client Error Error: connect ECONNREFUSED 127.0.0.1:6379”
To fix it run
sudo dnf install redis
sudo systemctl start redis
— Password configured
After running the above command, We’ll end up with another redis error “Redis Client Error [ErrorReply: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?]” or “ [WARN] This Redis server’s `default` user does not require a password, but a password was supplied” or “FetchError: request to http://localhost:4005/global-db/ failed, reason: connect ECONNREFUSED 127.0.0.1:4005
@budibase/server:”
To fix it run
sudo nano /etc/redis/redis.conf
- Once file is open “ctrl + w” to search for text in file
- In the search box with “Search: ” enter “# requirepass”
- You’ll be presented with something like this: ‘# requirepass foobared’, now uncomment/remove the pound sign (#) and replace foobared with ‘budibase’
> In essence, you should have this “requirepass budibase”
> Then “ctrl + x”; In this field “Save modified buffer? ”; press “y” then click the enter key to save
> Press the enter
— If we should run ‘Yarn setup’, We’ll get the same error “Redis Client Error [ErrorReply: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?]” or “FetchError: request to http://localhost:4005/global-db/ failed, reason: connect ECONNREFUSED 127.0.0.1:4005
@budibase/server”
To fix it run
redis-cli
CONFIG SET requirepass "budibase"
AUTH budibase
- ctrl + c
— Spawn docker-compose
If we should run ‘Yarn setup’, We’ll get another error “Something went wrong while managing budibase dev environment: spawn docker-compose ENOENT”
To fix it run
- sudo dnf -y install docker-compose
— docker.errors.DockerException
If we should run ‘Yarn setup’, We’ll get another error “raise DockerException(@budibase/server: docker.errors.DockerException: Error while fetching server API version: (‘Connection aborted.’, PermissionError(13, ‘Permission denied’))” or “PermissionError: [Errno 13] Permission denied”
To fix it run
sudo chmod 777 /var/run/docker.sock
— redis-dev Cannot start service redis-service
If we should run ‘Yarn setup’, We’ll get another error “RROR: for budi-redis-dev Cannot start service redis-service: driver failed programming external connectivity on endpoint budi-redis-dev (e72e35952014e517f893bec2e9117e4cf7346e114c3c9ec1acaec48b8ffc6065): Error starting userland proxy: listen tcp4 0.0.0.0:6379: bind: address already in use”
To fix it run
sudo systemctl stop redis
Our dev should be up and running now on http://127.0.0.1:10000/builder/portal/apps
### Cleanup
If app if taking so much time to load or you wish to delete all the apps created in development and reset the environment then run the following:
1. `yarn nuke:docker` will wipe all the Budibase services
2. `yarn dev` will restart all the services
3. If app keeps spinning infinitely in chrome, try a different browser like firefox