Giter Site home page Giter Site logo

rozey17 / appsync-react-hooks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from petehanssens/appsync-react-hooks

0.0 1.0 0.0 1.83 MB

Using appsync, auth0, nextjs, zeit, and react-hooks to build an example website.

Shell 0.22% JavaScript 99.78%

appsync-react-hooks's Introduction

Appsync React-Hooks

This repo aims to show you how to setup an end to end application deployment environment with the following features:

  • CI/CD with CodeBuild and CodePipeline
  • DynamoDB backend for state
  • GraphQL API using Appsync
  • Auth0 and API Key for authorization
  • React/Nextjs frontend
  • Apollo react-hooks for communicating with the Appsync API
  • React Semantic UI for styling
  • Zeit for hosting and building the frontend including storing environment variables

Github

First of all fork this repo and take note of your username and the name of the repo.

Auth0 setup

Sign up for Auth0:

  • create a new tenant
  • keep note of the Domain and Client ID

Backend setup

The backend requires a few steps to be followed in order for it to work:

  • cd into backend/infrastructure and deploy the SSM stack
  • Also deploy the CI stack
  • Go to the AWS Console or via the AWS CLI, update the SSM variables
  • For the Issuer, use Domain and append "https://" in front of it
  • For Client Id, use the Client ID from Auth0 that you took note of previously
  • Now you should be ready to deploy the Appsync app
  • cd out of the current directory and into the services directory
  • Run sls deploy --aws-profile
  • Check the console or via the AWS CLI to see that the backend appsync service has been deployed.
  • Also check using GraphiQL that you can use the Appsync endpoint with the api key outputted from the serverless deployment.

Load in data

Go to the data/graphql_loader folder and run node event_loader.js in order to populate the database.

Fronted setup

The following steps need to be followed to get the frontend up and running locally:

  • Copy Appsync.example.js to Appsync.js and enter the variables
  • Do the same for .env.example
  • run yarn build and the run yarn dev check out the site at http://localhost:3000
  • the yarn build step is needed to compile the css required for React Semantic UI

Zeit setup

appsync-react-hooks's People

Contributors

petehanssens avatar

Watchers

 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.