Skip to main content

Architecture & Dependency Diagram

This page describes the project architecture and how the major layers depend on each other.

Dependency Diagram

┌──────────────────────────────────────────────────────────────────────────────┐
│ Application hosts │
│ │
│ CrestApps.Core.Mvc.Web Aspire AppHost Custom MVC / Razor / Blazor app │
└───────────────────────────────┬──────────────────────────────────────────────┘


┌──────────────────────────────────────────────────────────────────────────────┐
│ Core foundation │
│ │
│ CrestApps.Core CrestApps.Core.Abstractions │
│ CrestApps.Core.Infrastructure CrestApps.Core.Infrastructure.Abstractions │
└───────────────────────────────┬──────────────────────────────────────────────┘


┌──────────────────────────────────────────────────────────────────────────────┐
│ AI runtime and feature packages │
│ │
│ AI runtime Chat A2A MCP SignalR Templates Copilot Markdown │
│ Azure utilities │
└───────────────────────────────┬──────────────────────────────────────────────┘

┌───────────────┴────────────────┬─────────────────────────────┐
▼ ▼ ▼
┌──────────────────────────────┐ ┌──────────────────────────────┐ ┌──────────────────────────────┐
│ Provider integrations │ │ Search and data sources │ │ Storage implementations │
│ │ │ │ │ │
│ OpenAI / Azure OpenAI │ │ Azure AI Search │ │ Entity Framework Core │
│ Ollama / Azure AI Inference │ │ Elasticsearch │ │ YesSql │
│ PDF / OpenXml / FTP / SFTP │ │ │ │ │
└──────────────────────────────┘ └──────────────────────────────┘ └──────────────────────────────┘

Layer Descriptions

ProjectRole
CrestApps.Core.AbstractionsCore interfaces: ICatalog<T>, INamedEntity, ExtensibleEntity, IODataValidator
CrestApps.Core.AI.AbstractionsAI interfaces: IAICompletionService, IAIProfileManager, IOrchestrator, models
CrestApps.CoreDefault implementations of core abstractions, IServiceCollection extensions
CrestApps.Core.AIAI orchestration, DefaultOrchestrator, tool execution, completion services
CrestApps.Core.AI.ChatChat session management, prompt storage, IAIChatSessionManager
CrestApps.Core.AI.DocumentsDocument ingestion, uploaded-file storage abstraction, document tools, and document RAG
CrestApps.Core.AI.OpenAIOpenAI provider (ChatClient, streaming, tool calls)
CrestApps.Core.AI.OpenAI.AzureAzure OpenAI provider with data source integration
CrestApps.Core.AI.OllamaOllama provider for locally hosted LLMs
CrestApps.Core.AI.AzureAIInferenceAzure AI Inference / GitHub Models provider
CrestApps.Core.AI.CopilotGitHub Copilot chat orchestration, OAuth flow, credential management
CrestApps.Core.Azure.AISearchAzure AI Search provider primitives for client setup, index management, document management, and OData filters
CrestApps.Core.AI.Azure.AISearchAzure AI Search integration for AI document index profiles, AI memory search, and AI data-source registrations
CrestApps.Core.ElasticsearchElasticsearch provider primitives for client setup, index management, document management, and query/filter translation
CrestApps.Core.AI.ElasticsearchElasticsearch integration for AI document index profiles, AI memory search, and AI data-source registrations
CrestApps.Core.AI.McpModel Context Protocol (MCP) client and server
CrestApps.Core.AI.Mcp.FtpFTP/FTPS MCP resource type handler
CrestApps.Core.AI.Mcp.SftpSFTP MCP resource type handler
CrestApps.Core.AzureAzure-specific utilities and integration helpers
CrestApps.Core.SignalRSignalR hub abstractions for real-time AI chat
CrestApps.Core.SupportGeneral utility classes
CrestApps.Core.TemplatesPrompt template engine

Storage layer

ProjectRole
CrestApps.Core.Data.EntityCoreEntity Framework Core-based catalog and store implementation
CrestApps.Core.Data.YesSqlYesSql-based document catalog implementation (SQLite, PostgreSQL, SQL Server)

Application layer

ProjectRole
CrestApps.Core.Mvc.WebStandalone ASP.NET Core MVC application with full admin UI
Blazor / OtherBlazor Server/WASM (CrestApps.Core.Blazor.Web), minimal APIs, etc.

Data Flow

User → UI (MVC/Blazor/OC) → SignalR Hub → Orchestrator → AI Provider → LLM
↓ ↑
Session Manager ←──── Prompt Store ────┘

YesSql / Custom Store
  1. User sends a message via the UI (browser)
  2. SignalR Hub receives the message and resolves the AI profile
  3. Orchestrator builds the conversation context (system prompt, history, tools)
  4. AI Provider (OpenAI, Azure, Ollama) streams the response
  5. Prompt Store persists both user and assistant messages
  6. SignalR Hub streams response chunks back to the client

Extensibility Points

InterfacePurposeDefault Implementation
IAICompletionServiceAI provider abstractionOpenAI, Azure OpenAI, Ollama
IOrchestratorControls AI request pipelineDefaultOrchestrator
ICatalog<T>CRUD for named entitiesNamedSourceDocumentCatalog<T> (YesSql)
IAIProfileManagerProfile CRUDDefaultAIProfileManager
IAIChatSessionManagerSession lifecycleYesSql-based implementation
IAIChatSessionPromptStorePrompt persistenceYesSql-based implementation
ICatalogEntryHandler<T>Entity lifecycle hooksPer-provider handlers