Sites: the API knows each tenant's public origin and route map, instead of one Feeds config per deployment
- Dominant language
- C#
- Stars
- 6
- Forks
- 7
- Avg merge
- 4h 42m
- Merged PRs (30d)
- 307
Description
The feed and the sitemap build links from host configuration: `Feeds:SiteUrl`, `Feeds:Paths:{type}` and `Feeds:Titles:{type}` (`barakoCMS/Features/Public/FeedEndpoint.cs:58-67`, `barakoCMS/Features/Public/SitemapEndpoint.cs:47-72`). A deployment has one set of those, so every tenant's feed links to the same site. `Tenant.Domains` (`barakoCMS/Models/Tenant.cs:46`) knows where a tenant's API answers, but nothing records the tenant's public site address or the path an entry of a type lives at. barakoPress built its own feed for that reason.
### Why it is too specific
It works for one site per deployment. An agency hosting a bakery and a clinic on one API gets both feeds pointing at whichever `Feeds:SiteUrl` was set. Every feature that writes a link hits the same gap: action links in emails (#840), newsletter confirm links (#846), share links, canonical URLs and structured data (#567), and links in email templates.
### The general concept
Per tenant, the API stores the public origin and a route map: a path template per type, plus the page tree for pages. Feed, sitemap, email templates, action links and structured data all call one resolver, entry in and absolute public URL out. The route field role in #887 feeds the same map.
### Where it lives
Core: tenant or site data, and the public feed and sitemap. The renderer reads the same map instead of keeping its own.
### Compatibility
Released config keys. `Feeds:SiteUrl`, `Feeds:Paths:{type}` and `Feeds:Titles:{type}` stay as the fallback when a tenant sets nothing, so a single-site deployment is unchanged. Additive on the HTTP surface.
### Done when
- Two tenants with different origins get feeds linking to their own origin, with a test that fails before the change.
- A deployment with only `Feeds:SiteUrl` set produces the same feed as today.
- Feed, sitemap and at least one email or link consumer build entry URLs through the one resolver.
Part of the decision on the API owning the site model, linked from the umbrella issue.
Found in the architecture sweep of 15 September 2026.
Contributor guide
Research direction
Start with Tenant.cs:46 and the configuration and link-building entry points in FeedEndpoint.cs:58-67 and SitemapEndpoint.cs:47-72. Trace how tenant domains and the Feeds fallback are currently used, then identify the email or link consumer mentioned in the issue. Done means tenant-specific feed origins work, the existing fallback remains unchanged, and feed, sitemap, and one additional consumer use the shared URL resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, backend, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100