Skip to content
Matus Backor edited this page Nov 25, 2019 · 19 revisions

Kentico Kontent Documentation Wiki

Kentico Kontent Documentation portal is a website that describes Kentico Kontent and provides tutorials for its users. The portal uses Kentico Kontent as a source of its data.

The portal website is server-side rendered and built using NodeJS and its Express framework. The content of the website is stored in Kentico Kontent itself. Additionally, the website is also supported by a backend that provides:

  • Search functionality across the website.
  • Ability to fetch code samples from GitHub repository to Kentico Kontent.
  • Bulk publish and schedule to publish functionality for Kentico Kontent.
  • API Reference generation.

The backend utilizes microservice architecture and its services are built using Microsoft Azure Functions.

Backend Architecture

The portal responds instantly to any change of published content in Kentico Kontent. For this reason, it has a Dispatcher function that receives webhooks from Kentico Kontent. It processes the webhook and then publishes an event to Azure Event Grid topic. The topic is consumed by Tutorial Search, Reference Preprocessor, and Publisher.

Notifier service provides a way to notify about a successful or a failed run of its caller service by sending a message to Microsoft Teams.

Search Functionality

The portal uses Algolia's search as a service solution for its search functionality. When a user searches for a term on the portal, the website communicates directly with Algolia.

The Tutorial Search service is thus responsible for indexing the content of the website's tutorials. After receiving an event from Dispatcher, it fetches the relevant data from Kentico Kontent, splits it into smaller records and saves it to an Azure Blob storage.

API Reference Search search works similarly with the content of the API Reference pages. However, it does not fetch the data directly from Kentico Kontent, but it receives it in a preprocessed format from Reference Preprocessor.

Index Sync then responds to a new blob file created in the blob storage - It reads the saved data records and updates the index on Algolia accordingly.

GitHub Integration

Because the portal contains numerous code samples, it is also integrated with GitHub, where all of the code samples are stored. The code samples are being automatically stored in Kentico Kontent as well thanks to Github Reader and Samples Manager services:

Github Reader reacts to each commit made to the code samples repository. It fetches files affected by the commit from GitHub, and extracts marked code samples. Then, it stores the content of the files to its own local storage and the code samples to an Azure Blob Storage.

Samples Manager responds to a new blob file created in the blob storage. It reads the stored code samples and updates the corresponding content items in Kentico Kontent.

Bulk Publishing / Scheduling to Publish

Finally, the Publisher service simplifies the process of publishing (or scheduling to publish) a non-trivial content item. By reacting to webhooks from Kentico Kontent, it publishes any content item in Kentico Kontent that is in Cascade Publish workflow step, along with all of its linked items and modular content. When an item is in the Scheduled workflow step, the Publisher will set the same step of all of its linked items and modular content as well.

API Reference

Reference Preprocessor listens to events sent by the Dispatcher. After receiving an event, it fetches the data relevant to the API Reference model from Kentico Kontent. Then it transforms the data to a predefined format and saves it to an Azure Blob storage. Afterwards, 3 different services react to the new saved blob:

  • API Reference Search splits the preprocessed API Reference data into records and then saves the records to an Azure Blob storage.
  • OpenAPI Github Writer transforms the preprocessed data into an OpenAPI specification version 3 compliant format. Then, it saves the API specification to a GitHub repository as YAML files.
  • OpenAPI Processor creates HTML files that represent the API Reference pages. In order to do that, it utilizes our forked Redoc package. The HTML files are then saved to an Azure Blob storage. Finally, the Blob Provider provides web server with an up-to-date HTMLs.

Environments

Kentico Kontent Documentation operates on 5 different environments:

1. Live Master

Master branches of all services + live (published) data from Kentico Kontent project. Live website runs in this environment as well.

2. Live Dev

Develop branches of all services + live (published) data from Kentico Kontent project. This environment is used for reviewing new features on the web with live data.

3. Preview Master

Master branch of website + not yet published data from Kentico Kontent project. This environment is used by content writers for previewing changes within content before publishing.

4. Preview Dev

Develop branch of website + not yet published data from Kentico Kontent project. This environment is used by content writers for reviewing new features new features on the web with testing (not published) data.

5. Live Dev Tests

Develop branch of website deployed to a seperate web app + Kentico Kontent test project and develop branches of all services (shared with Live Dev environment). This environment is used for integration tests.