Skip to content

CodeSpirit is a revolutionary full-stack low-code + AI development framework that achieves backend-driven full-stack development paradigm through intelligent code generation engine and deep AI collaboration.

License

Notifications You must be signed in to change notification settings

xin-lai/CodeSpirit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

949 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

CodeSpirit AI Framework | ็ฎ€ไฝ“ไธญๆ–‡

Framework Overview

CodeSpirit is a revolutionary full-stack low-code + AI development framework that achieves backend-driven full-stack development paradigm through intelligent code generation engine and deep AI collaboration. Built on .NET 10 and Aspire 13.0 technology stack, it provides enterprise-level technical depth and cloud-native scalability, supporting the entire lifecycle from UI generation and business logic orchestration to system operations.

Return Full-Stack Development to Engineering Essence

  • Backend-Driven Development Paradigm ยท Enterprise-Grade Open Architecture ยท AI-Enhanced Engineering Loop

CodeSpirit, bringing elegant simplicity to complex system development!

๐ŸŒŸ Core Innovation Highlights

Revolutionary AI Integration ๐Ÿค–

  • Zero-Configuration AI Endpoint Generation: Industry-first! Just one attribute tag automatically generates AI-fill API endpoints without writing any controller code
  • Smart Form Filling: Automatically analyzes DTO structure to generate prompts, automatically parses AI responses and fills forms, boosting development efficiency by 10x+
  • AI Long-Running Task Handling: Complete AI task management and progress tracking with multi-step interface display and real-time polling
  • Unified LLM Interface: Seamlessly switch between multiple large language models including OpenAI, Alibaba Qwen, DeepSeek

Ultimate Development Experience ๐Ÿš€

  • Unified Startup Framework: Program.cs requires only 2 lines of code to complete API project configuration with extreme standardization
  • Automatic Dependency Injection: Zero-configuration batch service registration based on Scrutor, automatically identifying lifecycle through interface tags
  • Multi-Database Support: Flexible switching between MySQL and SQL Server with independent migration management and completely decoupled business code
  • Smart Chart Recommendations: Automatically recommends optimal visualization solutions based on data characteristics with zero frontend code chart generation

Enterprise-Grade Architecture ๐Ÿข

  • Event-Driven Architecture: RabbitMQ-based distributed event system with tenant-awareness and cross-service communication
  • RBAC+ABAC Hybrid Permissions: Fine-grained permission control with permission inheritance and data scope restrictions
  • Comprehensive Multi-Tenancy: Data isolation, configuration isolation, and tenant-aware event system
  • Distributed Component Library: Out-of-the-box distributed locks, file storage, image processing, PDF generation

Core Value Propositions

  • Full-Stack Intelligent Generation: Eliminate 80% repetitive coding through backend model-driven frontend UI generation
  • Deeply Controllable Architecture: Generated code is fully open and controllable, supporting smooth evolution from rapid prototyping to complex systems
  • Enterprise-Grade Engineering Capabilities: Built-in permission system, audit tracking, distributed architecture support, out-of-the-box
  • AI-Collaborative Programming: Requirement Description โ†’ Prototype Generation โ†’ Code Verification โ†’ Deployment Monitoring
  • Cloud-Native Foundation: Native Kubernetes support, one-click deployment to multi-cloud environments

Technical Architecture Overview

Core Technology Stack

Category Technology Selection
Framework .NET 10
Language C# 13 (Supporting Primary Constructor and other new features)
Backend Architecture Clean Architecture + DDD
ORM Entity Framework Core (with soft delete, audit tracking)
Frontend Generation AMIS (Dynamic form/table generation)
UI Description Language UDL (Unified UI Description Language + Cards Library)
Microservices .NET Aspire 13.0 (Service discovery, health checks)
Database MySQL 8.0 / SQL Server 2022 (Multi-database support)
Time-Series DB GreptimeDB (For audit logging)
Container Orchestration Kubernetes (Supporting auto-scaling)
Identity Authentication JWT + OAuth2.0 (RBAC/ABAC hybrid model)
Data Access Repository Pattern + CQRS (partial modules)

Project Structure

Core Architecture

Src/
โ”œโ”€โ”€ ApiServices/                          # API Service Layer
โ”‚   โ”œโ”€โ”€ CodeSpirit.AiCardsApi/           # AI Cards API Service
โ”‚   โ”œโ”€โ”€ CodeSpirit.ApprovalApi/          # Approval Workflow API Service
โ”‚   โ”œโ”€โ”€ CodeSpirit.ConfigCenter/         # Configuration Center API
โ”‚   โ”œโ”€โ”€ CodeSpirit.ExamApi/              # Exam System API
โ”‚   โ”œโ”€โ”€ CodeSpirit.FileStorageApi/       # File Storage API
โ”‚   โ”œโ”€โ”€ CodeSpirit.IdentityApi/          # Identity Authentication API
โ”‚   โ”œโ”€โ”€ CodeSpirit.MessagingApi/         # Messaging Service API
โ”‚   โ”œโ”€โ”€ CodeSpirit.PathfinderApi/        # Pathfinder AI Goal Management API
โ”‚   โ””โ”€โ”€ CodeSpirit.SurveyApi/            # Survey System API
โ”œโ”€โ”€ Components/                           # Independent Component Library
โ”‚   โ”œโ”€โ”€ CodeSpirit.Aggregator/           # Data Aggregator Component
โ”‚   โ”œโ”€โ”€ CodeSpirit.AiFormFill/           # AI Form Fill Component
โ”‚   โ”œโ”€โ”€ CodeSpirit.Amis/                 # AMIS UI Generation Engine
โ”‚   โ”œโ”€โ”€ CodeSpirit.Audit/                # Audit Tracking Component
โ”‚   โ”œโ”€โ”€ CodeSpirit.Authorization/        # Authorization Management Component
โ”‚   โ”œโ”€โ”€ CodeSpirit.Caching/              # Distributed Caching Component
โ”‚   โ”œโ”€โ”€ CodeSpirit.Charts/               # Smart Chart Component
โ”‚   โ”œโ”€โ”€ CodeSpirit.ConfigCenter.Client/ # Configuration Center Client
โ”‚   โ”œโ”€โ”€ CodeSpirit.LLM/                  # Large Language Model Integration
โ”‚   โ”œโ”€โ”€ CodeSpirit.Messaging/            # Message Queue Component
โ”‚   โ”œโ”€โ”€ CodeSpirit.MultiTenant/          # Multi-Tenancy Component
โ”‚   โ”œโ”€โ”€ CodeSpirit.Navigation/           # Navigation Component
โ”‚   โ”œโ”€โ”€ CodeSpirit.PdfGeneration/        # PDF Generation Component
โ”‚   โ”œโ”€โ”€ CodeSpirit.ScheduledTasks/       # Scheduled Tasks Component
โ”‚   โ”œโ”€โ”€ CodeSpirit.Settings/             # Settings Management Component
โ”‚   โ”œโ”€โ”€ CodeSpirit.Shared/               # Component Shared Library
โ”‚   โ””โ”€โ”€ CodeSpirit.UdlCards/             # UDL Cards Component
โ”œโ”€โ”€ CodeSpirit.AppHost/                   # Aspire Application Host (Startup Project)
โ”œโ”€โ”€ CodeSpirit.Core/                      # Core Framework Definitions
โ”œโ”€โ”€ CodeSpirit.ServiceDefaults/           # Service Default Configuration
โ”œโ”€โ”€ CodeSpirit.Shared/                    # Global Shared Library
โ”œโ”€โ”€ CodeSpirit.Web/                       # Web Frontend Project
โ””โ”€โ”€ Tests/                                # Test Project Collection
    โ”œโ”€โ”€ ApiServices/                      # API Service Tests
    โ”‚   โ”œโ”€โ”€ CodeSpirit.IdentityApi.Tests/
    โ”‚   โ””โ”€โ”€ CodeSpirit.ExamApi.Tests/
    โ”œโ”€โ”€ Components/                       # Component Tests
    โ”‚   โ”œโ”€โ”€ CodeSpirit.Aggregator.Tests/
    โ”‚   โ”œโ”€โ”€ CodeSpirit.Authorization.Tests/
    โ”‚   โ”œโ”€โ”€ CodeSpirit.Caching.Tests/
    โ”‚   โ”œโ”€โ”€ CodeSpirit.Charts.Tests/
    โ”‚   โ””โ”€โ”€ ... (Other Component Tests)
    โ”œโ”€โ”€ Shared/                           # Shared Test Infrastructure
    โ”‚   โ”œโ”€โ”€ CodeSpirit.Shared.Tests/
    โ”‚   โ””โ”€โ”€ CodeSpirit.Components.TestsBase/
    โ”œโ”€โ”€ Infrastructure/                   # Infrastructure Tests
    โ”‚   โ””โ”€โ”€ CodeSpirit.PdfGeneration.Tests/
    โ””โ”€โ”€ LoadTests/                        # Performance Load Tests
        โ””โ”€โ”€ CodeSpirit.ExamApi.LoadTests/

Functional Architecture Overview

I. AI-Enhanced Features ๐Ÿค–

CodeSpirit provides a complete AI integration solution covering the full chain from basic LLM calls to intelligent business applications.

Core Components:

  • CodeSpirit.LLM: Unified LLM interface supporting OpenAI, Alibaba Qwen, DeepSeek and other models, providing advanced features like structured task processing, batch processing, and intelligent JSON repair
  • AI Form Intelligent Fill โญ: Industry-first! Just one attribute tag [AiFormFill] automatically generates AI fill endpoints without writing controller code, boosting development efficiency by 10x+
  • AI Import Wizard: Intelligent text parsing, batch AI review, visual preview, supporting automatic recognition and correction of multiple question formats
  • LLM Audit Tracking: Complete AI decision traceability, recording prompts, responses, costs, performance metrics, supporting dual storage with Elasticsearch and GreptimeDB
  • AI Smart Tool System: Four-stage progressive tool selection (keywords โ†’ vector search โ†’ LLM classification โ†’ LLM selection), intelligent tool recommendation and configuration generation
  • AI Partner System: Server-side intelligent dialogue platform supporting Function Calling, providing scenario-based AI assistants (exam analyst, question creator, etc.)
  • AI Long-Running Task Handling: Complete task management and progress tracking, supporting multi-step interface display and real-time polling

Performance Optimization Strategies:

  • ๐Ÿš€ Multi-level caching strategy (L1 memory + L2 Redis), intelligent degradation mechanism
  • ๐Ÿ“ฆ Request merging and batch processing, reducing API call costs
  • ๐ŸŒŠ Streaming response optimization, improving user experience
  • โšก Intelligent batching and concurrency control, supporting large-scale data processing

See CodeSpirit AI Feature Deep Dive for details

II. Intelligent UI Generation Engine

1. Dynamic Navigation System

  • Intelligent Permission Adaptation: Automatic synchronization with RBAC permission model for dynamic menu rendering
  • Multi-level Navigation Support: Global navigation(vNext)/local navigation hybrid architecture

2. Zero-Code CRUD Generation

Module Capabilities
Smart Forms 20+ field type automatic mapping, including complex scenarios like image upload and Excel import
Smart Tables Nested data presentation, column configuration hot reload, real-time quick editing
Batch Processing Excel template import/export, multi-format data validation, visual data correction
Extended Operation System Custom operation buttons, multi-step approval flows, permission-based context-sensitive operations

Note: Zero-code here refers to zero frontend code.

3. Intelligent Chart Analysis Module

  • Dynamic Chart Engine: Automatically matches optimal visualization solutions based on data characteristics
  • SQL2API: Generate API interfaces from SQL
  • SQL2Chart: Generate charts based on SQL
  • Intelligent Time Dimension: Support automatic year-over-year/month-over-month calculations, intelligent time granularity adaptation
  • Multi-data Source Aggregation: SQL/NoSQL hybrid data source joint analysis

