reindexio / reindex-starter-kit-apollo

Reindex starter kit with Apollo Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

reindex-starter-kit-react-apollo

Comprehensive Reindex starter kit with React, Apollo Client and Auth0 for Authentication. It also includes react-router, so it's easy to add new routes.

Running

  1. Install Reindex CLI and login

    npm install -g reindex-cli
    reindex login
  2. Set up Auth0 in Reindex

    Open GraphiQL console

    reindex graphiql

    In GraphiQL, create ReindexAuthenticationProvider for Auth0.

    mutation {
      createReindexAuthenticationProvider(input: {
        type: auth0,
        isEnabled: true,
        domain: "YOUR-AUTH0-DOMAIN.auth0.com",
        clientId: "YOUR-AUTH0-CLIENT-ID",
        clientSecret: "YOUR-AUTH0-CLIENT-SECRET",
      }) {
        id
      }
    }
  3. Install dependencies

    npm install
    
  4. Edit src/config.js to include your Reindex and Auth0 credentials

    export default {
      REINDEX_URL: 'https://YOUR-REINDEX-URL.myreindex.com',
      AUTH0_DOMAIN: 'YOUR-AUTH0-DOMAIN.auth0.com',
      AUTH0_CLIENT_ID: 'YOUR-AUTH0-CLIENT-ID',
    };
  5. Run development server

    npm start
    

    Go to http://localhost:3000

Deploying

  1. Build production version

    npm run build
    
  2. You can now deploy build/ folder to static hosting of your choice. We recommend surge.sh.

    npm install -g surge
    surge build/
    

About

Reindex starter kit with Apollo Client

License:MIT License


Languages

Language:JavaScript 97.8%Language:HTML 2.2%