Skip to main content

Employee Service Project Structure

Summary

The service uses one web project organized into API, Application, Domain, Infrastructure, Contracts, documentation, and host/configuration files.

Audience

  • Backend developers
  • QA engineers and solution architects reviewing source ownership

Reference Content

employee-service/
├── Api/
├── Application/
│ ├── Behaviors/
│ ├── Commands/
│ ├── Common/
│ ├── Employees/
│ ├── Mappings/
│ ├── Organization/
│ ├── Queries/
│ ├── Search/
│ └── Validators/
├── Contracts/
├── Domain/
│ ├── Common/
│ ├── Employees/
│ └── Organization/
├── Infrastructure/
│ └── Migrations/
├── Properties/
├── docs/
├── Program.cs
├── employee-service.csproj
└── appsettings*.json

Folder responsibilities

  • Api/: presentation mapping, result translation, and compatibility/direct surfaces. Endpoint catalog details are intentionally deferred.
  • Application/: DTOs, custom CQRS contracts, handlers, application services, mappings, search port, queries, commands, and validators.
  • Domain/: aggregate roots, child entities, organization aggregates, value objects, domain primitives, invariants, domain events, and repository ports.
  • Infrastructure/: EF Core context, repository implementations, unit of work, audit adapter, tenant context, outbox store, search adapter, migrations, and development seed support.
  • Contracts/: currently a guidance placeholder for future service-local public contracts. Shared integration contracts are referenced from the separate contracts project.
  • docs/: source-adjacent domain and compatibility notes.
  • Program.cs: composition root, middleware pipeline, authentication/authorization registration, migration startup, health registration, and endpoint-map registration.
  • appsettings*.json: configuration categories. Values are not documented here.

Areas without dedicated folders

There is no local Messaging/ folder; messaging abstractions come from the shared kernel and outbox translation is in Infrastructure. There is no separate Persistence/ folder; persistence code is in Infrastructure. There is no Configuration/ folder; configuration is composed in Program.cs and host configuration files.

The Application/Behaviors directory contains only future guidance; no pipeline behavior implementation is present.

Source References

  • microservices/src/employee-service/
  • microservices/src/employee-service/Application/Behaviors/README.md
  • microservices/src/employee-service/Contracts/README.md

See Also

Keywords

  • Source tree
  • Folder ownership
  • Service layout

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-15
  • Review cycle: Quarterly