docs: 📝 rEADME (#195)

[skip ci]

Co-authored-by: tk <fiyne1a@dingtalk.com>
This commit is contained in:
nsnail 2024-11-12 17:57:36 +08:00 committed by GitHub
parent 26e3698f57
commit d1503a859b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 37 additions and 25 deletions

View File

@ -14,7 +14,7 @@ https://na.tools92.top
```shell
docker run -p 8080:8080 nsnail/netadmin
# 需翻墙
# 需魔法上网
```
## 构建步骤
@ -27,14 +27,17 @@ dotnet --list-sdks
# 2. 克隆代码仓库
git clone https://github.com/nsnail/NetAdmin.git && cd ./NetAdmin
# 3. 检查本机 redis 运行状态
redis-cli dbsize
# 3. 确认本机 redis 处于运行状态
redis-server # 启动
redis-cli # 连接测试
# 下载 redis for windowshttps://github.com/redis-windows/redis-windows/releases
# 下载 redis for linux/machttps://redis.io/download
# 4. 运行后端 WebApi
dotnet run --project ./src/backend/NetAdmin.AdmServer.Host/NetAdmin.AdmServer.Host.csproj --urls http://[::]:5010 -is
# 浏览器打开 http://localhost:5010 将看到SwaggerKnife4jUI界面
# -i 插入种子数据
# -s 同步数据库结构
# 浏览器访问 http://localhost:5010 将看到SwaggerKnife4jUI界面
# 5. 检查 nodejs 版本 >=20
node -v
@ -45,42 +48,54 @@ cd ./src/frontend/admin && npm install
# 7. 运行前端项目
npm run dev
# 浏览器打开 http://localhost:5020 将看到管理界面默认用户名root密码1234qwer
# 浏览器访问 http://localhost:5020 将看到管理界面默认用户名密码root 1234qwer
```
## 文件目录
## 文件目录
```
+---.github # github 工程文件目录
+---.template.config # dotnet 项目模板配置目录
+---assets # 项目资源文件目录
+---build # 构建相关的工程文件目录
+---dist # 编译生成的二进制文件目录
+---docker # docker 镜像构建文件目录
+---docs # 项目开发文档目录
+---refs # 引用的第三方包的仓库目录
+---scripts # 各种工具脚本文件目录
+---src # 项目源码文件目录
```
## 后端项目架构
## 项目架构
```mermaid
flowchart TD
H["NetAdmin.Host\n公共主机层\n.Net自托管主机程序\n输入输出格式化\n数据校验、鉴权\n...所有HTTP管道过滤器中间件"] --> C["NetAdmin.Cache\n公共缓存层\n基于Redis或MemoryCache的缓存策略实现"]
C --> A["NetAdmin.Application\n公共业务逻辑层\n内部服务增删改查\n外部服务增删改查\n...所有业务用例的计算与组合逻辑的模块化)"]
A --> D["NetAdmin.Domain\n数据实体层\n数据库关系实体映射\nDTO数据传输对象\n...所有数据模型的抽象与封装)"]
D --> I["NetAdmin.Infrastructure\n基础设施层\n第三方组件和Nuget包引用\n公共构建和程序运行配置\n公共常量枚举异常定义\n全球化化和多语言\n...所有公共Utility工具"]
XH["NetAdmin.XXX.Host\nWebApi"]-->H
XS["NetAdmin.XXXService\n常驻内存服务"]-->H
XS["NetAdmin.XXXService\n常驻内存服务"]-->XC
XC["NetAdmin.XXX.Cache\n缓存层实例"]-->C
XA["NetAdmin.XXX.Application\n业务逻辑层实例"]-->A
XH-->XC
XC-->XA
sys-host["NetAdmin.SysComponent.Host\n系统组件主机层"]
sys-cache["NetAdmin.SysComponent.Cache\n系统组件缓存层"]
sys-app["NetAdmin.SysComponent.Application\n系统组件应用层"]
sys-domain["NetAdmin.SysComponent.Domain\n系统组件数据实体层"]
sys-infra["NetAdmin.SysComponent.Infrastructure\n系统组件基础设施层"]
host["NetAdmin.Host\n框架主机层\n.Net自托管主机程序\n输入输出格式化\n数据校验、鉴权\n...所有HTTP管道过滤器中间件"]
cache["NetAdmin.Cache\n框架缓存层\n基于Redis或MemoryCache的缓存策略实现"]
app["NetAdmin.Application\n框架业务应用层\n内部服务增删改查\n外部服务增删改查\n...所有业务用例的计算与组合逻辑的模块化)"]
domain["NetAdmin.Domain\n框架数据实体层\n数据库关系实体映射\nDTO数据传输对象\n...所有数据模型的抽象与封装)"]
infra["NetAdmin.Infrastructure\n框架基础设施层\n第三方组件和Nuget包引用\n公共构建和程序运行配置\n公共常量枚举异常定义\n全球化化和多语言\n...所有公共Utility工具"]
biz-host["YourSolution.XXX.Host\n业务实例主机层"]
biz-cache["YourSolution.XXX.Cache\n业务实例缓存层"]
biz-app["YourSolution.XXX.Application\n业务实例应用层"]
biz-domain["YourSolution.XXX.Domain\n业务实例数据实体层"]
biz-infra["YourSolution.XXX.Infrastructure\n业务实例基础设施层"]
biz-host-->biz-cache-->biz-app-->biz-domain-->biz-infra
sys-host-->sys-cache-->sys-app-->sys-domain-->sys-infra
host-->cache-->app-->domain-->infra
biz-host-->sys-host-->host
biz-cache-->sys-cache-->cache
biz-app-->sys-app-->app
biz-domain-->sys-domain-->domain
biz-infra-->sys-infra-->infra
```
## 引用的开源代码 / 特别鸣谢
## 特别鸣谢
| 语言 | 集成领域 | 开源库 |
|------------|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@ -88,7 +103,6 @@ XC-->XA
| C# | 数据库关系映射 | [FreeSql](https://github.com/dotnetcore/FreeSql) |
| C# | 代码质量检查 | [Roslynator.Analyzers](https://github.com/josefpihrt/roslynator) \| [SonarAnalyzer.CSharp](https://github.com/SonarSource/sonar-dotnet) \| [StyleCop.Analyzers](https://github.com/DotNetAnalyzers/StyleCopAnalyzers) |
| C# | 单元测试框架 | [xunit](https://github.com/xunit/xunit) \| [coverlet.collector](https://github.com/coverlet-coverage/coverlet) |
| C# | 分布式锁 | [RedLock.net](https://github.com/samcook/RedLock.net) |
| C# | 控制台终端界面库 | [Spectre.Console](https://github.com/spectreconsole/spectre.console) |
| C# | 扩展函数库 | [NSExt](https://github.com/nsnail/ns-ext.git) |
| C# | 图形处理库 | [SixLabors.ImageSharp](https://github.com/SixLabors/ImageSharp) |
@ -96,8 +110,6 @@ XC-->XA
| C# | 性能监控采集 | [prometheus-net.AspNetCore](https://github.com/prometheus-net/prometheus-net) |
| C# | 雪花ID生成器 | [Yitter.IdGenerator](https://github.com/yitter/idgenerator) |
| C# | 自动化版本管理 | [MinVer](https://github.com/adamralph/minver) |
| C# | JavaScript引擎 | [MsieJavaScriptEngine](https://github.com/Taritsyn/MsieJavaScriptEngine) |
| C# | WebApi图形界面 | [IGeekFan.AspNetCore.Knife4jUI](https://github.com/luoyunchong/IGeekFan.AspNetCore.Knife4jUI) |
| TypeScript | SPA基础框架 | [Vue](https://github.com/vuejs/core) |
| TypeScript | 前端构建工具 | [Vite](https://github.com/vitejs/vite) |
| TypeScript | UI控件库 | [Element Plus](https://github.com/element-plus/element-plus) |

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(SolutionDir)/build/code.quality.props"/>
<ItemGroup>
<ProjectReference Include="../NetAdmin.Infrastructure/NetAdmin.Infrastructure.csproj"/>
<ProjectReference Include="../NetAdmin.SysComponent.Infrastructure/NetAdmin.SysComponent.Infrastructure.csproj"/>
</ItemGroup>
<ItemGroup>
<None Include="$(SolutionDir)/assets/res/NetAdmin.AdmServer.Statements.ln">