Skip to content

XiHanFun/XiHan.Framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

logo

δΈ­ζ–‡

XiHan.Framework

XiHan framework repository. Fast, lightweight, efficient, and dedicated development framework. Built on .NET 9.

Ask DeepWiki

Project Overview

XiHan.Framework is a modern, modular enterprise-level development framework based on .NET 9, specifically designed for front-end and back-end separated ASP.NET Core applications. The framework prioritizes .NET 9 native features, reduces third-party dependencies, and ensures modularity, extensibility, and ease of use.

πŸš€ Core Features

  • πŸ“¦ Modular Architecture - Highly extensible modular design with on-demand selection
  • ⚑ Quick Start - Download and run instantly, quickly experience complete Web API projects
  • 🎯 .NET 9 First - Fully leverage .NET 9 native features (DI, logging, serialization, AOT)
  • πŸ—οΈ DDD Support - Complete Domain-Driven Design architecture support
  • πŸ”’ Enterprise Security - Comprehensive authentication, authorization, and security mechanisms
  • 🌐 Frontend-Backend Separation - Designed for modern web applications
  • πŸ“Š Monitoring & Logging - Complete monitoring, logging, and performance analysis

Architecture Design

Package Architecture

The framework adopts a modular package design that users can select on demand:

πŸ† Quick Start Packages (Core)

# Minimal configuration - Start Web API in 5 minutes
dotnet add package XiHan.Framework
dotnet add package XiHan.Framework.Web.Api
dotnet add package XiHan.Framework.Web.Docs
dotnet add package XiHan.Framework.Logging

πŸ“‹ Complete Feature Packages (Recommended)

# Production-ready Web API solution
dotnet add package XiHan.Framework.Authentication  # Authentication
dotnet add package XiHan.Framework.Data           # Data access
dotnet add package XiHan.Framework.Validation     # Data validation
dotnet add package XiHan.Framework.Caching        # Cache management

πŸ”§ Extension Packages (As Needed)

# Advanced feature extensions
dotnet add package XiHan.Framework.Web.RealTime      # Real-time communication
dotnet add package XiHan.Framework.BackgroundJobs    # Background jobs
dotnet add package XiHan.Framework.Messaging         # Message queues
dotnet add package XiHan.Framework.SearchEngines     # Full-text search
dotnet add package XiHan.Framework.MultiTenancy      # Multi-tenancy

Layered Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Presentation Layer                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Web API        β”‚  β”‚  SignalR        β”‚  β”‚  Swagger/Scalar β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    Application Layer                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Application    β”‚  β”‚  Background Jobsβ”‚  β”‚  AI Services    β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    Domain Layer                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Domain Models  β”‚  β”‚  Domain Events  β”‚  β”‚  Domain Servicesβ”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                  Infrastructure Layer                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Data Access    β”‚  β”‚  Caching & MQ   β”‚  β”‚  External APIs  β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Technology Stack

Core Technologies

  • .NET 9 - Base runtime with AOT compilation support
  • ASP.NET Core - Web framework
  • System.Text.Json - High-performance serialization
  • Entity Framework Core - ORM framework
  • Swagger/Scalar - API documentation

Authentication & Authorization

  • JWT - JSON Web Token
  • OAuth 2.0 - Open authorization protocol
  • OpenID Connect - Identity authentication protocol
  • ASP.NET Core Identity - Identity management

Extension Technologies

  • Redis - Distributed caching
  • SignalR - Real-time communication
  • Hangfire/Quartz.NET - Background jobs
  • RabbitMQ/Kafka - Message queues
  • Elasticsearch - Full-text search
  • ML.NET - Machine learning

Quick Start

1. Create Project

dotnet new webapi -n MyApi
cd MyApi

2. Install Framework (Minimal Configuration)

# Metadata package (required)
dotnet add package XiHan.Framework

# Web API core packages
dotnet add package XiHan.Framework.Web.Api
dotnet add package XiHan.Framework.Web.Docs
dotnet add package XiHan.Framework.Logging

3. Basic Configuration

// Program.cs
using XiHan.Framework.Web.Api;

var builder = WebApplication.CreateBuilder(args);

// Add framework services
builder.Services.AddXiHanWebApi();
builder.Services.AddXiHanDocs();
builder.Services.AddXiHanLogging();

var app = builder.Build();

// Configure middleware
app.UseXiHanWebApi();
app.UseXiHanDocs();  // Auto-generate Swagger documentation

app.Run();

4. Run Project

dotnet run

Visit https://localhost:5001/swagger to view API documentation!

5. Add Business Features (Optional)

# Add authentication and data access
dotnet add package XiHan.Framework.Authentication
dotnet add package XiHan.Framework.Data
dotnet add package XiHan.Framework.Validation
// Update Program.cs
builder.Services.AddXiHanAuthentication();
builder.Services.AddXiHanData(options =>
{
    options.UseInMemoryDatabase("MyDb"); // Or use SQL Server
});
builder.Services.AddXiHanValidation();

app.UseXiHanAuthentication();

Development Roadmap

🎯 2024 Q4 (Current Phase)

  • βœ… Complete metadata package development
  • πŸ”„ Complete quick start core packages
  • πŸ”„ Complete Web API and documentation packages
  • πŸ”„ Release v0.1.0-alpha - Basic runnable version

πŸš€ 2025 Q1

  • Complete authentication, authorization, and data access packages
  • Release v0.2.0-beta - Complete API functionality
  • Complete system function packages

πŸ“¦ 2025 Q2

  • Complete advanced data packages and development tools
  • Release v1.0.0 - Stable production version

πŸ”§ 2025 Q3-Q4

  • Complete all extension packages
  • Release v1.1.0+ - Complete feature version

Design Principles

🎯 Quick Start First

  • Users can run complete Web API immediately after download
  • Minimal configuration, maximum experience
  • Interactive API documentation out of the box

🧩 Modular Design

  • Single responsibility, clear dependencies
  • Users select modules on demand
  • Support independent development and testing

⚑ .NET 9 First

  • Prioritize built-in features (DI, logging, serialization)
  • Only use third-party libraries when necessary
  • Support AOT compilation and high-performance features

🌐 Internationalization Friendly

  • Provide Chinese documentation and examples
  • Support domestic NuGet mirrors
  • Compatible with international standards (OpenAPI, gRPC)

Version Information

  • Current Version: 0.11.7-preview.3
  • Target Framework: .NET 9.0
  • License: MIT
  • Development Status: Actively Developing

Contributing

We welcome Issue submissions and Pull Requests to improve this framework.

Contribution Guidelines

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact


XiHan Framework, making .NET development simpler.

About

XiHan framework repository. Fast, lightweight, efficient, and dedicated development framework. Built on DotNet.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages