QMS.Storage.CosmosDB

Package Description


Keywords
cms, csharp, asp-net-core, jsonschema, headless-cms, blob-storage, cosmosdb, sia-skynet
License
MIT
Install
Install-Package QMS.Storage.CosmosDB -Version 0.0.2-CI-20191105-122617

Documentation

GitHub Actions status | Q42/QMS4

QMS4

Open source Q42 CMS
Developer friendly, headless and modular CMS based on JsonSchema standard
Runs on ASP.Net Core 3.0

Features

  • Headless CMS
  • Support for multiple datastore plugins (CosmosDB, Azure Storage (Blob / Tables))
  • JsonSchema used to describe entities
  • View and edit entities
  • Paging and ordering in list view
  • Support for entities in multiple languages
  • Upload images and other assets
  • Optional user login and admin module
  • Generate JsonSchema from C# Models
  • Easy installation using NuGet packages

Installation Instructions

Install QMS.Core and QMS.Storage.CosmosDB from NuGet

Optional: QMS.Storage.AzureStorage

Edit Startup.cs and add the following lines to ConfigureServices

services.UseQms(Configuration)
  .ConfigureAzureStorage(() => new StorageConfiguration() {  ReadCmsItems = true, ReadFiles = true });

Modules

QMS4 is a modular CMS and different modules are available:

CosmosDB Data Storage

The CosmosDB module stores CmsItems to Azure CosmosDB. This module does not support storing file data. You can use the Azure Storage module for file data.

services.UseQms(Configuration)
  .ConfigureCosmosDB(() => new StorageConfiguration() { ReadCmsItems = true })
  .ConfigureAzureStorage(() => new StorageConfiguration() {  ReadFiles = true }); //Optional if you need file storage.

Configuration:

"CosmosConfig": {
  "Endpoint": "https://localhost:8081",
  "Key": "CosmosDB-key"
}

Azure Blob and Table Data Storage

Stores data in Azure Tables and file data to Azure Blob Storage.

services.UseQms(Configuration)
  .ConfigureAzureStorage(() => new StorageConfiguration() {  ReadCmsItems = true, ReadFiles = true });

Configuration:

"AzureStorageConfig": {
  "StorageAccount": "UseDevelopmentStorage=true", //Azure Storage connectionstring
  "ContainerName": "cms",
  "AssetContainerName": "cms",
  "StorageLocation" : "Tables" //Tables / Blob / Both
}

Authentication

Adds user login and user list to the CMS

Add a reference to QMS.Core.Auth nuget package.

services.UseQms(Configuration)
  .ConfigureQmsAuth()

In the Configure method in Startup.cs add:

app.UseAuthentication();
app.UseMiddleware<QmsAuthenticatationMiddleware>();

See the example project to add a default first user to the user list.

Interceptors

Allows you to modify the data before it's saved.

services.UseQms(Configuration)
   .AddInterceptor<ExampleInterceptor>()

Interceptors need to implement the interface IWriteCmsItemInterceptor

Installation Instructions for Development

Dependencies

JSON Schema Editor https://github.com/json-editor/json-editor

Azure Cosmos DB https://github.com/Azure/azure-cosmos-dotnet-v3

NJsonSchema https://github.com/RicoSuter/NJsonSchema

JavaScript Notifications https://ned.im/noty/

Roadmap

  • Searching in list view

  • Pages and url tree

  • Multiple versions of items (with start and end time)

  • Website SDK / Website usage example

  • Audit Trail (CosmosDB Change Feed / Blob Storage file)

Ideas