Giter Site home page Giter Site logo

wonderpanda / hasura-nestjs-workshop Goto Github PK

View Code? Open in Web Editor NEW
56.0 2.0 12.0 242 KB

A fictional digital marketplace built using Hasura and NestJS

Shell 0.55% JavaScript 2.34% PLpgSQL 2.09% TypeScript 95.01%
nestjs hasura workshop graphql typescript

hasura-nestjs-workshop's Introduction

NestJS + Hasura Workshop

Demonstrating building complex applications with integration between Hasura and NestJS using

  • Hasura Actions
  • Remote Schemas
  • Event Triggers
  • Scheduled Events

The App

A fictional digital marketplace where users can exchange knowledge for coins. Users are given 50 coins upon registration. They can put up items with secret content in the marketplace to be purchased by other users.

The following rules apply:

  • Upon registration a user can create items to be sold on the marketplace
  • Registered users can view public information about all the items in the marketplace but they won't be able to see the item's secret content unless they purchase it using their inventory of coins
  • Upon purchase the cost of the item will be subtracted from the buyer's coins and added to the seller's account. 1 coin will be kept by the application as a processing fee on top of every purchase
    • Purchases need to properly leverage transactions to ensure that a user actually has enough coins, otherwise no account balances are modified

Notes

The master branch currently contains the finished project. If you'd like to follow along checkout the starting branch after cloning this repository.

Getting Started

Everything you need is included in this repository

  • A working Docker Compose setup with Hasura and Postgres
  • The Hasura CLI installed as a package dependency
  • SQL migrations to setup the intial database objects
  • GraphQL Code Generator for typesafe backend interactions
  • Convenience scripts for interacting with the various services

Clone the repo

git clone [email protected]:WonderPanda/hasura-nestjs-workshop.git

Install dependencies

yarn

Start services

docker-compose up -d

Run migrations

yarn hasura migrate apply

Apply metadata

yarn hasura metadata apply

Start the application

yarn start:dev

Join the Discussion

Please feel free to use Github Discussions to ask questions, propose changes, etc or connect with me on Twitter @WonderPandaDev

hasura-nestjs-workshop's People

Contributors

wonderpanda avatar

Stargazers

 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  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

Watchers

 avatar  avatar

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.