Skip to content

About

魔方React皮肤,Ant Design 6

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

NewLife.Cube.React - React skin for NewLife.Cube

GitHub top language GitHub License Nuget Nuget (with prereleases)

🌐 简体中文 | 繁體中文 | Español | Deutsch | 日本語 | Français | Português | Русский | 한국어 | العربية

The React skin for the third-generation Web API front end of Cube (NewLife.Cube), delivered as a standalone NuGet package and repository. Built with React 19 + Ant Design 6 + Zustand + Vite and driven by backend field metadata (meta), it dynamically renders generic list and form pages and conforms to the Cube skin design specification.

Add references to both NewLife.Cube and NewLife.Cube.React, run dotnet run, and open the browser to get a complete admin console — sign-in, dynamic menus, metadata-driven lists and forms, CRUD, import/export, an AI assistant and more, with zero front-end development.

Demo/tutorial: Cube tutorial https://newlifex.com/cube | Demo site https://cube.newlifex.com


Highlights

  • Out of the box: just AddCube + UseCube; the build output is embedded in the DLL and shipped with the NuGet package, with no physical file dependency. Cube auto-detects every referenced skin package, so the active skin can be switched from the SpaSkin setting without a restart or any extra call (app.UseReact(env) remains only as a force switch)
  • Field metadata driven: lists, forms, search and detail views are all rendered dynamically from backend meta metadata; adding an entity requires zero front-end work
  • Conforms to the Cube skin design specification: complete authentication flow, generic list, generic form, LOV/upload/rich text/AI assistant and other shared components
  • Consumes the shared packages: built on the npm package @newlifex/cube (API client, page logic, field mapping and auth), with a framework-agnostic core shared by multiple skins
  • Single theme × light/dark: native look driven by antd tokens, with one-click light/dark switching
  • AI assistant: SSE streaming chat + quick commands + smart form filling + system diagnostics, with built-in mermaid rendering
  • Multilingual localization: 11 fully translated UI languages (backend list ∩ frontend complete languages; the backend exposes 32 languages, and the other 21 fall back to English; same pipeline as NewLife.Core/Cube, requires NewLife.Cube ≥ 6.15.2026.1022), supporting follow-system and forced languages; server menus, field metadata and runtime messages are re-fetched when the language changes
  • Well tested: 473 unit tests + 133 E2E tests (126 passed / 7 skipped), with Playwright login session reuse

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.

Project What it does Downloads
Foundation
NewLife.Core Logging, configuration, caching, networking, serialization, scheduling and APM tracing. NuGet
NewLife.XCode Data middleware: single tables at the tens-of-billions scale, automatic sharding, read-write splitting, 10+ databases. NuGet
NewLife.Net High-performance network library: 1.77M pps / 14.5 Gbps on a single machine (TCP 1KB, 2026-10), 4M long-lived TCP connections. NuGet
NewLife.Remoting Protocol communication and RPC framework for client/server applications and IoT devices. NuGet
NewLife.Agent Installs .NET applications as OS daemons: Windows services and Linux systemd. NuGet
NewLife.Templates dotnet new project templates for console, web, API, service, data and IoT projects. NuGet
Data & Messaging
NewLife.Redis Redis client with microsecond latency, millions of ops/s and built-in message queues. NuGet
NewLife.RocketMQ Pure managed RocketMQ client for Apache RocketMQ and Alibaba Cloud Message Queue. NuGet
NewLife.MQTT MQTT client and server, including Alibaba Cloud IoT connectivity. NuGet
NewLife.NovaDb Hybrid database in C#: embedded or networked, relational, time-series, message queue and KV in one. NuGet
NewLife.MySql MySql driver and helper layer built on the NewLife data stack. NuGet
Web, AI & Distributed
NewLife.Cube Rapid admin-platform framework: permissions, SSO, OAuth server and CRUD scaffolding. NuGet
Stardust Distributed service platform: node management, APM, configuration center, registry and release center. NuGet
AntJob Distributed task and real-time data scheduling platform with sharding, retries and backfill. NuGet
NewLife.AI Unified client for 46 LLM providers plus ChatAI, a ready-to-run web chat application. NuGet
Industrial & IoT
NewLife.IoT IoT standard library defining protocol contracts and device abstractions. NuGet
NewLife.Modbus Modbus TCP/RTU/ASCII implementation on top of NewLife.IoT. NuGet
NewLife.Siemens Siemens PLC protocol on top of NewLife.IoT. NuGet
NewLife.Omron Omron PLC protocol on top of NewLife.IoT. NuGet
NewLife.Melsec Mitsubishi Melsec PLC protocol on top of NewLife.IoT. NuGet
NewLife.OPC OPC client for industrial data access. —
NewLife.BACnet BACnet building-automation protocol stack. NuGet
ZeroIoT Lightweight open-source IoT platform with gateway and device management. —
Vehicle Telematics
NewLife.JT808 JT/T 808 vehicle positioning protocol: 70+ message bodies, 2011/2013/2019. NuGet
NewLife.JT809 JT/T 809 platform-to-platform protocol for transport authorities. NuGet
NewLife.JT1078 JT/T 1078 in-vehicle video: RTP parsing, FLV/fMP4 remuxing and live streaming. NuGet
Domain Components
NewLife.Office One package for Excel, Word, PPT, PDF and 15+ document formats. NuGet
NewLife.Audio Cross-platform audio: codecs, device I/O, DSP, containers and streaming. NuGet
NewLife.Video Video codecs, container formats, frame processing and streaming. NuGet
NewLife.Map Unified interface over Baidu, AMap, Tencent and Tianditu with geocoding and coordinate conversion. NuGet
NewLife.IP IPv4 geolocation with an offline memory-mapped database and an online API fallback. NuGet
Tools & Products
CrazyCoder Developer toolbox: network, serial port, crypto, regex, Modbus and MQTT. NuGet
GitCandy Self-hosted Git source code management system. —
LuckyClover 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

  • 📋 Requirements — vision, core goals, functional requirements and non-goals
  • ✅ Feature list — three-dimensional status tracking of implementation/tests/comments
  • 🏗️ Architecture — .NET skin integration, shared package strategy, front-end architecture
  • 🖥️ Front-end guide — development/build/test guide for the web directory

