yongpengW/NexusStack
54.9
Weak · 21 September 2026
20.7k
lines of production code
C#
primary language
4
measurements over time
What this system is
NexusStack is a .NET microservices template that provides a layered architecture for building distributed applications. It integrates core infrastructure components including a RabbitMQ-based event bus, Redis caching, and Entity Framework Core with audit and soft-delete support. The system also includes utility services for logging, authentication, and HTTP clients, alongside management endpoints for routing, menus, and configuration.
Features
Add Docker and configuration scaffolding for MQ and PlanTask background services
Introduced new project structures for the NexusStack MQ and PlanTask background services, each including a Dockerfile targeting .NET 10.0, a Program.cs entry point, and environment-specific appsettings files (Development, Production, Test/Staging) that configure AgileConfig endpoints and service registration. The MQ service is configured to expose port 8081, while the PlanTask service uses the default port; both services are now containerized and ready for deployment.
BackgroundServices · high confidence
Add Serilog enrichment for IP address, worker ID, and user token
The NexusStack.Serilog module now provides built-in log enrichment. HTTP requests are enriched with the client's IP address (resolving through X-Forwarded-For headers or direct connection), background workers are enriched with their configured WorkerId, and authenticated web users are enriched with their TokenId. These enrichments are applied via the \UseLog\ extension method, which configures Serilog to automatically include these contextual details in all log events.
Domain/NexusStack.Serilog · high confidence
Add custom authentication and UI to Swagger documentation
The Swagger UI now features a custom login dialog that prompts users for a username and password, automatically capturing the returned token in a cookie and attaching it to subsequent requests. This is implemented via new embedded resources (nexusstack-swagger.js and nexusstack-swagger.css) and updated ServiceCollectionExtensions to inject the necessary JavaScript and CSS into the Swagger UI head.
Domain/NexusStack.Swagger · high confidence
Adds infrastructure utilities for HTTP clients, file storage, and data conversion
The Infrastructure layer introduces several new capabilities: a generic static service provider wrapper for accessing configuration options; a typed HTTP client service supporting GET, POST, PUT, and DELETE operations with automatic header and error handling; a factory-based file storage system with an interface and an implementation for Aliyun OSS; and a suite of JSON serialization converters for dates, decimals, longs, and XML. Additionally, the change adds numerous enums for system configuration (e.g., API permission modes, file storage types, and async task states) and base DTOs for auditing.
Infrastructure · high confidence
Initial release of the NexusStack .NET microservices template
The repository is initialized with the core scaffolding for the NexusStack project, including the solution file (NexusStack.sln) that defines the layered architecture (Infrastructure, Domain, Host, BackgroundServices) and all associated C\# projects. Additionally, essential repository metadata and configuration files are added: .gitignore and .dockerignore to manage build artifacts and sensitive data, a CONTRIBUTING.md guide for developers, a LICENSE file (MIT), and the Install-Template.ps1 PowerShell script used to install the .NET template. The README.md is also added to describe the solution's features, such as the YARP API gateway, SignalR, RabbitMQ, and AgileConfig integration.
(repo-wide) · high confidence
Introduce RabbitMQ-based event bus with delayed message and retry support
The NexusStack.RabbitMQ domain now provides a complete event bus implementation, including an \EventPublisher\ and \EventSubscriber\ that manage RabbitMQ connections, channels, and message routing. Users can publish standard events or schedule delayed messages using predefined time tiers (1, 3, 5, 10, 30, 60, and 120 minutes) via a dedicated delayed exchange. The \EventSubscriber\ includes built-in retry logic with configurable maximum attempts and delays, and supports idempotent consumption to prevent duplicate processing. The system also features a \Connection\ class for managing pooled connections and a \ServiceCollectionExtensions\ for automatic discovery and registration of event handlers and code mappers.
Domain/NexusStack.RabbitMQ · high confidence
Introduce Redis caching service with full CRUD and collection operations
The NexusStack.Redis module now provides a complete Redis caching implementation. The \IRedisService\ interface and \RedisService\ class expose methods for standard key-value operations (Ping, Get, Set, Delete) as well as specialized handling for Sets (SAdd, SRem, SMembers, SIsMember) and Hashes (HSet, HGet, HGetAll, HDel, HExists). Additionally, a \ScanAsync\ method supports paginated, keyword-based key scanning. The service is configured via \ServiceCollectionExtensions\ which initializes the \CSRedis\ client using a \RedisOption\ configuration class that reads the connection string and a \UseKeyEventNotify\ flag from the application configuration.
Domain/NexusStack.Redis · high confidence
Introduces EF Core infrastructure with soft-delete, audit, and repository patterns
The Domain/NexusStack.EFCore area now includes the foundational classes for Entity Framework Core integration. This adds support for automatic audit tracking (CreatedAt, UpdatedAt, CreatedBy, UpdatedBy) via the MainSaveChangeInterceptor, which also handles soft deletes by setting IsDeleted to true instead of removing records. The MainContext configures global query filters to exclude soft-deleted entities. A generic repository pattern is introduced, featuring base classes for data access and mapping repositories that utilize Mapster for projection. Additionally, the system enforces restrictive delete behavior on foreign keys and generates SQL comments from entity metadata.
Domain/NexusStack.EFCore · high confidence
New management endpoints for proxy routes, clusters, and system menus
The update introduces new controllers for managing proxy routes and clusters in the Gateway service, allowing users to create, update, and delete routing and cluster configurations. Additionally, the WebAPI service gains new endpoints for managing system menus, including tree structures, selectors, and resource binding, as well as controllers for asynchronous tasks, global settings, operation logs, roles, and open app configurations.
Host · high confidence
Behavioural changes
Introduce token-based authentication and RBAC permissions
The core domain now supports a new token-based authentication mechanism, including dedicated handlers for standard HTTP requests and SignalR connections, alongside a redesigned RBAC system that manages menu and resource permissions. This change introduces new DTOs for open API configurations, operation logs, and menu trees, while also providing a base controller class that simplifies access to the current user and mapping services.
Domain/NexusStack.Core · high confidence
Updated database initialization script with new and modified tables
The database initialization script (InitDatabase.sql) has been updated to include the schema for the 'AsyncTask' table, which tracks asynchronous task states, errors, and retry counts. The script also retains the definitions for existing tables such as 'ApiResource', 'AppConfig', 'AppEventConfig', 'AppNotificationConfig', and 'AppWebhookConfig'. This change ensures the database schema is synchronized with the current application data model.
SqlMigration · high confidence
Dependencies
Upgrade to .NET 10 and update core libraries
The solution has been upgraded to target .NET 10.0 across all projects. Key library updates include Mapster 10.0.10 (replacing AutoMapper), Serilog 4.3.1, Microsoft.EntityFrameworkCore 10.0.9, and Swashbuckle 10.2.3. The template project has also been added to the solution.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 56 → 55 (-0.8)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 58 → 56 (-2.1)
- Architecture 77 → 77 (+0.0)
- Maturity 59 → 59 (+0.2)
- Readiness 47 → 45 (-1.5)
- Security 70 → 76 (+5.8)
- Event-Driven 100 → 100 (+0.0)
Resolved (36)
- Bounded contexts not declared
- Change coupling: EventPublisher.cs ↔ EventSubscriber.cs (Domain/NexusStack.RabbitMQ/EventPublisher.cs)
- Duplicated block (14 lines × 2) (Domain/NexusStack.Core/Services/SystemManagement/RegionService.cs)
- Duplicated block (14 lines × 2) (Infrastructure/FileStroage/AliyunFileStorage.cs)
- Duplicated block (23 lines × 2) (Domain/NexusStack.Core/Authentication/RequestAuthenticationSignalRTokenHandler.cs)
- Duplicated block (8 lines × 2) (Domain/NexusStack.RabbitMQ/ServiceCollectionExtensions.cs)
- Duplicated block (8 lines × 2) (Host/NexusStack.WebAPI/Controllers/TokenController.cs)
- Duplicated block (9 lines × 2) (Infrastructure/Client/HttpClientService.cs)
- High CVE: System.Security.Cryptography.Xml 10.0.9
- High CVE: System.Security.Cryptography.Xml 10.0.9
- High CVE: System.Security.Cryptography.Xml 10.0.9
- High CVE: System.Security.Cryptography.Xml 10.0.9
- High CVE: System.Security.Cryptography.Xml 10.0.9
- Inconsistent naming for object storage identifiers. 'bucket' and 'key' are used, whereas 'bucket' and 'name' (or 'fileName') would be more consistent with standard object storage terminology (Bucket and Key/Name).
- Inconsistent naming for user profile image. Both the DTO and Entity use 'Avatar', which is consistent, but the property name 'Avatar' is used in both, so this is actually consistent. However, looking at 'NexusStack.Core.Dtos.Users.UserDto.HasPassword' vs 'NexusStack.Core.Dtos.Users.UserDto.Mobile', the naming style is consistent. Let's look for actual inconsistencies.
- LLM evaluation failed
- LLM evaluation failed
- Medium IaC: CKV_DOCKER_3 (BackgroundServices/NexusStack.MQService/Dockerfile)
- Medium IaC: CKV_DOCKER_3 (BackgroundServices/NexusStack.PlanTaskService/Dockerfile)
- Medium IaC: CKV_DOCKER_3 (Host/NexusStack.Gateway/Dockerfile)
- …and 16 more
New (55)
- (anonymous) (cognitive 28) (Domain/NexusStack.Swagger/Resources/nexusstack-swagger.js)
- (anonymous) (cyclomatic 26) (Domain/NexusStack.Swagger/Resources/nexusstack-swagger.js)
- CommentedOutCode (Host/NexusStack.WebAPI/Controllers/RegionController.cs)
- Documentation: no contributor guidance (README.md)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (12 lines × 2) (Domain/NexusStack.Excel/Export/EPPlusExtensions.cs)
- Duplicated block (13 lines × 2) (Infrastructure/Client/HttpClientService.cs)
- Duplicated block (14 lines × 2) (Domain/NexusStack.Excel/Export/EPPlusExtensions.cs)
- Duplicated block (14–16 lines × 3) (Domain/NexusStack.Core/Services/SystemManagement/MenuService.cs)
- Duplicated block (15 lines × 2) (Domain/NexusStack.Excel/Export/EPPlusExtensions.cs)
- Duplicated block (16–17 lines × 3) (Infrastructure/FileStroage/AliyunFileStorage.cs)
- Duplicated block (18 lines × 2) (Domain/NexusStack.Excel/Import/ExcelDataRow.cs)
- Duplicated block (23 lines × 2) (Domain/NexusStack.Core/Authentication/RequestAuthenticationSignalRTokenHandler.cs)
- Duplicated block (23 lines × 2) (Domain/NexusStack.Excel/Export/EPPlusExtensions.cs)
- Duplicated block (30 lines × 3) (Domain/NexusStack.EFCore/Repository/Mapping/MappingRepository.cs)
- Duplicated block (36–40 lines × 2) (Domain/NexusStack.Core/Services/SystemManagement/MenuService.cs)
- Duplicated block (38 lines × 2) (Domain/NexusStack.Core/Dtos/ApiResourceDto.cs)
- Duplicated block (48 lines × 2) (Host/NexusStack.WebAPI/Controllers/OperationLogController.cs)
- Duplicated block (49 lines × 2) (Domain/NexusStack.Core/Dtos/Menus/MenuDto.cs)
- …and 35 more
API surface
- Unchanged — 57 HTTP endpoints
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
yongpengW/NexusStack was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit b61d616f73effc569ebda70318019c25937cdfbe — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-fa71c66cabd8.