Giter VIP home page Giter VIP logo

hasura / cloud-functions-boilerplates Goto Github PK

View Code? Open in Web Editor NEW
16.0 30.0 3.0 98 KB

Boilerplates for cloud functions (AWS Lambda, Google Cloud Functions, Azure Cloud Functions, Zeit, etc.) that work in conjunction with Hasura GraphQL Engine's event triggers

JavaScript 77.64% Python 19.88% Dockerfile 2.48%
serverless cloudfunctions graphql-engine graphql graphql-tools examples boilerplates hasura

cloud-functions-boilerplates's Introduction

Important: Moved to hasura/graphql-engine

The contents of this repo have been moved to hasura/graphql-engine. Please create all issues and pull requests there.


Boilerplates for serverless cloud functions

This repository contains boilerplate functions for various use-cases, for different serverless or cloud function platforms. These functions implement sample use-cases of the different types of asynchronous business logic operations that can be triggered by the Hasura GraphQL Engine on database insert, update or delete.

Examples in this repository support the following cloud function platforms:

  • AWS Lambda

  • Google Cloud Functions

  • Microsoft Azure Functions

  • Zeit serverless docker

Note: If you want to add support for other platforms, please submit a PR or create an issue and tag it with help-wanted

Events Trigger and Serverless functions architecture

Architecture diagram

Setup Postgres + Hasura GraphQL engine

This boilerplate code assumes that you already have a HGE instance running.

If not you can visit the docs and setup Postgres + HGE.

Deploying the boilerplate examples

Follow the cloud function provider docs for setting these up. Provider specific README also contains CLI instructions.

Documented examples

  • A simple example to echo the trigger payload.

  • Make a GraphQL mutation on some data update/insert, from the serverless function (write related data back into the database).

  • Asynchronously send a FCM/APNS push notification.

  • ETL or data transformation: transform the trigger payload and update an algolia index.

Note: Some of the examples have a corresponding great-first-issue issue in the repository. Please checkout the checklist in the README in the cloud provider folders for such issues.

Repo Structure

Boilerplates have been organised into top-level folders for each cloud function platform. Inside each such folder, there's a folder for each language, followed by each use-case. The README for each cloud function provider has a list of available boilerplates.

The following is a representative tree of the folder structure:

.
├── aws-lambda
|   |── README.md
|   |── nodejs
|   |   |── simple-echo
|   |   |── mutation-trigger
|   |── python
|   |   ...
|
├── azure-functions
|   |── README.md 
|   |── nodejs
|   |   |── simple-echo
|   |   |── mutation-trigger
|   |── python
|   |   ...

Contributing and boilerplate requests

Want to contribute to this repo? Issues marked good-first-issue or help-wanted are a good place to begin. Please submit a PR for new boilerplates (other use-cases or cloud function providers/platforms like Apache OpenWhisk, etc.). You can also create issues to request new boilerplates.

cloud-functions-boilerplates's People

Contributors

dsandip avatar ecthiender avatar shahidhk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloud-functions-boilerplates's Issues

aws-java-mutation-trigger

Boilerplate for a mutation on the function being triggered ( See top-level README for details) for AWS Lambda

gcf-python-simple-echo

Boilerplate for a simple echo ( See top-level README for details) for Google Cloud Functions

aws-java-simple-echo

Boilerplate for echoing the trigger payload ( See top-level README for details) for AWS Lambda

gcf-python-mutation-trigger

Boilerplate for a mutation on function being triggered ( See top-level README for details) for Google Cloud Functions

gcf-python-etl-example

Boilerplate for transforming data from the trigger payload and updating an algolia index ( See top-level README for details) for Google Cloud Functions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.