NewLife.Cube is a rapid web development platform for “data-driven + fast iteration + deep customization” scenarios. In minutes, an entity class or database table becomes a complete admin UI with permissions, lists, details, CRUD, export and statistics, while standard APIs are exposed for Vue (official front-end) / React / Antd / mobile or third-party systems. The default template has been proven in real projects with a single table of 10 billion rows.
Install NewLife.Cube.Core from NuGet. MIT licensed; you may replace the “NewLife” string for private builds. Works with Visual Studio and the CLI. newlife.snk is public for strong-name consistency.
dotnet add package NewLife.Cube
Template scaffolding
dotnet new install NewLife.Templates
dotnet new cube --name CubeWeb
dotnet new xcode --name Zero.Data
cd CubeWeb
dotnet build
start http://localhost:6080
dotnet run
Minimal example (.NET 8/9 Minimal Hosting)
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddCube(); // registers permissions, menus, entity controller scanning
var app = builder.Build();
app.UseMetronic(app.Environment); // or UseAdminLTE / UseTabler ...
app.UseCube(app.Environment); // routing, static assets and middleware
app.Run();
Open / to sign in, use Swagger for APIs, and call the standard CRUD APIs from any front-end.
Platform support
Item
Coverage
Target frameworks
5 in one package: net6.0, net7.0, net8.0, net9.0, net10.0
18 smoke scenarios for the non-MVC foundation (JIT/AOT); see the badge above for the current count
ASP.NET Core installation
Create an ASP.NET Core Web project in Visual Studio.
Reference NewLife.Cube.Core from NuGet, or build the latest Cube NewLife.CubeNC source.
Set a connection string named Membership in appsettings.json; users, roles, permissions and menus are stored there.
The database type is detected automatically; the default is Data Source=../Data/Membership.db.
Build the project, right-click -> View -> View in Browser to run Cube.
MySQL/SQLite/Oracle/SqlCe drivers are downloaded automatically (x86/x64); change PluginServer in Config/Core.config if needed.
Scripts and styles are downloaded automatically; change PluginServer in Config/Cube.config if needed.
The default login is admin/admin; third-party OAuth such as NewLife also works. The first user becomes administrator and admin is disabled.
When publishing, copy *.dll, appsettings.json, *.deps.json, *.runtimeconfig.json and your own assets.
ASP.NET MVC installation
Create an ASP.NET MVC project in Visual Studio.
Reference NewLife.Cube from NuGet, or build the latest Cube NewLife.Cube source.
Set a connection string named Membership in the <connectionStrings> section of Web.config.
The database type is detected automatically; the default is <add name="Membership" connectionString="Data Source=../Data/Membership.db" providerName="Sqlite"/>.
Build the project, right-click -> View -> View in Browser to run Cube.
MySQL/SQLite/Oracle/SqlCe drivers are downloaded automatically (x86/x64); change PluginServer in Config/Core.config if needed.
Scripts and styles are downloaded automatically; change PluginServer in Config/Cube.config if needed.
The default login is admin/admin; third-party OAuth such as NewLife also works. The first user becomes administrator and admin is disabled.
Installing the Razor Generator Visual Studio extension and setting it as the custom tool for .cshtml files compiles views into the DLL.
Publish and copy the DLLs, configuration and assets.
Main Features
Data-to-UI productivity (9)
Feature
Key Characteristics
EntityController scaffolding
Entity class + controller gives CRUD, statistics, export and permissions immediately; ReadOnlyEntityController covers read-only lists.
Static-constructor configuration
Configure fields, action buttons, related links, statistics and export in a controller static constructor.
Field metadata API
meta (page settings + List / Detail / AddForm / EditForm / Search fields) drives dynamic front-end generation — no hard coding.
Menu tree
/Cube/MenuTree builds multi-level menus from permissions; /Admin/Index/GetMenuTree serves the classic MVC UI.
Standard API response
ApiResponse wraps code / data / page / stat for every endpoint.
Zero deployment
Schema creation and seed data happen automatically on first run, with no manual intervention.
Powerful view engine
A child project can override any parent view at the same path (.cshtml).
Built-in editors
Rich text (Quill) and Markdown (EasyMDE) with image upload and security controls.
Scalar API docs
Scalar UI grouped by area alongside Swagger, for easier online debugging.
Field and UI customization (3)
Feature
Key Characteristics
Field set customization
ListFields.RemoveField / AddListField adjust columns, links and targets per controller.
Change log
LogOnChange = true writes an audit entry for every modification.
Dynamic front-end fields
The front-end fetches /Cube/App/meta for page metadata and field definitions — no hard coding.
public class AppController : EntityController<App, AppModel>
{
static AppController()
{
LogOnChange = true; // change log
ListFields.RemoveField("Secret"); // hide a sensitive column
var log = ListFields.AddListField("Log", "UpdateUserId");
log.DisplayName = "Change log";
log.Url = "/Admin/Log?category=App&linkId={ID}";
log.Target = "_blank";
}
}
API and front-end separation (6)
Endpoint
Purpose
/Auth/Login
Sign in and receive a JWT token (header / cookie / query).
/Cube/MenuTree
Permission-aware menu tree.
/{Area}/{Controller}/meta
Page metadata for list / detail / add form / edit form / search.
Main route + dynamic parameters
Query with paging, sorting and condition composition.
GET {id} / POST / PUT {id} / DELETE {id}
RESTful CRUD sub-resources; batch delete on the base path, plus charts / export / import / attachments.
stat / page
Statistics row and paging information.
Permissions and security (7)
Feature
Key Characteristics
Generic permission management
Users, roles, menus and actions with controller-action granularity.
EntityAuthorize
Login + role + menu action checks on every action.
First user becomes administrator
The built-in admin account is disabled afterwards; admin/admin works for the first sign-in.
Unified identity
External OAuth / SSO / JWT across desktops, web and mobile clients.
Security defense
Built-in threat detection (scanners / injection / honeypots), persistent auto-ban with escalating durations and a security audit trail. Automatic mode bans repeated attackers, temporarily blocks broad attacks and recovers automatically; trusted proxies can be configured or learned to prevent spoofing; observation / blocking modes are switchable.
Production advice
Disable unused third-party logins, enable HTTPS and enforce a strong password policy.
Multi-tenancy switch
Enable or disable multi-tenancy with one switch; tenant menus and fields are hidden when off, and runtime tenant switching is supported.
AI capabilities (4)
Feature
Key Characteristics
AI assistant
A single chat panel in the lower-right corner with page / entity / query context. The global AiController.AiChat endpoint (/Ai/AiChat) plus NAI AiChatService orchestrate session history, the tool loop and SSE streaming events.
Extension point
Entity controllers expose data queries, tool sets and prompt overrides through IEntityAiContext (SearchData / CreateCubeTools / BuildChatSystemPrompt). Tools include get_data_context, get_form_schema, fill_form, get_page_context, get_system_info and run_js.
AI insight
Merged into the assistant; AiInsightHelper remains for data collection (14 sensitive-field blacklists). One-click analysis offers statistics, anomaly detection, trend prediction and actionable advice with deep reasoning, on both MVC and Vue.
Dashboard widgets
Dashboards are composed of configurable widgets (KPI, charts, monitoring) with personalized layouts and /Cube/Widget management.
Front-ends, themes and skins (7)
Feature
Key Characteristics
Multiple front-ends
Vue (official), eight in-repo reference SPA skins and classic Razor coexist; React (Ant Design) is maintained in a separate CubeAntd repository; Blazor is a frozen MVC-theme experiment.
Embedded theme assets
CubeEmbeddedFileProvider ships theme assets inside the package.
Theme registration
Register skins via AddTheme/AddSkin and pick one in UseCube (app.UseMetronic(env) etc.).
Custom themes
Implement IModule like MetronicModule and mount it in the use phase.
View overrides
A .cshtml with the same path in a child project overrides the parent.
Localization
11 runtime languages for API messages, request-level culture detection and an 11-language Vue front-end.
New-generation skins
pnpm workspace with the shared package @newlifex/cube (API / token / types, field metadata -> controls). NewLife.Cube.Vue is the official skin and is published to NuGet with the compiled front-end embedded; React is published from the separate NewLife.Cube.React repository the same way. The other SPA skins live in this repo as reference implementations and are not published — build their web project with pnpm, then reference the .NET project.
Skin project
Framework
UI library
Dev port
NewLife.Cube.NaiveUI
Vue 3
Naive UI
5180
NewLife.Cube.MUI
React 19
MUI 6 (Material)
5181
NewLife.Cube.Shadcn
React 19
Radix UI + Tailwind CSS 4
5182
NewLife.Cube.ArcoVue
Vue 3
Arco Design Vue
5183
NewLife.Cube.Angular
Angular 19
NG-ZORRO
5184
NewLife.Cube.Vuetify
Vue 3
Vuetify 3
5185
NewLife.Cube.Svelte
SvelteKit 2 + Svelte 5
Tailwind CSS 4
5186
NewLife.Cube.TDesign
Vue 3
TDesign
5187
The skins above are reference implementations kept in this repository and are not published to NuGet. NewLife.Cube.Vue (official, full unit and E2E coverage) and NewLife.Cube.React (separate repository) are published as NuGet packages with the front-end embedded; after AddCube + UseCube, Cube auto-detects every referenced skin package and you can switch the active skin via the SpaSkin setting without any extra call.
Modern UI while keeping the override mechanism; multi-framework front-ends (Vue/React/Angular/Svelte + 8 ready-to-use skins); NuGet package brings the default skin; mobile, mini-programs and hybrid apps; enhanced data dashboards.
Core: entity controllers, permissions, menus, field metadata, API.
NewLife.CubeNC
Legacy MVC / Razor compatibility layer.
Classic skins
AdminLTE / Metronic / Metronic8 / Tabler / LayuiAdmin / ElementUI / Blazor (separate packages; feature-frozen — compile-only, no new features and no bug fixes).
New-generation skins
pnpm workspace: NaiveUI / MUI / Shadcn / ArcoVue / Angular / Vuetify / Svelte / TDesign (reference implementations, not published to NuGet).
Tests and verification (WebSmoke starts Kestrel and does one HTTP round-trip on non-x64/arm64 instruction sets).
Core concepts (7)
Concept
Description
EntityController
Configure fields, action buttons, related links, statistics and export in a static constructor.
Field metadata API
meta (page settings + List / Detail / AddForm / EditForm / Search fields) drives dynamic front-end generation.
Menu tree
/Admin/Index/GetMenuTree builds multi-level menus from permissions.
Permission model
User -> role -> menu (action set). The first registered user becomes administrator and admin is disabled.
ApiResponse
Standard response wrapper with code / data / page / stat.
IModule
Startup module that injects services and static assets (themes, Swagger, etc.).
AI assistant
Global AiController.AiChat endpoint (/Ai/AiChat) plus NAI AiChatService orchestration (session history, tool loop, SSE events); entity controllers expose capabilities through IEntityAiContext. AiInsightHelper remains for data collection (14 sensitive-field blacklists).
Common scenarios (5)
Scenario
Typical use
Enterprise / department admin
Internal management backends and SaaS control panels.
IoT operations
Device / point / log / alert management and data export.
Data platform
Rapid publication of standard query APIs.
Identity center
Unified identity and authorization (SSO / OAuth).
Operations support
Orders, configuration, scheduling and release management.
Ecosystem Map
NewLife is a layered ecosystem of independently versioned open-source projects. The map below is shared verbatim by every NewLife repository; each project links to its repository and its primary NuGet package.
Installs the matching .NET runtime automatically when launched from an older host.
—
Badges show the primary package of each project; theme, extension and satellite packages are listed on their NuGet pages.The 30+ packages not listed here (FTP, LoRa, Office extensions, protocol drivers and more) are available under the NewLifeX organization and on newlifex.com. This table is maintained in the NewLife.Core README.
Documentation
Guides
Detailed requirements, feature tracking and architecture live in Doc/ (written in Chinese):
Q: Hide a field? A: In the controller static constructor: ListFields.RemoveField("Field").
Q: Custom statistics? A: Override search logic and fill stat on the returned collection.
Q: Switch themes? A: Reference a theme package and call app.UseXXX(env); the default is configurable in the admin UI.
Q: Where do database drivers come from? A: Downloaded from PluginServer on first run; configurable.
Q: Integrate a custom front-end? A: Use the field metadata API plus the standard CRUD/JWT endpoints.
Contributing
Build and test
Cube builds with the .NET SDK 10 (or the matching SDK for your target framework) and also opens in Visual Studio. The front-end skins use pnpm.
dotnet build NewLife.Cube/NewLife.Cube.csproj -c Release
dotnet test XUnitTest -c Release
End-to-end MVC tests: E2EMvcTest/
NativeAOT smoke: AotSmoke/, CI in .github/workflows/aot.yml
Web smoke: WebSmoke/ starts Kestrel and performs one HTTP round-trip
Release
Push a v-prefixed tag to trigger .github/workflows/publish.yml; the workflow packs NewLife.Cube / NewLife.Cube.Core and publishes them to NuGet.org. Package README is generated from README.md by sync-readme-package.ps1, language switchers by sync-readme-languages.ps1 and metric badges by sync-readme-metrics.ps1; each script supports -Check for CI.
Feedback
Conventions: see .github/copilot-instructions.md.
Issues/PRs: describe the scenario, expectation and reproduction; include data scale for performance topics.
New themes: separate repository + README describing the build.
Prefer the NewLife ecosystem and avoid unnecessary dependencies.
Make sure all TFMs compile before submitting.
Team
Founded in 2002, the NewLife team has spent more than two decades on the .NET and IoT ecosystem, maintains nearly 100 open-source projects (34 of them core to this map), and delivers integrated software and hardware solutions for power, logistics, healthcare, industrial control and internet industries. We live by the motto “learning has no seniority — mastery earns respect”.
Open-source components have been downloaded 6.48M times from NuGet (ecosystem-wide, as of 2026-10).
This project is licensed under MIT; the strong-name certificate newlife.snk is published so you can build and replace assemblies yourself, and the source may be modified and redistributed without attribution.
If this project is helpful to you, welcome to Star it, share it with your team, or provide improvement suggestions via Issue/PR.
NewLife.Cube - Web rapid development and admin framework
🌐 简体中文 | 繁體中文 | Español | Deutsch | 日本語 | Français | Português | Русский | 한국어 | العربية
NewLife.Cube is a rapid web development platform for “data-driven + fast iteration + deep customization” scenarios. In minutes, an entity class or database table becomes a complete admin UI with permissions, lists, details, CRUD, export and statistics, while standard APIs are exposed for Vue (official front-end) / React / Antd / mobile or third-party systems. The default template has been proven in real projects with a single table of 10 billion rows.
Demo: https://cube.newlifex.com
CentOS7 + CDN· SSO center: https://sso.newlifex.comOAuth server· Swagger: https://cube3.newlifex.comCube tutorial: https://newlifex.com/cube · XCode tutorial: https://newlifex.com/xcode · Core library tutorial: https://newlifex.com/core
Contents: Quick Start · Main Features · Ecosystem Map · Documentation · Contributing · Team · License
Quick Start
Install
Install
NewLife.Cube.Corefrom NuGet. MIT licensed; you may replace the “NewLife” string for private builds. Works with Visual Studio and the CLI.newlife.snkis public for strong-name consistency.Template scaffolding
Minimal example (.NET 8/9 Minimal Hosting)
Open
/to sign in, use Swagger for APIs, and call the standard CRUD APIs from any front-end.Platform support
ASP.NET Core installation
ASP.NET Core Webproject in Visual Studio.NewLife.Cube.Corefrom NuGet, or build the latest Cube NewLife.CubeNC source.Membershipinappsettings.json; users, roles, permissions and menus are stored there.Data Source=../Data/Membership.db.PluginServerinConfig/Core.configif needed.PluginServerinConfig/Cube.configif needed.admin/admin; third-party OAuth such as NewLife also works. The first user becomes administrator andadminis disabled.*.dll,appsettings.json,*.deps.json,*.runtimeconfig.jsonand your own assets.ASP.NET MVC installation
ASP.NET MVCproject in Visual Studio.NewLife.Cubefrom NuGet, or build the latest Cube NewLife.Cube source.Membershipin the<connectionStrings>section ofWeb.config.<add name="Membership" connectionString="Data Source=../Data/Membership.db" providerName="Sqlite"/>.PluginServerinConfig/Core.configif needed.PluginServerinConfig/Cube.configif needed.admin/admin; third-party OAuth such as NewLife also works. The first user becomes administrator andadminis disabled..cshtmlfiles compiles views into the DLL.Main Features
Data-to-UI productivity (9)
ReadOnlyEntityControllercovers read-only lists.meta(page settings + List / Detail / AddForm / EditForm / Search fields) drives dynamic front-end generation — no hard coding./Cube/MenuTreebuilds multi-level menus from permissions;/Admin/Index/GetMenuTreeserves the classic MVC UI.ApiResponsewraps code / data / page / stat for every endpoint..cshtml).Field and UI customization (3)
ListFields.RemoveField/AddListFieldadjust columns, links and targets per controller.LogOnChange = truewrites an audit entry for every modification./Cube/App/metafor page metadata and field definitions — no hard coding.API and front-end separation (6)
/Auth/Login/Cube/MenuTree/{Area}/{Controller}/metaGET {id}/POST/PUT {id}/DELETE {id}charts/export/import/attachments.stat/pagePermissions and security (7)
adminaccount is disabled afterwards;admin/adminworks for the first sign-in.AI capabilities (4)
AiController.AiChatendpoint (/Ai/AiChat) plus NAIAiChatServiceorchestrate session history, the tool loop and SSE streaming events.IEntityAiContext(SearchData/CreateCubeTools/BuildChatSystemPrompt). Tools includeget_data_context,get_form_schema,fill_form,get_page_context,get_system_infoandrun_js.AiInsightHelperremains for data collection (14 sensitive-field blacklists). One-click analysis offers statistics, anomaly detection, trend prediction and actionable advice with deep reasoning, on both MVC and Vue./Cube/Widgetmanagement.Front-ends, themes and skins (7)
CubeEmbeddedFileProviderships theme assets inside the package.AddTheme/AddSkinand pick one inUseCube(app.UseMetronic(env)etc.).IModulelikeMetronicModuleand mount it in the use phase..cshtmlwith the same path in a child project overrides the parent.@newlifex/cube(API / token / types, field metadata -> controls).NewLife.Cube.Vueis the official skin and is published to NuGet with the compiled front-end embedded; React is published from the separateNewLife.Cube.Reactrepository the same way. The other SPA skins live in this repo as reference implementations and are not published — build theirwebproject with pnpm, then reference the .NET project.NewLife.Cube.NaiveUINewLife.Cube.MUINewLife.Cube.ShadcnNewLife.Cube.ArcoVueNewLife.Cube.AngularNewLife.Cube.VuetifyNewLife.Cube.SvelteNewLife.Cube.TDesignFront-end workspace conventions:
pnpm build: builds only the shared modules underpackages/; it no longer recurses into every skin.pnpm build:vue,pnpm build:naive,pnpm build:mui,pnpm build:shadcn,pnpm build:arco,pnpm build:angular,pnpm build:vuetify,pnpm build:svelte,pnpm build:tdesign.pnpm dev:xxx.pnpm build:all/pnpm dev:all.web/directory, use its ownpnpm build/pnpm dev.Data and big data (5)
Performance and NativeAOT (4)
Deployment and operations (5)
dotnet publish, then copy the DLLs and configuration.NewLife.Agentfor Windows Service or systemd.Deploying the user center
Bin/SSO, adjustappsettings.json, package the exe/dll/appsettings/runtimeconfig files and deploy.admin/adminor a third-party login; the first user becomes administrator andadminis disabled.Cube generation 3 (5)
NewLife.Cube); MVC stays inNewLife.CubeNC.Front-end repositories:
https://github.com/NewLifeX/NewLife.CubeVue · https://github.com/NewLifeX/NewLife.QuickVue · https://github.com/NewLifeX/NewLife.CubeAntd · https://github.com/NewLifeX/NewLife.CubeBlazor
Live sites: Vue https://vue.newlifex.com, https://quickvue.newlifex.com · Antd https://antd.newlifex.com · Swagger https://cube3.newlifex.com/swagger/index.html
Participation notes:
NewLife.Cube; MVC stays inNewLife.CubeNC.NewLife.CubeAntd).Milestones (excerpt):
NewLife.CubeNewLife.CubeNCEntityController/EntityReadOnlyControllerArchitecture and projects (9)
Core concepts (7)
meta(page settings + List / Detail / AddForm / EditForm / Search fields) drives dynamic front-end generation./Admin/Index/GetMenuTreebuilds multi-level menus from permissions.adminis disabled.AiController.AiChatendpoint (/Ai/AiChat) plus NAIAiChatServiceorchestration (session history, tool loop, SSE events); entity controllers expose capabilities throughIEntityAiContext.AiInsightHelperremains for data collection (14 sensitive-field blacklists).Common scenarios (5)
Ecosystem Map
NewLife is a layered ecosystem of independently versioned open-source projects. The map below is shared verbatim by every NewLife repository; each project links to its repository and its primary NuGet package.
dotnet newproject templates for console, web, API, service, data and IoT projects.Documentation
Guides
Detailed requirements, feature tracking and architecture live in
Doc/(written in Chinese):Tutorials
FAQ
Q: Hide a field?
A: In the controller static constructor:
ListFields.RemoveField("Field").Q: Custom statistics?
A: Override search logic and fill
staton the returned collection.Q: Switch themes?
A: Reference a theme package and call
app.UseXXX(env); the default is configurable in the admin UI.Q: Where do database drivers come from?
A: Downloaded from
PluginServeron first run; configurable.Q: Integrate a custom front-end?
A: Use the field metadata API plus the standard CRUD/JWT endpoints.
Contributing
Build and test
Cube builds with the .NET SDK 10 (or the matching SDK for your target framework) and also opens in Visual Studio. The front-end skins use pnpm.
E2EMvcTest/AotSmoke/, CI in.github/workflows/aot.ymlWebSmoke/starts Kestrel and performs one HTTP round-tripRelease
Push a
v-prefixed tag to trigger.github/workflows/publish.yml; the workflow packsNewLife.Cube/NewLife.Cube.Coreand publishes them to NuGet.org. Package README is generated fromREADME.mdbysync-readme-package.ps1, language switchers bysync-readme-languages.ps1and metric badges bysync-readme-metrics.ps1; each script supports-Checkfor CI.Feedback
.github/copilot-instructions.md.Team
Founded in 2002, the NewLife team has spent more than two decades on the .NET and IoT ecosystem, maintains nearly 100 open-source projects (34 of them core to this map), and delivers integrated software and hardware solutions for power, logistics, healthcare, industrial control and internet industries. We live by the motto “learning has no seniority — mastery earns respect”.
Open-source components have been downloaded 6.48M times from NuGet (ecosystem-wide, as of 2026-10).
Website: https://newlifex.com · Open source organization: https://github.com/NewLifeX
WeChat Official Account: 智能大石头 (scan to follow)
License
This project is licensed under MIT; the strong-name certificate
newlife.snkis published so you can build and replace assemblies yourself, and the source may be modified and redistributed without attribution.