A comprehensive .NET framework providing base components for building multi-tenant applications with Blazor, ASP.NET Core and Keycloak.
Client-side Blazor components and services including:
- Reusable UI components (CrudGrid, CrudForm, DocumentBrowser, etc.)
- Authentication helpers and message handlers
- Document upload services
- Global state management
- Frontend generic CRUD services
Server-side infrastructure for building APIs with:
- Multi-tenant and subject-based authorization with OAuth2
- CRUD command and query patterns
- Keycloak integration
- Document handling endpoints
- Entity base classes with tenant isolation
- JWT authentication helpers
- Database context abstractions
Shared models, DTOs, and interfaces used by both client and server:
- Data Transfer Objects (DTOs)
- Validation attributes
- Shared enums and helpers
- Common interfaces
- Multi-tenancy Support: Built-in tenant isolation at the entity and authorization level
- Authentication & Authorization: Integration with Keycloak for JWT-based auth
- CRUD Operations: Generic commands and queries for standard operations
- Document Management: Upload, storage, and retrieval of documents
- Blazor Components: Ready-to-use UI components for common scenarios
- Type-safe: Strongly typed throughout with C# generics
Install the packages in the relevant inheriting projects (Client, Server, and Shared) via NuGet:
dotnet add package Boxty.ClientBase
dotnet add package Boxty.ServerBase
dotnet add package Boxty.SharedBaseClick here for a demo repository
// Register your modules
var moduleTypes = new List<Type>
{
typeof(AuthModule),
typeof(UserManagementModule)
};
// Register your modules
...
var builder = WebApplication.CreateBuilder(args);
builder.Services.RegisterServices(builder.Configuration, ref moduleTypes, out var registeredModules);
var app = builder.Build();
app.ConfigureServicesAndMapEndpoints(builder.Environment.IsDevelopment() || builder.Environment.IsStaging(), registeredModules);
...// Add your client services
builder.Services.AddScoped<ICrudService<TenantDto>, CrudService<TenantDto>>();
builder.Services.AddScoped<ICrudService<SubjectDto>, CrudService<SubjectDto>>();
builder.Services.AddScoped<ICrudService<TenantDocumentDto>, CrudService<TenantDocumentDto>>();
builder.Services.AddScoped<ICrudService<SubjectDocumentDto>, CrudService<SubjectDocumentDto>>();
builder.Services.AddScoped<ICrudService<TenantNoteDto>, CrudService<TenantNoteDto>>();
builder.Services.AddScoped<ICrudService<SubjectNoteDto>, CrudService<SubjectNoteDto>>();
builder.Services.AddScoped<IDocumentUploadService, DocumentUploadService>();
builder.Services.AddScoped<IAuthHelperService, AuthHelperService>();
builder.Services.AddScoped<ILocalBackupService, LocalBackupService>();
builder.Services.AddScoped<GlobalStateService>();- .NET 8.0 or higher
- ASP.NET Core for server components
- Blazor for client components
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
Mike Samy (mike@boxty.org)