Skip to main content

2.3 Setting up Hasura Local Development

The Hasura Local Development setup's latest instructions are available here. The latest instructions have been simplified. The instructions below had helped me set the local development on Windows earlier:
  • Open Command Prompt. Type minikube start. The first time you type in this command, the minikube ISO will download. After the download and install inside VirtualBox, you get a message saying that kubectl is now configured to use the cluster. Something like this:
Fig 1. First time starting minikube
  • Type minikube ip to get your local cluster's ip address. This will help you in accessing the kubernetes cluster via Windows.
  • Go to https://beta.hasura.io/settings to get your API token and open your Command Prompt and type curl -H 'Authorization: Bearer <API_TOKEN>' -d '{\"ipaddr\": "\MINIKUBE_IP\"}' https://cloud.beta.hasura.io/v1/localdev , where <API_TOKEN> is replaced by the token you got earlier and MINIKUBE_IP is the ip you obtained from the same command earlier. You can even split the long command into small chunks using "^" after each line as shown below:

The response of the above command must be a url through which you will be access your hasura project via your browser.
  • Edit project-conf.yaml -> data -> project -> domains to the response url obtained in the above step.
  • Edit controller-configmap.yaml -> data -> controller-conf.json -> provider -> Local -> gatewayIP to the minikube ip obtained.
  • Now run the following commands one by one:
                           








  • Now around 1-1.5GB of data will be downloaded for setting up the local environment and the status can be checked via the command kubectl -n hasura get pods. Once all the services are in running state, the setup is done and you can start working on your project locally. To access your console, you need to go to console.<your_curl_command_response_url>. Eg. console.c100.hasura.me.

    Comments

    Popular posts from this blog

    3.2 Hasura Data API + Postman Collection

    The previous blog covered the data modelling of our app. Now it is the time to test the working of our database using some sample queries to the data endpoint of the database. Some of the sample queries made through Postman are: Insert to Song Queue Select all songs in the song database Select all songs in the songs queue The link to the API query collection is here .

    4.1 App Screen 1 (UI + Backend integration)

    The 1st screen app's UI and authentication part was dealt by my teammate Mayank Padhi and the details can be found in his blogpost . After the sample UI design, it is time to get real and get the real data from the database and use that to populate our first page( the songs queue page). So, as soon as the authentication takes place, another request is sent to get the songs list in queue via the data endpoint of our project. The response data of each song is then sent passed through a template creating function that fills all the details of songs at the right places and an accordion tab is ready. Similar process occurs with the rest of the data and then the HTML is then populated with our queue list, something like this: First look of our Home Screen Now, if you click on any of the song tabs, you will get the song details of that particular song. Like this: Song details on clicking a tab The "Get the List" button would take you to the app's 2nd screen. the s...

    1.1 The Three Screen App Idea

    The beginning of a new project is always tough, especially if you don't have a clue on what app you are going to build. We need to come up with an idea that is helpful in real life and something that people are interested in using. So, my friend and teammate for our internship project, Mayank Padhi, and I started thinking and researching on the internet ideas that we can develop into apps with our skill set. After a week or so, we had our own list of 3-5 ideas each that we thought were good. We shortlisted our ideas and ranked them according to our preferences and at the top of the list was a " Blood Donation App ".     We both loved the idea of making a blood donation app where people would register themselves along with their location details and when a needy person requested for blood, our app would send requests to the registered people if they would be free to donate and help another person in need. But after some research online, it turned out that the idea was a...