# Business Overview ## Business Context Diagram ```mermaid graph TD subgraph Platform["SlpModularCms Platform"] Identity["Identity Module\n(Auth + Users)"] CMS["CMS Module\n(Content Mgmt)"] Availability["Availability Module\n(System Status)"] Core["Core / Shell\n(Domain entities, DbContext, Module I/F)"] end Identity --> Core CMS --> Core Availability --> Core Platform --> AdminFrontend["Admin Frontend\n(React SPA)"] Platform --> ExternalClients["External Clients\n(API consumers)"] style Identity fill:#4CAF50,stroke:#2E7D32,color:#fff style CMS fill:#4CAF50,stroke:#2E7D32,color:#fff style Availability fill:#4CAF50,stroke:#2E7D32,color:#fff style Core fill:#FFC107,stroke:#F57F17,color:#000 style AdminFrontend fill:#2196F3,stroke:#0D47A1,color:#fff style ExternalClients fill:#9E9E9E,stroke:#424242,color:#fff ``` ## Business Description - **Business Description**: SlpModularCms is a modular Content Management System (CMS) platform. It provides a REST API backend for managing CMS content, users, and system availability. The platform uses role-based access control (Owner, Admin, User) and supports a modular plugin architecture so that features can be added as independent modules. - **Business Transactions**: - **User Authentication**: Login with email/password, receive JWT access + refresh token pair; refresh tokens for continued sessions; revoke tokens on logout. - **System Initialization**: First-time setup — create initial Owner account before normal operations can begin. - **User Invitation**: Admins and Owners invite new users by email; new users complete their account setup via an invitation link. - **System Availability Management**: Owners can update the system availability status (Available / Maintenance / Unavailable); anyone can query current status. - **CMS Content Management**: (Planned — module structure is in place but CMS-specific content modules are not yet implemented.) - **Business Dictionary**: - **Owner**: Highest-privilege role; can manage users, modules, and system availability. - **Admin**: Can manage users and CMS content within their scope. - **User**: Standard access; can use CMS features but cannot manage system settings. - **Module**: An independently deployable feature unit that integrates into the CMS shell. - **Invitation**: A time-limited token sent to a new user allowing them to create their account. - **Availability Status**: Available | Maintenance | Unavailable — represents the operational state of the system. ## Component Level Business Descriptions ### SlpModularCms.Api - **Purpose**: ASP.NET Core Web API host — the entry point for all HTTP requests. - **Responsibilities**: Bootstraps the application, registers modules, configures middleware (auth, CORS, Swagger), exposes REST endpoints. ### SlpModularCms.Core - **Purpose**: Shared domain core — entities, DbContext, interfaces, services, and migrations. - **Responsibilities**: Defines domain entities (ApplicationUser, ApplicationRole, Invitation, RefreshToken, GlobalAvailabilityState), persistence (EF Core + SQL Server), and shared service contracts. ### SlpModularCms.Modules.Identity - **Purpose**: Authentication and user management module. - **Responsibilities**: Implements AuthController (login/refresh/revoke), SetupController (initial owner creation), UsersController (invite, complete-setup, validate-invitation). ### SlpModularCms.Modules.Availability - **Purpose**: System availability / health status module. - **Responsibilities**: Implements AvailabilityController (get status, update status), caches status in-memory with circuit breaker, persists status changes to the database. ### SlpModularCms.Core.Tests - **Purpose**: Unit tests for the Core layer. - **Responsibilities**: Tests for exception classes, invitation service logic, identity services. ### SlpModularCms.Modules.Availability.Tests - **Purpose**: Unit/integration tests for the Availability module. - **Responsibilities**: Tests for availability service logic and controller behavior.