Coder Social home page Coder Social logo

kunalgorithm / react-hasura-todo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anupam-dagar/react-hasura-todo

0.0 2.0 0.0 383 KB

A react todo app using Hasura Graphql engine

Home Page: https://reacthasuratodo.herokuapp.com/

License: MIT License

HTML 4.70% CSS 1.75% JavaScript 93.54%

react-hasura-todo's Introduction

React Hasura Todo

A simple todo app built using React and Hasura GraphQL Enginer.

Features:

  1. Secure Authentication using auth0.
  2. Create as many todos as you want. Mark them complete or delete them if required.
  3. Check all your todos created till now.

Try this app

https://reacthasuratodo.herokuapp.com/

Setting up your own todo app with your own database.

  1. Clone this repository using https://github.com/Anupam-dagar/react-Hasura-todo.git
  2. Install the dependencies using yarn install.
  3. Deploy your Hasura GraphQL Server using One Click Deploy to Heroku.
  4. In your just created Heroku app, add an environment variable HASURA_GRAPHQL_ACCESS_KEY with its value being something you can remember. This key will be required to access your Hasura GraphQL server.
  5. Create a table named todos with following fields
    • todo_id: integer (auto increment)
    • todo_text: Text
    • todo_mark: Boolean
    • todo_user: Text
    • Chose todo_id as Primary Key.
  6. Set the permissions for your table in Hasura GraphQL server as follows:
    • Create a new role user.
    • For insert chose with custom checks
      • Select todo_user as the field, make it _eq to X-HASURA-USER-ID
    • For select chose with same checks as ---- and select all columns for access.
    • For update chose with same checks as ---- and give access only to todo_mark column.
    • For delete chose with same checks as ----.
  7. Sign up on https://auth0.com and create a new application.
  8. In the application settings, add http://localhost:3000/callback to the Allowed Callback Urls.
  9. Deploy auth0handler using One Click Deploy to Heroku
  10. Add an environment variable to your just deployed auth handler AUTH_ZERO_DOMAIN with its value being your auth0 domain address.
  11. Add an environment variable in your Hasura GraphQL server Heroku app .HASURA_GRAPHQL_AUTH_HOOK and keep its value your auth0 handler url/auth0/webhook.
  12. Create a file .env and include write the following data in it.
REACT_APP_CLIENTID=''
REACT_APP_REDIRECTURI='http://localhost:3000/callback'
  1. Change the domain in src/Auth/Auth.js to your auth0 domain.
  2. Change the uri in src/Components/Home.js to your Hasura GraphQL server url endpoint.
  3. Run the local server using yarn start.

LICENSE

MIT

react-hasura-todo's People

Contributors

anupam-dagar avatar

Watchers

James Cloos avatar Kunal Shah 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.