Skip to content

OnTopicCMS/OnTopic-Library

Repository files navigation

OnTopic Library

The OnTopic library is a .NET Core-based content management system (CMS) designed around structured schemas ("Content Types") and optimized to simplify team-based workflows with distinct roles for content owners, backend developers, and graphic producers.

OnTopic package in NuGet.org Build Status NuGet Deployment Status

Roles

The OnTopic library acknowledges that the roles of developers, designers, and content owners are usually compartmentalized and, thus, optimizes for the needs of each.

  • Content owners have access to an editor that focuses exclusively on exposing structured data; this includes support for custom content types (e.g., "Job Posting", "Blog Post", &c.)
  • Backend developers have access to data repositories, services, and a rich entity model in C# for consuming the structured data and implementing any business logic via code.
  • Frontend developers have access to light-weight views based on purpose-built view models, thus allowing them to focus exclusively on presentation concerns, without any platform-specific knowledge.

This is contrasted to most traditional CMSs, which attempt to coordinate all of these via an editor by exposing design responsibilities (via themes, templates, and layouts) as well as development responsibilities (via plugins or components). This works well for a small project without distinct design or development resources, but introduces a lot of complexity for more mature teams with well-established roles.

Multi-Device Optimized

In addition, OnTopic is optimized for multi-client/multi-device scenarios since the content editor focuses exclusively on structured data. This allows entirely distinct presentation layers to be established without the CMS attempting to influence or determing design decisions via e.g. per-page layout. For instance, the same content can be accessed by an iOS app, a website, and even a web-based API for third-party consumption. By contrast, most CMSs are designed for one client only: a website (which may be mobile-friendly via responsive templates.)

Extensible

Fundamentally, OnTopic is based on structured schemas ("Content Types") which can be modified via the editor itself. This allows new data structures to be introduced without needing to modify the database or creating extensive plugins. So, for example, if a site includes job postings, it might create a JobPosting content type that describes the structure of a job posting, such as job title, job description, job requirements, &c. By contrast, some CMSs—such as WordPress—try to fit all items into a single data model—such as a blog post—or require extensive customizations of database objects and intermediate queries in order to extend the data model. OnTopic is designed with extensibility in mind, so updates to the data model are comparatively trivial to implement.

Library

Metapackage

Domain Layer

  • OnTopic.Topics: Core domain model including the Topic entity and service abstractions such as ITopicRepository.

Data Access Layer

Note: Additional data access layers can be created by implementing the ITopicRepository interface.

Presentation Layer

  • OnTopic.AspNetCore.Mvc: ASP.NET Core implementation, including a default TopicController, allowing templates to be created using *.cshtml pages and view components. Supports both ASP.NET Core 3.x and ASP.NET Core 5.x.
  • OnTopic.ViewModels: Standard view models using C# 9 records for exposing factory-default schemas of shared content types. These can be extended, overwritten, or ignored entirely by the presentation layer implementation; they are provided for convenience.

Tests

We maintain 99+% coverage on all core libraries via a combination of unit tests (for e.g. OnTopic) and integration tests (for e.g. OnTopic.AspNetCore.Mvc).

Note: The one gap in our testing is the OnTopic.Data.Sql library, which doesn't currently have integration tests. That said, the underlying stored procedures it calls into are covered by the SSDT tests. Additionally, the extension methods it relies on, which contain most of the business logic, are well covered.

Editor

  • OnTopic.Editor.AspNetCore: ASP.NET Core implementation of the editor interface. Supports both ASP.NET Core 3.x and ASP.NET Core 5.x.
  • OnTopic.Data.Transfer: .NET Standard library for serializing and deserializing Topic entities into a data interchange format which can be used to import or export topic graphs via JSON.

Credits

OnTopic is owned and maintained by Ignia.