Code Monkey home page Code Monkey logo

nhost-react-ts-app-template's Introduction

Nhost React Typescript Example App

Nhost example app in React (Typescript) using Hasura.


Technologies


Get started

  1. Create a project on Nhost.
  2. Clone this repo: git clone [email protected]:nhost/nhost-react-typescript-example-app.git.
  3. Copy config-example.yaml to config.yaml in hasura/.
  4. In hasura/config.yaml, update endpoint and admin_secret from your Nhost project.
  5. Apply migrations and metadata in the hasura/-folder: hasura migrate apply; hasura metadata apply;. Make sure you have the Hasura CLI installed.
  6. In src/utils, copy config-example.ts to config.ts.
  7. Update config.ts with BACKEND_ENDPOINT and GRAPHQL_ENDPOINT from your project at Nhost.
  8. yarn install.
  9. yarn start.

What's in the example app?

Auth (JWT)

  • Register (email/password)
  • Register using a OAuth provider (Google, Github etc)
  • Login
  • Handle refresh token (automatically)

Data (GraphQL)

  • Create todo
  • Read todo
  • Update todo
  • Delete todo

Storage (S3)

  • Upload file
  • Read file
  • Delete file

Apollo GrahpQL Codegen and Autocomplete

Edit apollo.config.js and package.json (apollo:generate). The only thing you need to edit is endpoint and header (x-hasura-admin-secret).

Once the two files are correctly configured you can auto generate type definitions from GraphQL using:

yarn apollo:codegen

All type definitions will be placed in src/generated/.

nhost-react-ts-app-template's People

Contributors

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