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.
-
Install Reindex CLI and login
npm install -g reindex-cli reindex login
-
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 } }
-
Install dependencies
npm install
-
Edit
src/config.js
to include your Reindex and Auth0 credentialsexport default { REINDEX_URL: 'https://YOUR-REINDEX-URL.myreindex.com', AUTH0_DOMAIN: 'YOUR-AUTH0-DOMAIN.auth0.com', AUTH0_CLIENT_ID: 'YOUR-AUTH0-CLIENT-ID', };
-
Run development server
npm start
Go to
http://localhost:3000
-
Build production version
npm run build
-
You can now deploy
build/
folder to static hosting of your choice. We recommend surge.sh.npm install -g surge surge build/