# oc-separation--yessql-version **Repository Path**: smartent/oc-separation--yessql-version ## Basic Information - **Project Name**: oc-separation--yessql-version - **Description**: No description available - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-10-14 - **Last Updated**: 2026-10-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Smartent Platform 基于 [Orchard Core](https://github.com/OrchardCMS/OrchardCore) 的 **Smartent 平台分叉**:多租户模块化宿主、关系型数据访问(EF Core + SQL Server),面向 Smartent 产品与 CRM 生态独立演进。 本仓库从 Smartent monorepo 中 **剥离为独立 Git 仓库** 后,以 `DashboardApplication` 为参考宿主,持续去除 YesSql、收敛 CMS Content,并强化 Relational 多租户(表前缀、Schema、同库/分库)。 --- ## 与上游 Orchard Core 的关系 | 项 | 说明 | |----|------| | **上游** | Orchard Core v3.x 系(.NET 10、模块化 Shell) | | **许可** | 继承上游 [BSD-3-Clause](LICENSE) | | **差异** | `OrchardCore:StorageEngine=Relational`;`OrchardCore.Data.SqlServer` / `EntityFramework` 替代 YesSql;Content CMS 剥离路线见文档 | | **官方文档** | 通用 Orchard 概念仍参考 ;**本仓库行为以 `docs/` 为准** | --- ## 仓库结构(速览) ``` Smartent-Platform/ ├── Smartent-Platform.slnx # 聚合解决方案(无 YesSql 程序集) ├── src/ │ ├── OrchardCore/ # 框架与 Data 改造 │ ├── OrchardCore.Modules/ # 内置模块(Users、Tenants、Setup…) │ ├── OrchardCore.Themes/ │ └── WebApplication/ │ └── DashboardApplication/ # 参考宿主(Relational + AutoSetup) ├── test/ # 单元测试(含 Data.SqlServer.Tests) ├── docs/ # 架构、上手、排障(本仓库权威文档) ├── .scripts/ # CI 门禁、清库冒烟、资产构建 └── global.json # .NET SDK 10.x ``` --- ## 环境要求 | 工具 | 版本 | |------|------| | [.NET SDK](https://dotnet.microsoft.com/download) | 10.0+(见 `global.json`) | | [Node.js](https://nodejs.org/) | 22.x(改前端资源时) | | [Yarn](https://yarnpkg.com/) | 4.x(`corepack enable`) | | SQL Server | 本地开发默认 `(local)`,库名常用 `SmartentPlatform` | --- ## 快速开始 ```powershell # 1. 克隆本仓库后进入根目录 cd Smartent-Platform # 2. 编译参考宿主 dotnet build src/WebApplication/DashboardApplication/DashboardApplication.csproj -c Debug # 3. 运行(默认 Development 配置 + AutoSetup) dotnet run --project src/WebApplication/DashboardApplication/DashboardApplication.csproj # 4. 浏览器打开控制台输出的 URL,完成 Setup 或依赖 AutoSetup ``` 配置要点(`DashboardApplication/appsettings*.json`): - `OrchardCore:StorageEngine` = **`Relational`** - `Smartent:Database:Server` / `DefaultDatabaseName`:与 CRM 对齐的连接与默认库 - `OrchardCore_AutoSetup`:Default 租户自动安装(可选) 更完整的步骤、清库重装、多租户数据库约定见 **[文档中心](docs/README.md)**。 --- ## 构建与质量门禁 ```powershell # 推荐:与 CI 对齐的本地检查 .\.scripts\verify-smartent-platform-ci.ps1 .\.scripts\verify-no-yessql-gate.ps1 .\.scripts\verify-dashboard-relational-host.ps1 # 全解决方案 dotnet build Smartent-Platform.slnx -c Release # 关系型相关测试 dotnet test test/OrchardCore.Data.SqlServer.Tests/OrchardCore.Data.SqlServer.Tests.csproj -c Release ``` 前端资源(修改 SCSS/JS 时): ```powershell corepack enable yarn yarn build ``` --- ## 多租户与数据库(Relational) Smartent Relational 路径下,每个 Shell 租户通过 `App_Data/Sites/{tenant}/appsettings.json` 配置: | 配置项 | 作用 | |--------|------| | `ConnectionString` | SQL Server 连接(可与其它租户同库或分库) | | `TablePrefix` | 物理表前缀,如 `DefaultNew` → `DefaultNew_User` | | `Schema` | SQL Schema,如 `test`、`biz`(空则 `dbo`) | **同库多租户**:同一 `Database=`,不同 `TablePrefix`(及可选不同 `Schema`)可共存;安装链与 EF 建表逻辑已按前缀/Schema 隔离(见 `docs/getting-started/multi-tenant-database.md`)。 --- ## 文档 | 目录 | 内容 | |------|------| | [docs/README.md](docs/README.md) | 文档总索引 | | [docs/getting-started/](docs/getting-started/) | 编译运行、验收、多租户库 | | [docs/architecture/](docs/architecture/) | 去 YesSql、Content 剥离、OpenId | | [docs/troubleshooting/](docs/troubleshooting/) | 已解决问题与排查模板 | | [docs/independent-repository.md](docs/independent-repository.md) | 从 monorepo 独立建库与演进约定 | Agent / 贡献者还可参考仓库根目录 [AGENTS.md](AGENTS.md)(Orchard Core 构建与扩展约定)。 --- ## 独立仓库与 monorepo 若你仍从 `Crm-Oc-Project` monorepo 子目录开发: - 本目录历史提交可能出现在 monorepo 的 `Smartent-Platform/` 路径下。 - **独立演进**时建议:新建远程仓库 → `git subtree split` 或 `filter-repo` 导出 `Smartent-Platform` → 将 `docs/` 与 CI 脚本一并迁入。 步骤说明见 [docs/independent-repository.md](docs/independent-repository.md)。 与 **Smartent-CRM**、前端仓库的 API 契约若存在,由各自仓库维护;Platform 侧仅保证宿主与 Relational 数据层行为。 --- ## 获取帮助 - 排障:先查 [docs/troubleshooting/](docs/troubleshooting/) 与当日日志 `src/WebApplication/DashboardApplication/App_Data/logs/orchard-log-{date}.log` - 上游 Orchard:[Discord](https://orchardcore.net/discord)、[Issues](https://github.com/OrchardCMS/OrchardCore/issues) --- ## 致谢 [Orchard Core](https://orchardcore.net/) 社区与 [.NET Foundation](http://www.dotnetfoundation.org)。