Giter Site home page Giter Site logo

bradyadger12 / hasura-base-node Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aaronblondeau/hasura-base-go

0.0 0.0 0.0 278 KB

Starter app for hasura with auth and storage (In Node)

License: MIT License

JavaScript 4.87% CSS 1.02% HTML 70.89% PLpgSQL 1.03% TypeScript 22.19%

hasura-base-node's Introduction

Hasura Base (Node.js)

This is a starter project that uses Hasura, Prisma, Minio, BullMQ, and Maizzle. Authentication is handled by Hasura and JWTs.

Getting Started

  1. Install dependencies
yarn
  1. Copy .env.example to .env and update values (note "TODO" values). The S3 secret and key will be updated in step 4 below.

  2. Start the docker containers

Before starting the containers, switch the postgres image to something like "postgis/postgis:15-3.3" in docker-compose.yml if you need PostGIS support.

yarn dev:docker:start
  1. Use the minio UI (http://localhost:9090/) to create 'user-public', and 'project-assets-public' buckets as well as to create an api access key and secret. Update S3_ACCESS_KEY and S3_SECRET_KEY in .env file.

  2. Start the node.js server

yarn dev
  1. Run hasura migrations and apply metadata
yarn dev:migrate
yarn dev:metadata
  1. Start the hasura console
yarn dev:console
  1. Use the hasura console to create additonal tables, actions, events, relationships, and permissions.

Other admin tools are available at (see .env file for passwords):

Minio UI : http://localhost:9090/ BullMQ UI : http://localhost:3000/admin/queues

  1. To update prisma schema after hasura db updates:
yarn prisma db pull
yarn prisma generate
  1. When done, stop the docker containers
yarn dev:docker:stop

Email Templates

Emails templates are managed with maizzle.

To develop email templates:

cd src/emails
yarn install
yarn dev

Once the dev server has started, go to http://localhost:3050/. Updates to templates will live reload!

To build email templates

cd src/emails
yarn build

Troubleshooting

Prisma model types not updating? Open databse.ts and remove import import { PrismaClient } from '@prisma/client' save, then restore import and save again

RequestTimeTooSkewed: The difference between the request time and the server's time is too large. => Stop containers, stop docker desktop, then restart all

hasura-base-node's People

Contributors

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