Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
<PackageVersion Condition=" ('$(signalR)' == 'true' OR '$(signalR)' == '') OR ('$(database)' == 'PostgreSQL' OR '$(database)' == '') OR ('$(database)' == 'SqlServer' OR '$(database)' == '') " Include="Microsoft.Extensions.AI" Version="10.1.1" />
<PackageVersion Condition=" ('$(signalR)' == 'true' OR '$(signalR)' == '') OR ('$(database)' == 'PostgreSQL' OR '$(database)' == '') OR ('$(database)' == 'SqlServer' OR '$(database)' == '') " Include="Microsoft.Extensions.AI.OpenAI" Version="10.1.1-preview.1.25612.2" />
<PackageVersion Condition=" ('$(signalR)' == 'true' OR '$(signalR)' == '') OR ('$(database)' == 'PostgreSQL' OR '$(database)' == '') OR ('$(database)' == 'SqlServer' OR '$(database)' == '') " Include="Microsoft.Extensions.AI.AzureAIInference" Version="10.0.0-preview.1.25559.3" />
<PackageVersion Condition=" ('$(signalR)' == 'true' OR '$(signalR)' == '') OR ('$(database)' == 'PostgreSQL' OR '$(database)' == '') OR ('$(database)' == 'SqlServer' OR '$(database)' == '') " Include="SmartComponents.LocalEmbeddings.SemanticKernel" Version="0.1.0-preview10148" />
<PackageVersion Condition=" ('$(signalR)' == 'true' OR '$(signalR)' == '') OR ('$(database)' == 'PostgreSQL' OR '$(database)' == '') OR ('$(database)' == 'SqlServer' OR '$(database)' == '') " Include="Microsoft.SemanticKernel.Connectors.HuggingFace" Version="1.68.0-preview" />
<PackageVersion Condition=" ('$(signalR)' == 'true' OR '$(signalR)' == '') OR ('$(database)' == 'PostgreSQL' OR '$(database)' == '') OR ('$(database)' == 'SqlServer' OR '$(database)' == '') " Include="Microsoft.SemanticKernel.Core" Version="1.68.0" />
<PackageVersion Condition=" ('$(database)' == 'PostgreSQL' OR '$(database)' == '') " Include="Pgvector.EntityFrameworkCore" Version="0.3.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
<PackageReference Condition=" ('$(signalR)' == 'true' OR '$(signalR)' == '') OR ('$(database)' == 'PostgreSQL' OR '$(database)' == '') OR ('$(database)' == 'SqlServer' OR '$(database)' == '') " Include="Microsoft.Extensions.AI.AzureAIInference" />
<PackageReference Condition=" ('$(signalR)' == 'true' OR '$(signalR)' == '') OR ('$(database)' == 'PostgreSQL' OR '$(database)' == '') OR ('$(database)' == 'SqlServer' OR '$(database)' == '') " Include="Microsoft.Extensions.AI.OpenAI" />
<PackageReference Condition=" ('$(signalR)' == 'true' OR '$(signalR)' == '') OR ('$(database)' == 'PostgreSQL' OR '$(database)' == '') OR ('$(database)' == 'SqlServer' OR '$(database)' == '') " Include="Microsoft.SemanticKernel.Core" />
<PackageReference Condition=" ('$(signalR)' == 'true' OR '$(signalR)' == '') OR ('$(database)' == 'PostgreSQL' OR '$(database)' == '') OR ('$(database)' == 'SqlServer' OR '$(database)' == '') " Include="SmartComponents.LocalEmbeddings.SemanticKernel" />
<PackageReference Condition=" ('$(signalR)' == 'true' OR '$(signalR)' == '') OR ('$(database)' == 'PostgreSQL' OR '$(database)' == '') OR ('$(database)' == 'SqlServer' OR '$(database)' == '') " Include="Microsoft.SemanticKernel.Connectors.HuggingFace" />
<PackageReference Condition=" ('$(database)' == 'PostgreSQL' OR '$(database)' == '') " Include="Pgvector.EntityFrameworkCore" />
<Using Include="Microsoft.EntityFrameworkCore.Migrations" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
//#if (signalR == true || database == "PostgreSQL" || database == "SqlServer")
using System.ClientModel.Primitives;
using Microsoft.SemanticKernel.Embeddings;
using SmartComponents.LocalEmbeddings.SemanticKernel;
//#endif
//#if (database == "PostgreSQL")
using Npgsql;
//#endif
//#if (database == "Sqlite")
using Microsoft.Data.Sqlite;
Expand Down Expand Up @@ -277,6 +279,7 @@ void AddDbContext(DbContextOptionsBuilder options)
});
//#elif (database == "PostgreSQL")
var dataSourceBuilder = new Npgsql.NpgsqlDataSourceBuilder(configuration.GetRequiredConnectionString("postgresdb"));
dataSourceBuilder.UseVector();
dataSourceBuilder.EnableDynamicJson();
options.UseNpgsql(dataSourceBuilder.Build(), dbOptions =>
{
Expand Down Expand Up @@ -498,14 +501,6 @@ void AddDbContext(DbContextOptionsBuilder options)
.UseOpenTelemetry();
// .UseDistributedCache()
}
else
{
services.AddEmbeddingGenerator(sp => new LocalTextEmbeddingGenerationService()
.AsEmbeddingGenerator())
.UseLogging()
.UseOpenTelemetry();
// .UseDistributedCache()
}
//#endif

builder.Services.AddHangfire(configuration =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
},
"HuggingFace": {
"EmbeddingApiKey": null,
"EmbeddingEndpoint": null
"EmbeddingEndpoint": "http://localhost:7000",
"EmbeddingModel__Comment": "Run locally using `docker run -d --restart unless-stopped --name tei-embedding -p 7000:80 -v tei_data:/data ghcr.io/huggingface/text-embeddings-inference:cpu-1.8 --model-id BAAI/bge-small-en-v1.5`"
}
},
//#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Keycloak Realm Configuration

## Overview

This directory contains the Keycloak realm configuration file (`dev-realm.json`) used by the Boilerplate. Keycloak is an **optional** open-source identity and access management solution that provides enterprise-grade authentication and authorization features.

## What is Keycloak?

Keycloak is a free, open-source identity server that provides:

- **Centralized User Management**: Manage users, credentials, roles, and groups from a single location
- **Single Sign-On (SSO)**: Allow users to authenticate once and access multiple applications
- **Identity Brokering**: Integrate with external identity providers (LDAP, Active Directory, etc.)
- **Fine-Grained Authorization**: Define and enforce complex access control policies
- **Standards-Based**: Supports OpenID Connect, OAuth 2.0, and SAML 2.0 protocols

## Keycloak in .NET Aspire

When you run the Boilerplate project with .NET Aspire enabled (default configuration), Keycloak is automatically started as a containerized service. This provides a complete identity server for development and testing without any manual setup.

The Keycloak container is configured in `Program.cs`:

```csharp
var keycloak = builder.AddKeycloak("keycloak", 8080)
.WithDataVolume()
.WithRealmImport("./Realms");
```

For more information, checkout .docs/07- ASP.NET Core Identity - Authentication & Authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"HuggingFace": {
"EmbeddingApiKey": null,
"EmbeddingEndpoint": null
"EmbeddingEndpoint": "http://localhost:7000"
}
},
"Email": {
Expand Down
Loading