All Projects → zenflow → hasura-node-monolith-example

zenflow / hasura-node-monolith-example

Licence: MIT license
Example of a monolithic web application using Hasura GraphQL Engine + Node.js + Next.js

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
PLpgSQL
1095 projects
shell
77523 projects
Dockerfile
14818 projects
CSS
56736 projects

Projects that are alternatives of or similar to hasura-node-monolith-example

instagram-clone
Instagram clone using apollo, react and graphQl (hasura-graphQl engine)
Stars: ✭ 44 (+76%)
Mutual labels:  apollo, hasura, hasura-graphql-engine
graphql-to-sql
GraphQL model to SQL
Stars: ✭ 13 (-48%)
Mutual labels:  hasura, hasura-graphql
members
Managing People (Members), CRUD with Dashboard
Stars: ✭ 36 (+44%)
Mutual labels:  apollo, hasura
ng-mono-repo-starter
Angular Mono Repo Starter
Stars: ✭ 79 (+216%)
Mutual labels:  mono, monorepo
typescript-graphql-postgres-boilerplate
Simple boilerplate integrated typescript, graphql, postgres and apollo server
Stars: ✭ 18 (-28%)
Mutual labels:  apollo, apollo-graphql
create-full-stack
Set up a TypeScript full stack with one command.
Stars: ✭ 94 (+276%)
Mutual labels:  apollo, hasura
hasura-metadata-patcher
CLI tool to patch Hasura metadata json file. Helps to organize complex CI/CD flows through different environments.
Stars: ✭ 14 (-44%)
Mutual labels:  hasura, hasura-graphql-engine
apollo-log
A logging extension for the Apollo GraphQL Server
Stars: ✭ 64 (+156%)
Mutual labels:  apollo, apollo-graphql
github-react-native-apollo-graphql
📱 A GitHub mobile app built with React-Native and Apollo GraphQL
Stars: ✭ 24 (-4%)
Mutual labels:  apollo, apollo-graphql
recipes-next-hasura
A lightweight app to explore and create recipes - Built with Next.js, Hasura, and Chakra-UI
Stars: ✭ 30 (+20%)
Mutual labels:  apollo, hasura
Plugin Graphql
Vuex ORM persistence plugin to sync the store against a GraphQL API.
Stars: ✭ 215 (+760%)
Mutual labels:  apollo
Modern Graphql Tutorial
📖 A simple and easy GraphQL tutorial to get started with GraphQL.
Stars: ✭ 219 (+776%)
Mutual labels:  apollo
introduction-nodejs
Introduction to NodeJS
Stars: ✭ 13 (-48%)
Mutual labels:  monorepo
Apollo
Apollo is a Open-Source music player for playback and organization of audio files on Microsoft Windows, built using Python.
Stars: ✭ 13 (-48%)
Mutual labels:  apollo
React Native Fullstack Graphql
🚀 Starter projects for mobile applications based on React Native & GraphQL.
Stars: ✭ 208 (+732%)
Mutual labels:  apollo
PocoDynamo
C# .NET Typed POCO Client for AWS Dynamo DB
Stars: ✭ 39 (+56%)
Mutual labels:  mono
Next Ecommerce
⚡️ Quantum Ecommerce. Made with Next.js | GraphQL | Apollo Server | Apollo Client | SSR
Stars: ✭ 186 (+644%)
Mutual labels:  apollo
Next React Graphql Apollo Hooks
React, Apollo, Next.js, GraphQL, Node.js, TypeScript high performance boilerplate with React hooks GraphQL implementation and automatic static type generation
Stars: ✭ 186 (+644%)
Mutual labels:  apollo
Fullstack Boilerplate
Fullstack boilerplate using Typescript, React, GraphQL
Stars: ✭ 181 (+624%)
Mutual labels:  apollo
hasura-auth
Authentication for Hasura.
Stars: ✭ 276 (+1004%)
Mutual labels:  hasura

hasura-node-monolith-example

This is a sample fullstack web application incorporating the following:

Check out my Production Deployment

Architecture Notes

  • Hasura's auth webhook is used (as opposed to configuring Hasura to read JWT claims directly) because it allows the user's role to be dynamic. This way (supposing we had more roles in the app) users won't have to sign out & sign in when their role changes. We can also easily implement user or token blocklists if required.

Local development

Requires Node.js >= v14, yarn package manager v1, & docker ( Docker Desktop >= v3.2 for Windows & Mac, or Docker Engine >= v19.03 for Linux).

Copy contents of .env.example to .env and optionally fill in values (defaults should work).

yarn install

Start development db with yarn db (needs to be running for either of next two tasks)

Start app in dev mode with yarn dev, or start app in production mode with yarn start.

When the app is started in dev mode:

  • The Hasura Console (Hasura's web UI) will be opened in a browser tab along with the Next.js web app.
  • Changes made via the Hasura Console will be reflected in changes in hasura/migrations/ & hasura/metadata/ which can be committed to Git. These migrations & metadata are applied whenever the app starts, for both dev mode & production, using Hasura's cli-migrations image.
  • The TypeScript types for GraphQL queries/mutations/fragments (in web/graphql/generated.ts) will be regenerated whenever there are edits to a .graphql file.
  • You can execute other hasura-cli commands with yarn _hasura, e.g. yarn _hasura seed apply or yarn _hasura --help.

Production deployment

Use the Dockerfile in the project root and define the variables documented in .env.example.

With Heroku

  • This project is ready to deploy without code changes (i.e. includes heroku.yml)
  • Create app in Heroku web ui, and before connecting to repo, run (in any directory) heroku stack:set container -a your-app-name-here. Then you can (in Heroku web ui) connect app to repo (under "Deploy" tab -> "Deployment method").
  • Heroku Postgres will define the DATABASE_URL environment variable. Be sure to copy it to HASURA_GRAPHQL_DATABASE_URL
  • Set environment variable HASURA_GRAPHQL_CLI_ENVIRONMENT=default as per hasura/graphql-engine#4651
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].