[Open-source] Enterprise-level backend management system, multi-tenant, mobile-end, code generation, and real-time communication.
![[Open-source] Enterprise-level backend management system, multi-tenant, mobile-end, code generation, and real-time communication.](https://yy123.ink/api/img/1796368223752-ice5lc.png)
1. Project Overview
XiHan.BasicApp
Enterprise-level backend kernel. Backend based on .NET 10 and XiHan.Framework, frontend based on Vue 3, provides multi-tenant, RBAC + ABAC permission, code generation and real-time communication capabilities
2. Open Source License
Licensed under MIT
3. Screenshots
Preview
Preview
|
Tenant selection |
User Management |
|
User management (dark) |
Service monitoring |
|
Preferences |
Operation log |
|
Log link |
About |
Mobile end:
4. Feature Overview
XiHan.BasicApp uses a front-end and back-end separation architecture. Backend follows DDD layering and CQRS, application services are exposed directly as REST interfaces through dynamic API; Front-end uses Vue 3 + TypeScript + Naive UI. The system has a complete identity, permission, tenant, and audit capability, which can be used as a starting point for backend projects, or as a reference for .NET + Vue full-stack practices
Function
Identity and authentication
-
User, role, department, menu management -
JWT dual token (Access + Refresh), multi-end login and session management -
Multiple login methods: account password, email/short message verification code, OAuth2 (GitHub / Google / QQ), 2FA (TOTP / email / short message) -
Password PBKDF2 hash; one-time verification code consumption and destruction, constant time comparison
Permission (RBAC + ABAC)
-
Permission code resource:action:scope, super administrator wildcard *:*:* -
Role hierarchical inheritance (closure table), data scope (self / department / tenant), field-level data masking -
ABAC constraint rules (time window / IP / expression), session role activation (dynamic responsibility separation) -
Permission application audit and change record
Multi-Tenant
-
Field-level isolation, global data uses TenantId=0 convention -
Global unique email login, login after automatic landing (console / workbench / tenant selection), can switch tenants at any time -
Super administrator platform operation and maintenance, can enter any tenant to manage on behalf -
Tenant version (Edition) permission whitelist runtime control; open one-stop administrator, role, and authorization; downgrade automatic recovery of unauthorized access
Audit Log
-
Access / API / Operations / Exceptions / Login / Entity Changes Six Kinds of Logs, Each Written Independently -
Automatic Data Masking (Passwords, Tokens, Keys, ID Numbers, etc.) Before Data Storage; Entity Changes Distinguish Between Add, Modify, Delete, and Restore
Code Generation
-
Single Table / Tree / Master-Slave Three Modes, From Entity, DTO, API to Frontend Pages Generated in One Click -
Based on Scriban Templates, Supports Customization; Zip Download or Directly Write to Files
Platform Capabilities
-
Dynamic API: Application Services Exposed via [DynamicApi] Without Controller Templates, Scalar Documentation Automatically Generated -
Single Fact Source for Menus: Backend PageRegistry Registers Menus, Routes, Component Paths, Permission Codes, and Internationalization Keys -
Full-Link Distributed Caching (Authorization Snapshots, Version Control, Menus, Configurations, Dictionaries), Write Path Precise Expiration -
Gateway Gray Release (Percentage / Whitelist / Tenant / Request Header), Request Tracking, Flow Limitation, and Circuit Breaker -
Message Templates (Email / SMS / Internal Notifications, Scriban Rendering, Tenant Overriding Defaults), SignalR Real-Time Notifications, and Online Chat -
File Multi-Storage (Local / S3 / OSS / COS / MinIO), Scheduled Tasks, Audit Workflows, and Internationalization (Chinese / English)
Frontend Experience
-
Schema-Driven List Pages: Search / Tables / Export Generated by Configuration, Built-in Column Settings, Density Switching, Advanced Search, Personal View Saving, Row Hover Overview, Tree Mode, and Column Width Dragging -
Permissions / Tenants / Preference Awareness: Page, Field, Operation Three-Level Filtering by Permission Codes, Field-Level Data Masking; Column Settings and Search Preferences Synchronized to Backend, Multi-Endpoint Consistency -
Lingdiao Island Global Feedback, Multi-Tab Pages, Favorites, Command Panel-Style Global Search -
Message Center: Top Banner, Login Pop-Up, Notification Center, Supports Forced Reading and Role / Department Targeting -
Preference Center: Bright / Dark Themes, Theme Colors, Layout Styles, and Compactness, Preference Cloud-Synchronized -
Rich Text (Tiptap) and Markdown Editors, Cron Visualization, JSON Editing / Viewing -
Screen Lock, Watermark, Time Zone Switching, Import / Export Center (Template Import, Asynchronous Export Tasks)
5. Tech Stack
Tech Stack
Backend
| Technology |
Description |
| .NET 10 / C# |
Runtime and Language |
| XiHan.Framework 2.5.x |
Self-Developed Modularized Application Framework |
| SqlSugar |
ORM, Supports PostgreSQL / MySQL / MariaDB |
| Redis |
Distributed Caching and Distributed Locks |
| SignalR |
Real-Time Communication |
| Serilog |
Structured Logs |
| Scalar |
API Documentation |
Frontend
| Technology |
Description |
| Vue 3.5+ |
UI Framework |
| TypeScript 5.9+ |
Type System |
| Vite 6 |
Build tools |
| Naive UI |
Component Library |
| Pinia |
State management |
| Tailwind CSS 4 |
Atomic CSS |
| Tiptap |
Rich text editor |
| vue-i18n |
Internationalization |
Architecture
The System is Divided into Framework Layer, Module Layer, and Main Application Layer, with Each Module Following DDD Layering (Domain / Application / Infrastructure)
┌─────────────────────────────────────────────────────────────┐│ XiHan.BasicApp.WebHost │(Startup Entry and Module Aggregation)├──────────────────────────────┬──────────────────────────────┤│ XiHan.BasicApp.Saas │ XiHan.BasicApp.CodeGeneration│(RBAC / Multi-Tenancy / Audit) (Code Generation and Template Management)├──────────────────────────────┴──────────────────────────────┤│ XiHan.BasicApp.Web.Core │(Web Core Capabilities / Dynamic API / Gateway / Gray Release)├─────────────────────────────────────────────────────────────┤│ XiHan.BasicApp.Core │(Basic Application Capabilities / DDD / CQRS / Modularization)├─────────────────────────────────────────────────────────────┤│ XiHan.Framework.* │(Bottom Layer Framework (Authentication / Authorization / Data / Cache / Event Bus / Multi-Tenancy))└─────────────────────────────────────────────────────────────┘
| Project |
Description |
| XiHan.BasicApp.Core |
Basic Application Capabilities, Integrating DDD / CQRS / Event Bus / Authentication / Authorization / Cache / Multi-Tenancy |
| XiHan.BasicApp.Web.Core |
Web Core Capabilities, Dynamic API / Scalar / SignalR / Gateway / Gray Routing |
| XiHan.BasicApp.Saas |
Core Business Modules: Users / Roles / Permissions / Menus / Departments / Tenants / Configurations / Dictionaries / Files / Notifications / Logs / Tasks |
| XiHan.BasicApp.CodeGeneration |
Code Generation: Data Source Management / Table Structure Import / Template Configuration / Full-Stack Generation |
| XiHan.BasicApp.WebHost |
Startup Entry, Aggregating All Modules |
XiHan.BasicApp/├── backend/ # Backend (.NET 10)│ ├── src/│ │ ├── framework/ # Core / Web.Core Basic Capabilities│ │ ├── modules/ # Saas, CodeGeneration Modules│ │ └── main/ # WebHost Startup Entry│ ├── props/ # Shared MSBuild Properties│ ├── scripts/ # Deployment and Operations Scripts│ └── test/ # Test Projects├── frontend/ # Frontend (Vue 3 + Naive UI)│ ├── src/ # Application Source Code│ └── packages/ # Internal Packages└── assets/ # README Resources
Quick Start
Environment Requirements
| Dependency |
Version |
| .NET SDK |
10.0+ |
| Node.js |
20.0+ |
| pnpm |
9.0+ |
| PostgreSQL |
14+ (or MySQL / MariaDB) |
| Redis |
6.0+ |
Backend
git clone https://github.com/XiHanFun/XiHan.BasicApp.gitcd XiHan.BasicApp/backenddotnet run --project src/main/XiHan.BasicApp.WebHost --launch-profile Development
Access After Startup
http://127.0.0.1:9708/scalar view API documentation.
Environment ports: Development 9708, Production 9709.
Frontend
cd frontendpnpm installpnpm dev
Database
Click on the right side
backend/src/main/XiHan.BasicApp.WebHost/appsettings.Development.json database connection string:
{"XiHan": {"Data": {"SqlSugarCore": {"ConnectionConfigs": [{"DbType": "PostgreSQL","ConnectionString": "Host=localhost;Port=5432;Database=xihan_basic_app;Username=postgres;Password=your_password;"}]}}}}
The first startup will automatically create tables and execute data seeding initialization.
Default Username
The initial super administrator account is superadmin, password SuperAdmin@123. You can override it through
Saas:Seed:SuperAdminPassword (environment variable Saas__Seed__SuperAdminPassword). It is recommended to override it in production environments and change it immediately after the first login.
Deployment
dotnet publish backend/src/main/XiHan.BasicApp.WebHost -c Release -o /opt/xihan-basicappsudo cp backend/scripts/service/XiHan.BasicApp.service /etc/systemd/system/sudo systemctl enable XiHan.BasicAppsudo systemctl start XiHan.BasicApp
Windows
Usage
backend/scripts/service/XiHan.BasicApp.bat start.
Sincere thanks.
No ranking.
| Project |
Acknowledgments |
| XiHan.Framework |
As the underlying framework of this project's backend. |
| NaiveUI |
As the UI component of this project's frontend. |
| Blog.Core |
As part of the inspiration for the project's backend architecture and logical functions. |
| Admin.NET |
As part of the inspiration for the project's backend functions. |
| Admin.Core.ZR |
As part of the inspiration for the project's backend functions. |
| YuebonCore |
As part of the inspiration for the project's backend functions. |
| VbenAdmin |
As part of the inspiration for the project's frontend architecture and visual functions. |
| SoybeanAdmin |
As part of the inspiration for the project's frontend visual functions. |
| LitheAdmin |
As part of the inspiration for the project's frontend visual functions. |
| Other third-party dependencies. |
As the foundation for the project's functionality and expansion. |
6. Source Code Repository
Open-source project address:
https://github.com/XiHanFun/XiHan.BasicApp
Next steps







