How xihanfun/xihan.framework works
Project Type and Purpose
• This is not a standalone application but a modular, full‑stack development framework for .NET called “XiHan.Framework.”
• It provides layers of functionality (base types, utilities, core services, domain‑driven modules, integration libraries, ASP.NET Core middleware, AI providers, caching, EF Core, event bus, HTTP clients, etc.).
• Its purpose is to be consumed by .NET applications—offering a plug‑and‑play, opinionated infrastructure and common patterns (DI, modularity, UoW, caching, logging, etc.).
File‑Structure Analysis
• Top‑level folders:
• framework/ — contains all source code organized by modules and build configuration.
• assets/ — static files like the logo.
• test/ — unit‑test projects for various modules.
• Within framework/:
• props/, nuget/, scripts/ — build and packaging scripts and MSBuild props.
• src/ — the heart of the framework: dozens of sub‑directories each representing a NuGet package or module.
• core clusters:
– XiHan.Framework (bootstrapping, application factory, modularity)
– XiHan.Framework.Utils (general helpers)
– XiHan.Framework.Core (lifecycle, DI, exceptions, localization, logging)
• “CoreLibraries” group: AI, BackgroundJobs, DDD (Application/Domain), BlobStoring, EventBus, Http, Caching (+ Redis), Localization, MultiTenancy, Serialization, Threading, UoW, VirtualFileSystem, TextTemplating, SearchEngines, CodeGeneration, Bot, Gateway.
• AspNetCore group: ASP.NET Core abstractions and middleware (Authentication JWT/OAuth/OpenID, MVC, Swagger, SignalR, Refit, Serilog, Scalar endpoints).
• Tests mirror the src/ tree to verify behavior.
README Insights
• The README enumerates the layering:
1. Base
2. Common (Utils)
3. Core
4. CoreLibraries
5. AspNetCore
6. AspNetCoreLibraries
• It implies a clear layering and dependency order.