4. Zero-Code H5 Generation (VNext)

  • Smart Forms
  • Smart Charts

5. UDL (UI Description Language) Engine ๐Ÿ†•

UDL (UI Description Language) is a unified UI description language in the CodeSpirit framework, achieving "define once, use everywhere" cross-platform UI consistency development.

Core Features:

  • Unified Description Specification: Standardized UI description format supporting Web, mobile, large screen and other multi-modal outputs
  • Intelligent Metadata Generation: Automatically generate UI configuration based on API Controllers with zero frontend coding
  • UDL Cards Components: Predefined card template library (student profile card, statistics card, action card, answer card, etc.)
  • Multi-platform Rendering: Unified configuration, automatically adapting to different rendering engines like AMIS, MAUI
  • Application Scenarios: Exam monitoring dashboard, exam client, management backend data panels and operation interface auto-generation

III. Enterprise-Grade Backend Architecture

1. Unified Startup Framework ๐Ÿš€

Program.cs requires only 2 lines of code to complete API project configuration, automatic service registration based on Scrutor, standardized configuration class pattern, providing 3 precise middleware injection points, automatic database migration.

2. Automatic Dependency Injection ๐Ÿ”

Zero-configuration batch service registration, automatically identifying lifecycle through marker interfaces (IScopedDependency, ISingletonDependency), convention over configuration.

3. Multi-Database Support ๐Ÿ—„๏ธ

Flexible switching between MySQL and SQL Server, independent migration management (BaseDbContext โ†’ MySqlDbContext / SqlServerDbContext), completely decoupled business code, automatic migration application.

4. Event-Driven Architecture ๐Ÿ“ก

RabbitMQ-based distributed event system, supporting tenant-awareness, asynchronous decoupling, event sourcing, cross-service communication, reliable message delivery guarantee.

5. Core Framework Features

  • Cloud-Native Foundation: Native k8s support, deep integration with .NET Aspire, native support for Dapr distributed architecture
  • Security System: Four-layer defense system (Authentication/Authorization/Audit/Encryption)
  • High-Performance Guarantee: Distributed caching, automatic second-level caching, intelligent query optimization

6. Key Functional Components

Permission system (RBAC+ABAC), ORM extensions (soft delete/audit/multi-tenancy), data filters, audit service, health checks, distributed locks, configuration center, aggregator, PDF generation, time processing, image processing, file storage, etc. - all out-of-the-box

IV. Out-of-the-Box Functional Modules

  • User Center: Multi-factor authentication, organization management, fine-grained permission control (RBAC+ABAC hybrid model)
  • Audit Center: Operation log tracing, data change tracking, security compliance reporting (Elasticsearch storage)
  • Configuration Center: Multi-environment configuration management, version control, dynamic updates (built-in implementation)
  • Exam System: Complete exam management, question bank management, score analysis, AI question generation (complete case)
  • Survey System: Survey design, data collection, statistical analysis

Core Advantages

  • โœ… Fully Open Code: Generated code is fully controllable, supporting base architecture customization
  • โœ… Native Performance: No interpretation execution overhead, native code-level performance
  • โœ… Ultimate Efficiency: 8x improvement in frontend-backend integration, 12x improvement in form development, permission system out-of-the-box
  • โœ… Cloud-Native Deployment: Hybrid cloud/on-premises deployment, native Kubernetes support

Try Now

https://codespirit-app.xin-lai.com/

Please follow "้บฆๆ‰ฃ่ŠๆŠ€ๆœฏ" WeChat Official Account for the latest demo account and password.

Quick Start

  1. Install and start Docker Desktop

  2. Set CodeSpirit.AppHost as the startup project

  3. Start (Docker images like redis, seq, rabbitmq will be pulled during startup. If unable to pull, please use acceleration methods)

    Note: Currently based on .NET Aspire 13.0 to simplify orchestration, service discovery, environment variables, and container settings configuration for distributed application development, making it easier to manage during the development phase.

