BookWorm:基于 Aspire 的云原生 AI 多智能体示例项目
foxminchan/BookWorm
BookWorm 是一个用 Aspire 构建的云原生示例项目,采用 DDD 与 VSA 架构,通过 MCP 标准化 AI 工具调用,并支持 A2A 与 AG-UI 协议实现多智能体编排。
Warning
This project is for demo purposes only and is not production-ready.
Introduction
⭐ BookWorm showcases Aspire in a cloud-native application with AI integration. Built with DDD and VSA, it features multi-agent orchestration and standardized AI tooling through MCP with A2A & AG-UI Protocol support.
View Screenshots
Project Goals
- Developed a cloud-native application using Aspire
- Implemented Vertical Slice Architecture with Domain-Driven Design & CQRS
- Enabled service-to-service communication with gRPC
- Incorporated various microservices patterns
- Utilized outbox and inbox patterns to manage commands and events
- Implemented saga patterns for orchestration and choreography
- Integrated event sourcing for storing domain events
- Implemented a microservices chassis for cross-cutting concerns and service infrastructure
- Implemented API versioning and feature flags for flexible application management
- Set up AuthN/AuthZ with Keycloak
- Used Authorization Code Flow with PKCE for user authentication
- Enabled Token Exchange for service-to-service authentication
- Implemented caching with FusionCache
- Incorporated AI components:
- Use Microsoft Foundry for LLM and embeddings
- Orchestrated multi-agent workflows using Agent Framework
- Standardized AI tooling with Model Context Protocol (MCP)
- Enabled agent-to-agent communication via A2A Protocol
- Supported Agent interactions via AG-UI Protocol
- Agent governance with policy-based controls and monitoring
- Enabled AI agents to generate rich, interactive UIs using A2UI
- Configured CI/CD with GitHub Actions
- Created comprehensive documentation:
- Used OpenAPI for REST API & AsyncAPI for event-driven endpoints
- Utilized EventCatalog for centralized architecture documentation
- Built modern client applications:
- Monorepo architecture powered by
Turborepo - Customer-facing storefront and admin backoffice dashboard with
Next.js - Targeted WCAG 2.1 AA accessibility standards (accessibility statement)
- Monorepo architecture powered by
- Established a testing strategy:
- Conducted service unit tests
- Implemented Pact-based contract testing
- Established architecture testing strategy
- Implemented frontend unit tests and component tests
- Conducted end-to-end testing with BDD
Project Architecture
Getting Started
Prerequisites
Required
Optional
- Buf CLI — gRPC schema & codegen
- Spec-Kit — spec-driven development
- GitHub Copilot CLI — AI-assisted development
Note
- Use
mise tasks lsto view available tasks. - Azure Subscription is required for deploying to Azure Container Apps and using Microsoft Foundry.
- Email uses SMTP through MailKit, with Mailpit locally; configure the endpoint and credentials for providers like SendGrid or production SMTP servers.
Run locally
# 1. Clone the repository git clone git@github.com:foxminchan/BookWorm.git # 2. Navigate to the project directory cd BookWorm # 3. Install tools (.NET SDK, Bun, JDK & tools — skip if already installed globally) mise install # 4. Setup Azure subscription and location for deployment aspire secret set "Azure:SubscriptionId" "your-subscription-id" aspire secret set "Azure:Location" "your-location" # 5. First-time setup mise run prepare # 6. Start the application mise run run
Note
On first run, you'll be prompted to enter the required environment variables.
Self-Deploy to Azure
- Authenticate with Azure
az login
- Deploy
aspire deploy
- Get the app URL
az containerapp show --name <app-name> --resource-group <resource-group> \ --query properties.configuration.ingress.fqdn --output tsv
- Clean up resources
az group delete --name <resource-group> --yes --no-wait
- Clean up resources:
To remove all deployed resources and avoid charges:
az group delete --name <resource-group> --yes --no-wait
Documentation
For full documentation, visit the GitHub Wiki.
Contributing
Contributions are welcome — see CONTRIBUTING and CODE OF CONDUCT for details. Thanks to all contributors!
For bugs or feature requests, open an issue.
License
MIT — see LICENSE for details.
来源:GitHub · github.com


