Hasura is a platform for building and deploying application backends. It is a Kubernetes based PaaS (Platform-as-a-Service to deploy backends) and a PostgreSQL based BaaS (Backend-as-a-Service to rapidly build backends).
To help you quickly bootstrap your microservice in a Hasura project, this repository maintains a collection of starter kits for popular options.
What is not included: This is just a collection of starter kits. The idea is to modify the kits as you need to get to a basic setup that works.
Make sure you've installed the hasura CLI
tool.
To use any of these templates, follow these instructions:
# Step 1: Create a new hasura project if you don't have one already
$ hasura quickstart hasura/base my-project
# Step 2: cd inside the project directory and generate
# the microservice folder (called app) based on a template
$ cd my-project
$ hasura microservice generate app --template=nodejs-express
# Step 3: Configure your project so that you can deploy
# the microservice with a 'git push hasura master'.
# The command below will add the configuration to the
# right file.
$ hasura conf generate-remote app >> conf/ci.yaml
# Step 4: Configure a route (subdomain or path) on which
# you want to expose this microservice externally/publicly
$ hasura conf generate-route app >> conf/routes.yaml
# Step 5: Commit and push!
$ git add conf/ci.yaml conf/routes.yaml microservices/app
$ git commit -m "Adds the app microservice"
$ git push hasura master
# FINISH: You're all done! Run the command below to
# list all your microservices and their URLs.
$ hasura microservices list
For more information on how to use microservices on Hasura, head to the docs.
Please fork, file comments/bugs and submit your PRs! We've created a list of issues where active help is required: help-wanted.
Specifically,
- Add support for more frameworks
- Optimise
Dockerfile
s for faster builds, or for production (esp. for compiled languages)
Some important things to keep in mind when contributing:
- Expose only one port, and one data volume to help keep things simple
- Annotate the
Dockerfile
with comments where you expect users to modify - Try to document the following major use cases when writing your README:
git push
,docker build
and local development/testing of the microservice without deploying to the Hasura cluster.