AspireIfus is a minimal sample that demonstrates a Blazor WebApp front-end and a separate API service with light AI integration (chat + semantic search) and vector-store support.
This repository contains the following projects:
AspireIfus_ApiService- Minimal API that exposes project data endpoints, integrates with a SQL Server database via Dapper, and provides AI features (chat support + semantic/embedding search) using OpenAI-compatible models and a Qdrant vector collection.AspireIfus.WebApp- Blazor Interactive Server application that consumes the API and displays project lists and funding details. Uses a small typedProjectApiClientfor API calls.AspireIfus.AppHost- (Lightweight host project / shared defaults used by the services)AspireIfus.ServiceDefaults- Project-level helpers and registration extensions.
- .NET 10 SDK
- SQL Server (or compatible) with the expected stored procedures (see Database section)
- Configuration values (API keys, connection string) configured as environment variables or in
appsettings.*
The API expects a SQL connection string named DefaultConnection and the following stored procedures to exist:
GetProjectsById- Returns project rows (used for listing and GetById)GetProjectFundingById- Returns funding allocations for a specific projectGetAllInvestors- (used by the service)GetProjectsSearchAllColumns- Free-text search across project columns
Populate the database with sample projects so the API and semantic search can return meaningful results.
Set the following configuration keys (example options):
ConnectionStrings:DefaultConnection- SQL connection stringGitHubModels:Token- API key for OpenAI-compatible models (the code usesmodels.github.aiendpoint)- Vector DB configuration (Qdrant) - the project calls
builder.AddQdrantClient("vectordb")andAddQdrantCollection("project-vectors"); configure the host/credentials according to your environment. These values can be set via the appsettings used by the shared defaults.
- Open the solution in Visual Studio 2026.
- Ensure
DefaultConnectionandGitHubModels:Tokenare set in user secrets or environment variables. - Start the
AspireIfus_ApiServiceproject first (it hosts the API and AI endpoints). - Start
AspireIfus.WebApp(Blazor) and navigate to/projects.
Recommended: Run both projects concurrently (set multiple startup projects) so the Blazor app can call the API.
The API exposes project related endpoints under /projects:
GET /projects- Get all projectsGET /projects/{id}- Get project by idGET /projects/search/{query}- Database-backed search across projectsGET /projects/support/{query}- AI chat support (returns a short chat response driven by models)GET /projects/aisearch/{query}- Semantic search using embeddings and vector store (Qdrant)
- The AI functionality uses an OpenAI-compatible client configured in
AspireIfus_ApiService/Program.cs. The application expects a token configured atGitHubModels:Tokenand communicates withhttps://models.github.ai/inferenceby default. - The semantic search uses an embedding generator and a Qdrant collection named
project-vectors. Embeddings are generated from project metadata and upserted into the collection automatically inProjectAIService.InitEmbeddingsAsync()when the collection is missing. - The system prompt used for the chat assistant is crafted for green energy analysis and restricts responses to project knowledge base facts. See
ProjectAIServicefor the exact rules.
This repository uses (and references in code) the following libraries, frameworks and concepts:
.NET 10(target framework)Blazor(Interactive Server components)Minimal APIs(MapGroup, IEndpointRouteBuilder, Results)Microsoft.Extensions.AI(chat + embedding abstractions:IChatClient,IEmbeddingGenerator,ChatMessage,ChatRole)OpenAIClient/ OpenAI-compatible client usage (model clients configured inProgram.cs)Microsoft.Extensions.VectorData(vector store types and attributes:VectorStoreCollection,VectorStoreKey,VectorStoreData,VectorStoreVector)Qdrant(vector DB client configured viaAddQdrantClient/AddQdrantCollection)Dapper(data access via stored procedures)Microsoft.Data.SqlClient(SQL Server connections)System.Text.Json(JSON serialization /GetFromJsonAsyncusage)HttpClient(typed clientProjectApiClient)OpenAPI/ Swagger helpers (AddOpenApi,MapOpenApi)Bootstrap(UI script referenced in Blazor page for modal dialogs)Stored Procedures(database access pattern used byDapperContext)
- The Blazor page
Components/Pages/Projects.razorlists projects and supports searching. It can toggle between database search and AI semantic search. - The client code is in
AspireIfus.WebApp/ApiClients/ProjectApiClient.csand calls the API endpoints described above.
- "Missing configuration: GitHubModels:Token." — set
GitHubModels:Tokenin user secrets or environment variables. - Connection errors — verify
DefaultConnectionand that the database is reachable. Confirm the required stored procedures exist. - Qdrant / vector store issues — verify your vector DB is running and the host/credentials are configured in the same configuration used by
AddQdrantClient.
- Add or adjust stored procedures to match your data model.
- To change the model or embedding engine, update
Program.cswhereOpenAIClientis configured and whereGetChatClient/GetEmbeddingClientare selected. ProjectAIServicewill only recommend projects that match the prompt rules and the available project catalog — it will not invent data.
This repository is provided as sample code. No license file is included — add one if you intend to publish or share the project.