DBAdminPanel 0.0.3-alpha
dotnet add package DBAdminPanel --version 0.0.3-alpha
NuGet\Install-Package DBAdminPanel -Version 0.0.3-alpha
<PackageReference Include="DBAdminPanel" Version="0.0.3-alpha" />
<PackageVersion Include="DBAdminPanel" Version="0.0.3-alpha" />
<PackageReference Include="DBAdminPanel" />
paket add DBAdminPanel --version 0.0.3-alpha
#r "nuget: DBAdminPanel, 0.0.3-alpha"
#:package DBAdminPanel@0.0.3-alpha
#addin nuget:?package=DBAdminPanel&version=0.0.3-alpha&prerelease
#tool nuget:?package=DBAdminPanel&version=0.0.3-alpha&prerelease
DBAdminPanel
<div align="center"> <img src="logo.svg" alt="DBAdminPanel Logo" width="128" height="128">
A .NET source generator that automatically creates a complete MVC admin panel for Entity Framework Core models. </div>
π Features
- β¨ Automatic CRUD Generation: Generates full Create, Read, Update, Delete operations for all entities
- π¨ Modern Angular UI: Beautiful, responsive admin panel built with Angular 19 and Material Design
- π Smart Entity Detection: Automatically scans your
DbContextand generates controllers for all entities - π Dashboard: Central dashboard to access all entity management pages
- π RESTful API: Full REST API endpoints for all CRUD operations
- π Metadata API: Automatic metadata generation for entity properties, relationships, and validation
- πΊοΈ Entity Relationship Diagrams: Visual representation of your database schema using Mermaid
- β‘ Source Generator: Zero runtime overhead - all code generated at compile time
- π― Type-Safe: Fully typed with IntelliSense support
- π Extensible: Easy to customize and extend
π¦ Installation
Install the package via NuGet Package Manager:
dotnet add package DBAdminPanel
Or via Package Manager Console:
Install-Package DBAdminPanel
Or add directly to your .csproj:
<ItemGroup>
<PackageReference Include="DBAdminPanel" Version="1.0.0" />
</ItemGroup>
π― Quick Start
1. Add the Package
Add the DBAdminPanel NuGet package to your ASP.NET Core project that contains your DbContext.
2. Configure Services
In your Program.cs, add the DBAdminPanel services:
using DBAdminPanel;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
// Add your DbContext
builder.Services.AddDbContext<YourDbContext>(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection")));
// Add DBAdminPanel
builder.Services.AddDBAdminPanel();
var app = builder.Build();
// Configure the HTTP request pipeline
app.UseRouting();
app.UseAuthorization();
// Use DBAdminPanel (maps routes and static files)
app.UseDBAdminPanel();
app.MapControllers();
app.Run();
3. Mark Your DbContext
The source generator automatically detects DbContext classes. No additional attributes needed! Just ensure your DbContext is accessible:
public class BlogDbContext : DbContext
{
public BlogDbContext(DbContextOptions<BlogDbContext> options) : base(options) { }
public DbSet<BlogPost> BlogPosts { get; set; }
public DbSet<Category> Categories { get; set; }
}
4. Access the Admin Panel
Once configured, navigate to /DBAdminPanel to access the dashboard, which lists all entities in your DbContext.
π Usage
Entity Management
Individual entity management pages are available at:
/DBAdminPanel- Dashboard with all entities/DBAdminPanel/{EntityName}- List all entities (with pagination, sorting, filtering)/DBAdminPanel/{EntityName}/Create- Create new entity/DBAdminPanel/{EntityName}/Edit/{id}- Edit entity/DBAdminPanel/{EntityName}/Details/{id}- View entity details/DBAdminPanel/{EntityName}/Delete/{id}- Delete entity
API Endpoints
The source generator also creates REST API endpoints:
GET /api/DBAdminPanel/{EntityName}- Get all entities (with pagination)GET /api/DBAdminPanel/{EntityName}/{id}- Get entity by IDPOST /api/DBAdminPanel/{EntityName}- Create entityPUT /api/DBAdminPanel/{EntityName}/{id}- Update entityDELETE /api/DBAdminPanel/{EntityName}/{id}- Delete entityGET /api/DBAdminPanel/{EntityName}/metadata- Get entity metadata
Metadata API
Get detailed metadata about your entities:
GET /api/DBAdminPanel/{EntityName}/metadata
Returns information about:
- Property types and names
- Required fields
- Navigation properties
- Foreign key relationships
- Display names and descriptions
Entity Relationship Diagrams
View visual diagrams of your database schema:
GET /DBAdminPanel/diagram/{EntityName}
Diagrams are generated using Mermaid and show:
- Entity relationships
- Foreign key connections
- Property types
ποΈ How It Works
The source generator:
- Scans your project for classes that inherit from
DbContext - Identifies all
DbSet<T>properties - Analyzes entity properties, relationships, and keys
- Generates MVC controllers for each entity with full CRUD operations
- Creates API endpoints for programmatic access
- Builds metadata classes for UI generation
- Provides service registration extensions
All generated code is placed in the DBAdminPanel.Generated namespace and is available at compile time.
π§ Configuration
Custom Route Prefix
By default, all routes are prefixed with /DBAdminPanel. You can customize this in your Program.cs:
app.UseDBAdminPanel(); // Uses default /DBAdminPanel prefix
Multiple DbContext Support
DBAdminPanel automatically detects and generates controllers for all DbContext classes in your project:
// All DbContexts are automatically detected
builder.Services.AddDbContext<BlogDbContext>(...);
builder.Services.AddDbContext<UserDbContext>(...);
builder.Services.AddDbContext<ProductDbContext>(...);
// All entities from all contexts appear in the dashboard
builder.Services.AddDBAdminPanel();
Entity Key Detection
The source generator automatically detects primary keys using:
- Properties named
Id - Properties named
{EntityName}Id - Properties with
[Key]attribute - Composite keys (multiple properties with
[Key]attribute)
π Requirements
- .NET 8.0, .NET 9.0, or .NET 10.0
- Entity Framework Core 8.0+ (matching your .NET version)
- ASP.NET Core MVC (included in .NET)
- Node.js 20.x (only required for building the package, not for using it)
π¨ UI Features
The Angular-based admin panel includes:
- π± Responsive Design: Works on desktop, tablet, and mobile devices
- π Advanced Filtering: Filter entities by any property
- π Sorting: Sort by any column
- π Pagination: Efficient pagination for large datasets
- β¨ Material Design: Modern UI using Angular Material
- π― Form Validation: Client-side and server-side validation
- π Real-time Updates: Instant feedback on operations
- π Internationalization Ready: Easy to localize
π§ͺ Sample Application
See the sample application for a complete working example with:
- Multiple
DbContextclasses - Various entity types
- PostgreSQL integration
- .NET Aspire setup
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
π Documentation
π¬ Support
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Join our discussions
π Acknowledgments
- Built with .NET Source Generators
- UI powered by Angular and Angular Material
- Diagrams generated with Mermaid
<div align="center"> Made with β€οΈ by the DBAdminPanel team
β Star us on GitHub | π¦ NuGet Package </div>
| 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 is compatible. 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 is compatible. 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. |
-
net10.0
- Microsoft.EntityFrameworkCore (>= 10.0.0)
-
net8.0
- Microsoft.EntityFrameworkCore (>= 8.0.0)
-
net9.0
- Microsoft.EntityFrameworkCore (>= 9.0.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 |
|---|---|---|
| 0.0.3-alpha | 61 | 1/8/2026 |
| 0.0.2-alpha | 57 | 1/8/2026 |
| 0.0.1-alpha | 60 | 1/8/2026 |