Kontent.ai Learn is an educational portal that uses Kontent.ai as a source of its content.
- The website is written in JavaScript.
- It uses express.js framework for server-side rendering and Kontent.ai Delivery SDK for content retrieval from Kontent.ai project.
- Node (+npm) installed
- Any JavaScript IDE installed
- Kontent.ai account and subscription
- Clone the project repository.
- Run
npm install
in the terminal. - Run
npm run debug
to start a development server. - The website will open in the browser on
http://localhost:3099
(proxying port3000
).
To start the application correctly, the following environment variables must be specified.
AUTH0_ISSUER_BASE_URL
- Auth0 DomainAUTH0_CLIENT_ID
- Auth0 Client IDAUTH0_LOGOUT_URL
- Relative URL the user is redirected to after logging outAUTH0_DOMAIN
- Auth0 authentication domainBASE_URL
- URL of the current environment (for example, http://localhost:3000) (used for webhooks pooling)KONTENT_PROJECT_ID
- Kontent.ai project ID- One of the following:
KONTENT_PREVIEW_API_KEY
- Kontent.ai preview API key (set this key to retrieve preview content from Kontent.ai)KONTENT_SECURE_API_KEY
- Kontent.ai secured API key (set this key to retrieve published content from Kontent.ai)
Without the following variables, certain features will not work on the website.
ALIAS_URL
- URL specifying there the app is available, can be different frombaseUrl
APP_URL
- URL specifying a Kontent.ai application related to the current environmentAPI2PDF_API_KEY
- API key for the api2PDF serviceAPPINSIGHTS_INSTRUMENTATIONKEY
- Azure Application Insights key (used for application monitoring)COSMOSDB_ENDPOINT
- CosmosDB database endpoint URLCOSMOSDB_KEY
- CosmosDB database authorization keyCOSMOSDB_DATABASE
- CosmosDB database nameCOSMOSDB_CONTAINER_SURVEY
- CosmosDB database - Surveys container nameCOSMOSDB_CONTAINER_CERTIFICATION_ATTEMPT
- CosmosDB database - Certifications container nameCOSMOSDB_CONTAINER_PROFILE
- CosmosDB database - Profile container nameCOSMOSDB_CONTAINER_REPORTING
- CosmosDB database - Reporting (Scorm postback payloads) container nameGITHUB_REDOCLY_ACCESS_TOKEN
- Used for syncing site data to Redocly repositoryGITHUB_REDOCLY_EMAIL
- Used for syncing site data to Redocly repositoryGITHUB_REDOCLY_OWNER
- Used for syncing site data to Redocly repositoryGITHUB_REDOCLY_REPOSITORY
- Used for syncing site data to Redocly repositoryGITHUB_REDOCLY_USERNAME
- Used for syncing site data to Redocly repositoryGITHUB_REDOCLY_BRANCH
- Used for syncing site data to Redocly repositoryGTM_ID
- Google Tag Manager ID (used for analytics)INTERCOM_ID
- Intercom account ID (used for support chat)IS_PRODUCTION
- Flag that determines whether to show a red warning bannerJIRA_ISSUE_TYPE
- Jira Issue index (used for feedback form)JIRA_PROJECT
- Jira Project codename (used for feedback form)JIRA_TOKEN
- Jira API key (used for feedback form)JIRA_USER
- User email for a Jira account (used for feedback form)KONTENT_LANGUAGE_CODENAME_DEFAULT
Default language codename of the Kontent.ai project (used by the Management API)KONTENT_MANAGEMENT_API_KEY
- Kontent.ai Management API key (used for manipulating content in the Kontent.ai project, ie. upserting Licensing page)KONTENT_WEBHOOK_SECRET
- Kontent.ai webhook token (used for common content cache invalidation)LICENSES_ENDPOINT
- Source URL for content of the 3rd party licenses pageLICENSES_CODENAME
- Codename of the content item representing the 3rd party licenses pageNGROK
- NGROK tunnel URL (i.e. https://91a2c81a7f1f.NGROK.io) (useful for api2PDF service local development/testing)RECAPTCHA_V2_SECRET
- Google Recaptcha v2 secret API key (used for forms robot protection)RECAPTCHA_V2_SITE
- Google Recaptcha v2 site API key (used for forms robot protection)SCORM_APP_ID
- Scorm Cloud Application IDSCORM_SECRET_KEY
- Scorm Cloud Secret keySCORM_HOST
- E-learning Scorm Cloud host URLSCORM_USERNAME
- Scorm Cloud postback endpoint auth user nameSCORM_USERPWD
- Scorm Cloud postback endpoint auth user passwordSEARCH_API_KEY
- Algolia search-only API key (used for site search)SEARCH_APP_ID
- Algolia application ID (used for site search)SEARCH_INDEX_NAME
- Index name in Algolia application (used for site search)SENDGRID_API_KEY
- SendGrid API key (used for sending priority alerts via email)SENDGRID_EMAIL_ADDRESS_FROM
- SendGrid sender email address (used for sending priority alerts via email)SENDGRID_EMAIL_ADDRESS_TO
- SendGridSUBSCRIPTION_SERVICE_BEARER
- Subscription service access token for Kontent.ai (used for verifying users' access to e-learning)SUBSCRIPTION_SERVICE_URL
- Subscription service URL (used for verifying users' access to e-learning)SUBSCRIPTION_SERVICE_SERVICE_CHECK_EMAIL
- Email address that has an existing record in the Subscription service
Feel free to open a new issue where you describe your proposed changes, or even create a new pull request from your branch with proposed changes.
All source code is published under MIT license.