DEV Community

Cover image for Hasura Local Development
Sumit Roy
Sumit Roy

Posted on • Edited on

Hasura Local Development

As of my earlier posts about web app snipcode this is my next step to achieving that. I have to setup a local development server to test and build the web app and then push it to Github and deploy on hasura. To setup the local development server here are the prerequisites-

  • Virtualbox
  • Minimum Ram - 4GB and 64 bit system
  • Hasuractl
  • Kubectl

Extra for Windows user

  • git-bash installed

Git Bash

Now let me go through the installation step for all of these. First git-bash in windows.

Go to the link and download the .exe file for 64-bit git-bash and install on your PC. For Linux and Mac users this is not required.

VirtualBox

Next is VirtualBox. You have to download VirtualBox according to your os from this link.

If you are on a Mac, you need the version for “OS X hosts”. Install it by double-clicking the file downloaded.

If you are on Windows, you need the version for "Windows hosts". Install that .exe file by double-clicking it.

If you are on Linux you need "Linux distributions" then choose the distros your PC running. After downloading the file you need some installing commands to be run in your terminal. For Debian users

dpkg -i virtualboxfile.deb

For rpm installation

rpm -i virtualboxfile.rpm

Hasuractl

After installing all these this step is to install hasuractl. For windows user download the hasuractl.exe and install using this video reference.

For linux user

curl -Lo hasuractl https://storage.googleapis.com/hasuractl/v0.1.2/linux-amd64/hasuractl && chmod +x hasuractl && sudo mv hasuractl /usr/local/bin/

it will download hasuractl and set the path to usr/local/bin in your computer.
Same for Mac users also instead the command will be

curl -Lo hasuractl https://storage.googleapis.com/hasuractl/v0.1.2/darwin-amd64/hasuractl && chmod +x hasuractl && sudo mv hasuractl /usr/local/bin/

Kubectl

  1. For Mac users
  • Download latest using curl

curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl

  • Make the kubectl binary executable

chmod +x ./kubectl

  • Move the binary into your PATH

sudo mv ./kubectl /usr/local/bin/kubectl

  1. For Linux users
  • Download latest using curl

curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl

  • Make the kubectl binary executable

chmod +x ./kubectl

  • Move the binary into your PATH

sudo mv ./kubectl /usr/local/bin/kubectl

  1. For Windows users
  • Download the latest release v1.6.3 from this link.

  • Add the binary into your PATH.

Starting Hasura

After installing all prerequisites now is the time to start hasura local dev. Windows users try these commands in git-bash. And make sure you have an account in hasura if not then go to beta.hasura.io and signup.

hasuractl login

alt text

-for logging into hasura account

hasuractl local start

alt text

-for starting local development and downloading all the necessary tools. It will take time for the first time depending on internet connection.

hasuractl local stop

alt text

-for stopping the dev environment

In case of any errors restart the process by cleaning the local setup

hasuractl local clean

or by deleting all VM's and configuration

hasuractl local delete

Here is the index of all the post regarding this series of snipcode developemnt

Part I: App Idea
Part II: App prototype
Part III: Local Development
Part IV: G for Git
Part V: Data Modeling
Part VI: Data & Auth APIs
Part VII: Basic Functionalities
Part VIII: App Screen 1
Part IX: App Screen 2
Part X: App Screen 3
Part XI: User Reviews
Part X: Final Submission

Liked my post?

Top comments (0)