This repository is deprecated and the majority of it has been moved to hasura/microservie-templates.
This instructions are valid only for Hasura Platform versions < 0.15.0
hasura/microservie-templates insteadIf you are on version > 0.15.0, checkout
Hasura is a platform for building and deploying application backends. The platform 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 app backend in your favourite language/framework or with a product of your choice in a Hasura project, this repository maintains a collection of starter kits for popular options.
- Hello-world for python-flask, java-spring boot, nodejs-express php-apache, .Net, etc.
- Static file service based on nginx
- Web service in Swift (Vapor, Perfect)
- Deploying a MySQL service
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. Hence, this doesn't include things like setting up docker-compose files or more advanced framework specific configurations yet.
Getting Started in 5 easy steps
To use any of the starter kits, follow these instructions:
Create a project: activate your free-trial project here - https://dashboard.hasura.io (requires sign up or log in).
Add your SSH key to the project console: instructions on creating and adding your SSH key.
Create a custom
git pushmicroservice: see reference documentation.
Clone and prep this repo to use your favourite language/framework:
Clone this repo:
git clone https://github.com/hasura/quickstart-docker-git
Copy the relevant starter kit: e.g. to use the nodejs + express starter kit,
cp -r quickstart-docker-git/nodejs-express my-node-project
Initialize a git repo inside this folder:
cd my-node-project && git init
git push the starter kit to deploy:
stage the files in the starter kit and commit them.
git add .
git commit -m "hasura quickstart"
copy the git remote location from the console (the service's manage page)
Add the service's git remote
git remote add hasura ssh://hasura@<service-name>.<project-name>.hasura-app.io/~/git/<service-name>/
Note: replace <service-name>, <project-name> with the name/sub-domain of the service created in step-3 and name of the project created in step-1 respectively. Check the image below for reference
push your changes to the remote
git push hasura master
That's it! Your starter kit in now live
If you followed the 5 steps in the previous section, you would have deployed a web application to the cloud from scratch without breaking a sweat. Yay! To understand the Hasura platform in more detail, we highly recommend doing at least one of the following:
- Check out the mini-interactive tutorials built right into the project console.
Check out our documentation
BaaS Samples: Sample code is being added to each starter kit for demonstrating Hasura BaaS features like Data, Auth, Notify, and File services. Meanwhile, feel free to get in touch with us if you need any help.
Docker: You can use
docker runto build your own image and get a running container. Basic configuration options are specified in
docker-config.yaml. Custom or 3rd party Docker images can be deployed on Hasura with the same ease.
Repo structure: Every starter kit has the following structure:
/ --Dockerfile --docker-config.yaml --README.md --app/
The README inside each starter kit contains further instructions.
Automated Docker hub builds: All starter kits in this collection can readily be integrated to setup an automated docker image build system.
Read here for more details: https://docs.docker.com/docker-hub/github/
Please fork, file comments/bugs and submit your PRs! We've created a list of issues where active help is required: help-wanted.
- Add support for more frameworks
Dockerfiles 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
Dockerfilewith comments where you expect users to modify
- Try to document the following major use cases when writing your README:
git pushbased automated docker build,