UserPermissionApi

A permissions API with relational persistence, Kafka event publishing, Elasticsearch and Docker Compose.

What it is

UserPermissionApi is a REST API for requesting, modifying and querying user permissions. It is small on purpose: the domain is simple so the integration concerns are easy to see.

What it demonstrates

  • Clean Architecture in a single service: Domain, Application, Infrastructure and Api projects with inward dependencies.
  • CQRS with MediatR: write and read operations as separate commands and queries.
  • Event publishing: operations are published to Kafka through Confluent’s client.
  • Search and logging infrastructure: Elasticsearch integration and structured logging with Serilog.
  • Reproducible environment: the API and its dependencies run through Docker Compose.
  • Tests at two levels: a unit test project and an integration test project.

It also uses the DSR.Architecture packages for its base types, repositories and unit of work.

Status

A personal open-source project. The description above follows the repository’s README.

Components

Service

  • UserPermission.Domain

    Permission and permission-type entities, repository interfaces and domain logic.

  • UserPermission.Application

    Use cases with CQRS through MediatR.

  • UserPermission.Infrastructure

    EF Core repositories, Kafka messaging and Elasticsearch integration.

  • UserPermission.Api

    ASP.NET Core 9 REST API entry point.

Tests

  • UserPermission.Test

    Unit tests.

  • UserPermission.IntegrationTests

    Integration tests running against an in-memory SQLite database.

Back to Open Source

Have a system to design or an experience to build?

I am open to conversations about engineering roles, architecture and web projects.