Quick Start

Prerequisite: Node.js 24 + pnpm 9 (the shared front-end logic comes from the npm package @newlifex/cube; no local monorepo checkout is needed).

# 1. Start the backend API (CubeDemo, http://localhost:5050 by default, SQLite with no external dependencies)
dotnet run --project CubeDemo/CubeDemo.csproj

# 2. Start the front-end dev server (port 5188)
cd NewLife.Cube.React/web
pnpm install
pnpm dev

Open http://localhost:5188 in a browser to see the sign-in page; after signing in you reach the complete admin console.

Local development

# Front-end build/checks/unit tests (web/ directory)
cd NewLife.Cube.React/web
pnpm build        # outputs to ../wwwroot (for .NET embedding)
pnpm type-check   # tsc type checking
pnpm test:unit    # Vitest unit tests (473)
pnpm test:e2e     # Playwright E2E (133; defaults to port 5050, override with $env:E2E_BASE_URL)

# .NET build (embeds wwwroot into the DLL)
dotnet build 魔方React.slnx -c Release

Changing shared packages: the shared logic is published as the npm package @newlifex/cube. For local co-development, build it in ../NewLife.Cube (pnpm --filter @newlifex/cube build) and run pnpm link ../NewLife.Cube/packages/cube in web; remove the link to return to the published beta.

Testing

  • Unit tests: Vitest + React Testing Library + jsdom, 473 cases all passing
  • E2E tests: 133 Playwright cases (sign-in/sign-up/activation/forgot password/security center/list create-update-delete/import-export/layout/upload/AI), with login session reuse
  • .NET integration: CubeDemo + UseReact end-to-end flow (sign-in → menus → CRUD → export → refresh without 404)

Release

  • NuGet package: NewLife.Cube.React (version 1.0.{yyyy.MMdd}, with a snupkg symbol package)
  • CI automation: publish.yml (tags) and publish-beta.yml (master) build the front-end with pnpm, embed wwwroot into the DLL, then dotnet pack and publish to nuget.org + GitHub Packages. Sourcemaps are excluded and packing fails when wwwroot/index.html is missing.
  • Multi-skin switching: requires NewLife.Cube ≥ 6.16.2026.1030 (the version that introduces ICubeSkin); reference both NewLife.Cube.Vue and NewLife.Cube.React, then just AddCube + UseCube — Cube auto-detects both skins and the active one is picked in the Cube settings page.

Related repositories

Repository Description
NewLife.Cube Cube core (Web API/permissions/menus/field metadata) + shared front-end npm package @newlifex/cube
Cube skin design specification Unified design specification all Cube skins should follow; the React skin conforms to it
NewLife.Cube.Vue Vue-family front-end skin (Vue 3 + Element Plus)
NewLife.Cube.React This repository (React-family front-end skin)

Team

NewLife

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

MIT © 2002-2026 NewLife Development Team

About

魔方React皮肤,Ant Design 6

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages