Hasura project

A Hasura project is a “git-able” directory in the file system, which captures all the information regarding clusters, microservices and migrations. It can also be used to keep source code for custom microservices that you write.

You can git push hasura master to deploy everything, including your custom microservices, database migrations and project configuration.

Creating a project

$ hasura clone base my-project

# creates a directory called `my-project` and initialize an empty Hasura project
INFO Getting app details...                        app=hasura/base
INFO Found on Hasura hub
INFO Downloading...
INFO Downloaded app to directory
INFO Cloned app successfully

This will ‘clone’ a base project from Hasura Hub. Note, you can clone any project from the hub and use that as a starting point for your new project.


hasura/hello-world is another project that contains a few database migrations, some sample data and even a sample microservice to get started quickly.


This command automatically initializes a git repository

Files and directories

The project (a.k.a. project directory) has a particular directory structure and it has to be maintained strictly, else hasura cli would not work as expected. A representative project is shown below:

  • hasura.yaml

This file contains some metadata about the project, namely a name, description, repoUrl, keywords and some media data. Also contains platformVersion which says which Hasura platform version is compatible with this project.

name: <project_name>
description: <description_text>
keywords: <tag1>, <tag2>
repoUrl: <public_code_repo_link>
  - <image_link_1>
  - <image_link_2>
  - <video_link_1>
platformVersion: v0.15.3
  • clusters.yaml

Info about the clusters added to this project can be found in this file. Each cluster is defined by it’s name allotted by Hasura. While adding the cluster to the project you are prompted to give an alias, which is just hasura by default. The kubeContext mentions the name of kubernetes context used to access the cluster, which is also managed by hasura. The config key denotes the location of cluster’s metadata on the cluster itself. This information is parsed and cluster’s metadata is appended while conf is rendered. data key is for holding custom variables that you can define.

- name: ambitious93
  alias: hasura
  kubeContext: ambitious93
    configmap: controller-conf
    namespace: hasura
  data: null
  • conf
    • authorized-keys.yaml
      • SSH keys allowed to access the cluster
      • One public key per line
    • *.yaml
      • Configuration for the cluster, split into various yaml files
  • migrations
    • Database migration files are kept in this directory
  • microservices
    • Default directory to store source code for custom microservices
    • Each sub-directory contains source code and Dockerfile


hasura cli doesn’t consider any other files or directories outside of those mentioned above