No description
Find a file
2026-03-03 23:15:17 +05:30
.aspire Init api & aspire with keycloak & sqlserver 2026-02-21 20:36:05 +05:30
.build Add ci config with build step 2026-03-03 23:15:17 +05:30
EmployeeManagement.AppHost Init api & aspire with keycloak & sqlserver 2026-02-21 20:36:05 +05:30
EmployeeManagement.ServiceDefaults Init api & aspire with keycloak & sqlserver 2026-02-21 20:36:05 +05:30
EmployeeManagementService Init api & aspire with keycloak & sqlserver 2026-02-21 20:36:05 +05:30
.gitignore Init api & aspire with keycloak & sqlserver 2026-02-21 20:36:05 +05:30
EmployeeManagement.sln Init api & aspire with keycloak & sqlserver 2026-02-21 20:36:05 +05:30
README.md Add a simple readme 2026-02-22 08:23:59 +05:30

Employee Management Service

An ASP.NET Core 10 Web API orchestrated with .NET Aspire, using SQL Server for persistence and Keycloak for authentication.

Project Structure

EmployeeManagement.sln
├── EmployeeManagement.AppHost          # Aspire orchestrator (entry point)
├── EmployeeManagement.ServiceDefaults  # Shared config: OpenTelemetry, health checks, resilience
└── EmployeeManagementService           # ASP.NET Core Web API

Infrastructure (managed by Aspire)

Resource Details
SQL Server Container-based, database name Employees
Keycloak Container on port 8080, realm auto-imported on startup, data volume persisted

Authentication

Keycloak is configured with the employee-management realm, imported automatically from EmployeeManagement.AppHost/KeycloakConfiguration/employee-management-realm.json.

Client: employee-management-api (confidential, OpenID Connect)

Realm roles: admin, manager, employee

Development Test Users

Username Password Role
admin admin admin
manager manager manager
employee employee employee

These credentials are for local development only.

Prerequisites

Getting Started

# Clone and run
dotnet run --project EmployeeManagement.AppHost

Aspire starts the SQL Server and Keycloak containers, waits for them to be healthy, then launches the API. The Aspire dashboard URL is printed to the console on startup — open it to view resource status, logs, traces, and metrics.

Key Endpoints

Endpoint Description
/openapi/v1.json OpenAPI spec (dev only)
/health Health check
/alive Liveness probe

Tech Stack

  • Framework: ASP.NET Core 10
  • Orchestration: .NET Aspire 13.1
  • Database: SQL Server (via Aspire.Microsoft.EntityFrameworkCore.SqlServer)
  • Auth: Keycloak (via Aspire.Keycloak.Authentication)
  • Observability: OpenTelemetry (traces, metrics, logs)