Hyperclaw79 / microservice-templates

Templates for microservices that can be added to a Hasura project

Home Page:https://hasura.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

microservice-templates

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.

Getting Started in 5 easy steps

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.


Contribution Needed!

Please fork, file comments/bugs and submit your PRs! We've created a list of issues where active help is required: help-wanted.

Specifically,

  1. Add support for more frameworks
  2. Optimise Dockerfiles for faster builds, or for production (esp. for compiled languages)

Some important things to keep in mind when contributing:

  1. Expose only one port, and one data volume to help keep things simple
  2. Annotate the Dockerfile with comments where you expect users to modify
  3. 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.

About

Templates for microservices that can be added to a Hasura project

https://hasura.io

License:MIT License


Languages

Language:PHP 41.4%Language:JavaScript 14.0%Language:HTML 12.9%Language:Java 7.4%Language:Dockerfile 5.3%Language:TypeScript 3.6%Language:Python 3.0%Language:C# 1.8%Language:Blade 1.5%Language:R 1.5%Language:CSS 1.5%Language:Makefile 0.9%Language:Shell 0.9%Language:Go 0.8%Language:Swift 0.8%Language:Scala 0.7%Language:Ruby 0.6%Language:Sass 0.4%Language:Haskell 0.4%Language:Vue 0.3%Language:PowerShell 0.3%