Development Documentation

๐Ÿ“˜ Core Documentation

  1. ๐Ÿค– CodeSpirit AI Feature Deep Dive - Detailed introduction to AI-related core features and innovations โญ
  2. ๐Ÿ’Ž CodeSpirit Framework Core Highlights - Framework technical architecture, core components and best practices โญ
  3. ๐Ÿ—๏ธ Project Overall Architecture Design - Overall project architecture design and principles | ไธญๆ–‡็‰ˆ
  4. ๐Ÿ—๏ธ Overall Technical System Overview - Technical architecture and design philosophy | ไธญๆ–‡็‰ˆ
  5. ๐Ÿ”ง Development Environment Setup Guide - Complete development environment configuration guide | ไธญๆ–‡็‰ˆ
  6. ๐Ÿ’Ž CodeSpirit.Core Core Framework - Core framework components and architecture | ไธญๆ–‡็‰ˆ
  7. โš ๏ธ CodeSpirit Unified Exception Handling Guide - Enterprise-level exception handling mechanisms and AMIS API compatibility | ไธญๆ–‡็‰ˆ
  8. ๐Ÿ’ป CRUD Development Example - Complete CRUD development example based on QuestionCategory module โญ | ไธญๆ–‡็‰ˆ
  9. ๐ŸŒ Internationalization (i18n) Guide - Multi-language support and localization guide | ไธญๆ–‡็‰ˆ
  10. โ˜๏ธ Alibaba Cloud Qwen Free Trial Guide - Zero-cost AI experience with detailed setup guide | ไธญๆ–‡็‰ˆ
  11. ๐ŸŽฏ AMIS UI Generation Engine - Intelligent UI generation core component
  12. ๐Ÿ‘ฎ Authorization Component - Comprehensive permission system with RBAC+ABAC hybrid model
  13. ๐Ÿš€ Unified Startup Framework Usage Guide - Unified API project startup framework, simplifying project creation and configuration
  14. ๐Ÿ“š Exam System Complete Documentation - Business-oriented comprehensive guide covering roles, functions, processes and scenarios | ไธญๆ–‡็‰ˆ

๐Ÿ“š Complete Documentation Navigation

Detailed documentation has been organized by functional modules, containing 80+ technical documents:

  • Core Framework: Technical architecture, unified exception handling, multi-database support, event-driven, etc.
  • UI Generation: AMIS engine, UDL Cards, smart charts, form components, etc.
  • Core Components: AI form fill, navigation, audit, caching, scheduled tasks, PDF generation, etc.
  • Identity & Authorization: JWT authentication, RBAC/ABAC permissions, organization management, etc.
  • Multi-Tenancy: Tenant resolver, data isolation, tenant-aware event system, etc.
  • Infrastructure: RabbitMQ, Elasticsearch, Aspire integration, database migration, etc.

Complete documentation list available in subdirectories:

๐Ÿš€ Sponsorship & Technical Support

Open Source Project Support

CodeSpirit is a fully open-source project. We are committed to providing high-quality low-code development frameworks for the developer community. If this project is helpful to you, please consider giving us a โญ Star, or support the continuous development of the project through the following methods:

๐Ÿ’ฐ Sponsorship Methods

Personal Sponsorship

  • Support continuous project updates and maintenance
  • Promote new feature development and performance optimization
  • Help build a better developer community

Sponsorship Benefits

  • ๐Ÿ’ฌ Sponsor $100: Get one one-on-one communication and guidance opportunity to answer technical questions and provide architecture advice
  • ๐ŸŽฏ Sponsor $1000: Get free commercial license for commercial project development and deployment

PayPal Sponsorship: https://paypal.me/magicodes

Thank you to every supporter and contributor! Your support is the driving force behind our continuous progress! ๐Ÿ™

About

CodeSpirit is a revolutionary full-stack low-code + AI development framework that achieves backend-driven full-stack development paradigm through intelligent code generation engine and deep AI collaboration.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •