Instruction from setting up Contentful account.
- Create contentful account using gmail account
- Delete training data: "Start from scratch" -> "Skip onboarding"
- Open console. Install contentful-cli using "npm install -g contentful-cli". Doc - https://github.com/contentful/contentful-cli
- Login into your account using "contentful login"
- You can check your space id and environment id using commands "contentful space list" and "contentful space --space-id YOUR_SPACE_ID environment list"
- In order to add exhibit content model run "contentful space --space-id YOUR_SPACE_ID migration --environment-id YOUR_ENVIRONMENT_ID migrations/1_EPMGCIP-123_add-exhibit.js"
- Add secrets to github account (for local environment add variables to .env):
a) go to "settings" -> "actions" -> "new repository secret"
b) add "VITE_CONTENTFUL_SPACE_ID" - use command "contentful space list"
c) add "VITE_CONTENTFUL_ENVIRONMENT" - use command "contentful space --space-id YOUR_SPACE_ID environment list"
d) add "VITE_CONTENTFUL_CONTENT_DELIVERY_ACCESS_TOKEN" and "VITE_CONTENTFUL_CONTENT_PREVIEW_ACCESS_TOKEN". Tokens are available in "settings" -> "API keys" -> "Add API key"
- Add QR code application:
a) add REACT_APP_DOMAIN=YOUR_DOMAIN to .env
b) build app using "npm run build" on local machine
c) go to contentful - "App" -> "Custom apps" -> "Manage app definitions" -> "Create App"
d) type "Name"
e) enable "Hosted by Contentful"
f) upload bundle - all files from "build"
g) check "Entry sidebar"
h) save
- go to "Content model" -> "Exhibit" -> "Sidebar" -> click "plus" icon to add QR code application -> save