Developer Guide

Getting started

A running site with a page you published yourself, in about five minutes.

Cendia is a .NET CMS you add to an ASP.NET Core app, not a platform you deploy and then build inside. Your site is the host; the CMS is a package it references.

Create a site

dotnet new cendia-starter -n MySite
cd MySite
dotnet run

cendia-starter is the only template, and it is the release object — the supported starting point a release delivers. It is deliberately minimal: one page type, its template, and a content zone. Bare means nothing you have to delete, not nothing that works.

The first run

Migrate() runs on startup in Development, so the first dotnet run creates the schema against the connection string in appsettings.json. On a fresh database /cms leads to the setup wizard, which is where the first account is made.

/ has nothing to render until you publish something. Publish a page from /cms, and / renders it through the template paired with its type.

What the host actually wires up

Three calls, all in Program.cs:

builder.Services.AddDbContext<CmsDbContext>(options =>
    options.UseSqlServer(connectionString));

builder.Services.AddCendia(o =>
    builder.Configuration.GetSection("Cendia").Bind(o));

// ...

app.MapCendia();

AddCendia registers the services and the authoring surface. MapCendia maps the CMS UI at /cms, the delivery and preview APIs, /sitemap.xml, and — when rendering is enabled — the catch-all that turns a page tree into URLs.

Call UseRouting, UseAuthorization and static files before it. MapCendia registers a little middleware of its own, because some of it has to sit at an exact point relative to the routes it maps, and that is an ordering a host should not have to know about or be able to get wrong.

Rendering is a switch

Cendia:EnableRendering decides whether this installation serves pages at all. With it off, / redirects to /cms and the CMS is a headless content API. With it on, / is the site's start page and the editor is still at /cms — it just stops being what the bare hostname answers with.

A headless installation is a supported shape, not a half-configured one.

Where to go next

Content types are C# classes; the editor is built from them. That is the next page, and it is the part of Cendia most worth understanding before you write anything.