Project Structure
Solution architecture, modular layers and middleware pipeline
Project Structure
uTPro follows a clean modular architecture with clear separation of concerns.
Prerequisites
- .NET 10 SDK (10.0.301 or later β pinned in global.json)
- A database engine β PostgreSQL (default), SQL Server, or SQLite
- Visual Studio 2022 (v17.12+) or VS Code with C# Dev Kit
- Node.js (optional, for frontend tooling)
Solution Architecture
uTPro/
βββ Common/
β βββ uTPro.Common/ # Shared models, constants, CMS content types
βββ Extension/
β βββ uTPro.Extension/ # Reusable helpers (HTML sections, script queue, content traversal)
β βββ uTPro.Extension.CurrentSite/ # Per-request site context (culture, domains, navigation)
βββ Foundation/
β βββ uTPro.Foundation/ # Media path scheme
β βββ uTPro.Foundation.Favicon/ # Dynamic favicon from CMS
β βββ uTPro.Foundation.Middleware/ # Request localization, buffering
β βββ uTPro.Foundation.Robots/ # robots.txt generation
β βββ uTPro.Foundation.Sitemap/ # sitemap.xml generation (cached)
βββ Feature/
β βββ uTPro.Feature/ # Feature base (shared partials)
β βββ uTPro.Feature.Dashboard/ # Backoffice dashboard + header app
βββ Project/
β βββ uTPro.Project.Web/ # Main web application
β βββ uTPro.Project.Web.Configure/ # Render controller, error handling, policies
βββ global.json
βββ uTPro.slnOptional feature packages ship as standalone NuGet packages in their own repositories: File Manager, Simple Form Builder, Audit Log, Job Monitor, Auto Translation, and URL Viewer.
Web Project Structure (uTPro.Project.Web)
uTPro.Project.Web/
βββ Controllers/Pages/ # Sitemap, Robots, Favicon controllers
βββ Models/ # View models
βββ Startup/ # Application startup (modular configuration)
β βββ HostingSetup.cs # TMP/TEMP override for multi-site IIS
β βββ UmbracoSetup.cs # Umbraco CMS builder + BlockPreview
β βββ PerformanceSetup.cs # Razor, WebOptimizer, WebMarkupMin, OutputCache
β βββ SecuritySetup.cs # DataProtection, Form/IIS/Kestrel limits
β βββ BlockPreviewSetup.cs # Custom view locations + preview service
β βββ PipelineSetup.cs # Middleware pipeline
βββ Views/
β βββ Partials/common/ # MetaData.cshtml (SEO), HtmlManage.cshtml
β βββ Partials/blockgrid/ # Block grid rendering templates
β βββ uTPro/ # Site-specific views (Layout, Nav, Pages, Components)
β βββ globalLayout.cshtml # Fallback layout
β βββ globalPageError.cshtml # Error page template
βββ wwwroot/
β βββ assets/ # Shared assets (CSS, fonts, images, scripts)
β βββ css/uTPro/ # Site CSS (variables, layout, main, critical)
β βββ scripts/uTPro/ # Site JS (main, util, select-language)
β βββ uploads/ # Media uploads
βββ Program.cs # Entry point (minimal β delegates to Startup/)
βββ appsettings.json # Production configuration
βββ appsettings.Development.json # Development overridesProgram.cs β Clean Entry Point
The application entry point is intentionally minimal. All configuration logic is organized into extension methods in the Startup/ folder:
var setup = HostingSetup.BuildWebApplicationOptions(args);
var builder = WebApplication.CreateBuilder(setup);
builder.ConfigureAppSettings(); // Per-app overlay
builder.ConfigureTempPath(); // Hosting: TMP/TEMP
builder.ConfigureMediaPath(); // Hosting: shared media
builder.ConfigureUmbraco(); // Umbraco CMS
builder.Services.AddPerformanceServices(builder.Environment); // Performance
builder.Services.AddSecurityServices(builder); // Security
builder.Services.AddForwardedHeadersConfig(builder); // Real client IP/scheme
builder.Services.AddRenderingDefaults(); // MVC
builder.Services.AddControllers();
builder.Services.AddBlockPreviewServices(); // Block Preview
var app = builder.Build();
await app.BootUmbracoAsync();
app.ConfigurePipeline(); // Middleware
await app.RunAsync();Each Startup/*.cs file is self-contained and can be modified independently.
Middleware Pipeline Order
Configured in Startup/PipelineSetup.cs:
- Forwarded Headers β rewrites client IP/scheme from X-Forwarded-*
- Browser Cache-Control β stale-while-revalidate for HTML pages
- HTTPS Redirection
- Status Code Pages β UseStatusCodePagesWithReExecute("/error/{0}")
- WebOptimizer β CSS/JS minification (must be before StaticFiles)
- Static Files β immutable 1-year cache for /assets/, /css/, /scripts/; 7-day for /uploads/
- WebMarkupMin β HTML minification + Brotli/GZip compression
- Output Cache β stores rendered responses in memory (120s TTL)
- Cookie Policy
- uTPro Middleware β request localization + selective buffering
- Umbraco Pipeline β BackOffice + Website routing + Security headers
- MapControllers β MVC endpoint routing
Technology Stack
| Component | Version |
|---|---|
| Umbraco CMS | 17.5.3 |
| .NET | 10.0 |
| Umbraco.Community.BlockPreview | 5.4.3 |
| UmbracoSeoVisualizer | 17.0.0 |
| uSync | 17.3.6 |
| LigerShark.WebOptimizer.Core | 3.0.477 |
| WebMarkupMin.AspNetCoreLatest | 2.22.0 |
| Our.Umbraco.PostgreSql | 17.5.0 |