Synergy.Admin
1.1.3
dotnet add package Synergy.Admin --version 1.1.3
NuGet\Install-Package Synergy.Admin -Version 1.1.3
<PackageReference Include="Synergy.Admin" Version="1.1.3" />
<PackageVersion Include="Synergy.Admin" Version="1.1.3" />
<PackageReference Include="Synergy.Admin" />
paket add Synergy.Admin --version 1.1.3
#r "nuget: Synergy.Admin, 1.1.3"
#:package Synergy.Admin@1.1.3
#addin nuget:?package=Synergy.Admin&version=1.1.3
#tool nuget:?package=Synergy.Admin&version=1.1.3
Synergy.Admin
A lightweight .NET library for Admin management (Modules, Menus, and Pages) using DDD, Event Sourcing with Marten DB, and Kafka messaging.
Features
- Module Management: Create, update, delete, and query modules
- Menu Management: Create, update, delete, and query menus with module associations
- Page Management: Create, update, delete, and query pages
- Event Sourcing: Full event sourcing with Marten DB
- Kafka Integration: Optional Kafka messaging for distributed systems
- Auto-Configuration: Zero changes required to your Program.cs
Installation
dotnet add package Synergy.Admin
Configuration
The package automatically configures itself using your project's appsettings.json. No changes to Program.cs are required!
Required Configuration
Add the following to your appsettings.json:
{
"ConnectionStrings": {
"DefaultConnection": "Host=localhost;Port=5432;Database=mydb;Username=postgres;Password=yourpassword"
},
"Kafka": {
"BootstrapServers": "localhost:9092"
}
}
Optional: Extended Configuration
For more control, you can use the SynergyAdmin section:
{
"SynergyAdmin": {
"ConnectionString": "Host=localhost;Port=5432;Database=mydb;Username=postgres;Password=yourpassword",
"EnableKafka": true,
"Kafka": {
"BootstrapServers": "localhost:9092"
},
"EnableKeycloak": false,
"Keycloak": {
"BaseUrl": "https://your-keycloak-server/",
"Realm": "your-realm",
"ClientId": "your-client-id",
"ClientSecret": "your-client-secret"
}
}
}
Configuration Options
| Option | Description | Default |
|---|---|---|
ConnectionString |
PostgreSQL connection string | Falls back to ConnectionStrings:DefaultConnection |
EnableKafka |
Enable/disable Kafka messaging | true |
Kafka:BootstrapServers |
Kafka server address | Falls back to Kafka:BootstrapServers |
EnableKeycloak |
Enable/disable Keycloak authentication | false |
How It Works
The package uses ASP.NET Core's IHostingStartup feature to automatically configure services when your application starts. This means:
- ✅ Your
appsettings.jsonconfiguration is used - ✅ No modifications to
Program.csrequired - ✅ Controllers are automatically registered
- ✅ MediatR handlers are automatically discovered
- ✅ Marten DB projections are configured
- ✅ Kafka producers/consumers are set up (if enabled)
API Endpoints
Once installed, the following endpoints are available:
Modules
POST /api/Module/Create- Create a new modulePUT /api/Module/Update- Update an existing moduleDELETE /api/Module/Delete- Delete a moduleGET /api/Module/GetSingle- Get a single module by IDGET /api/Module/GetList- Get list of modules
Menus
POST /api/Menu/Create- Create a new menuPUT /api/Menu/Update- Update an existing menuDELETE /api/Menu/Delete- Delete a menuGET /api/Menu/GetSingle- Get a single menu by IDGET /api/Menu/GetList- Get list of menus
Pages
POST /api/Pages/Create- Create a new pagePUT /api/Pages/Update- Update an existing pageDELETE /api/Pages/Delete- Delete a pageGET /api/Pages/GetSingle- Get a single page by IDGET /api/Pages/GetList- Get list of pages
Manual Configuration (Optional)
If you prefer to manually configure the services (instead of auto-configuration), you can disable the hosting startup and call the extension method directly:
1. Disable Auto-Configuration
Set the environment variable:
ASPNETCORE_PREVENTHOSTINGSTARTUP=true
Or in launchSettings.json:
{
"profiles": {
"YourProject": {
"environmentVariables": {
"ASPNETCORE_PREVENTHOSTINGSTARTUP": "true"
}
}
}
}
2. Manual Setup in Program.cs
using Synergy.Admin.Infrastructure.Configuration;
var builder = WebApplication.CreateBuilder(args);
// Add Synergy Admin services manually
builder.Services.AddSynergyAdmin(builder.Configuration);
// ... rest of your configuration
Requirements
- .NET 8.0 or later
- PostgreSQL database
- Kafka (optional, for messaging)
Dependencies
- Marten (Event Sourcing & Document DB)
- MassTransit (Messaging)
- MediatR (CQRS)
- FluentValidation
- Serilog (Logging)
License
Copyright © 2025 Synergy Team
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- FluentValidation.AspNetCore (>= 11.3.0)
- MediatR (>= 12.1.1)
- Microsoft.AspNetCore.OpenApi (>= 8.0.0)
- Serilog.AspNetCore (>= 8.0.0)
- Swashbuckle.AspNetCore (>= 6.5.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.3 | 275 | 12/14/2025 |
| 1.1.2 | 123 | 12/12/2025 |
| 1.1.1 | 441 | 12/10/2025 |
| 1.1.0 | 427 | 12/10/2025 |
| 1.0.9 | 434 | 12/10/2025 |
| 1.0.8 | 429 | 12/10/2025 |
| 1.0.7 | 358 | 12/8/2025 |
| 1.0.6 | 347 | 12/8/2025 |
| 1.0.5 | 297 | 12/7/2025 |
| 1.0.4 | 220 | 12/7/2025 |
| 1.0.3 | 111 | 12/6/2025 |
| 1.0.2 | 111 | 12/6/2025 |
| 1.0.1 | 115 | 12/6/2025 |
| 1.0.0 | 122 | 12/6/2025 |