> For the complete documentation index, see [llms.txt](https://framework.aic.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://framework.aic.io/technical-guidelines-code-standards-and-tech-stack/solution-and-architecture-standards/solution-structure.md).

# Solution Structure

## Purpose

A consistent solution structure makes projects easier to understand, build, test, review and hand over.

## Standard Repository Layout

```
repo-root/
  .config/
  .github/ or azure-pipelines/
  docs/
    adr/
    architecture/
    operations/
  eng/
    scripts/
    pipelines/
  src/
    Aic.Product.Api/
    Aic.Product.Application/
    Aic.Product.Domain/
    Aic.Product.Infrastructure/
  tests/
    Aic.Product.Domain.Tests/
    Aic.Product.Application.Tests/
    Aic.Product.Api.Tests/
    Aic.Product.IntegrationTests/
  tools/
  README.md
  global.json
  Directory.Build.props
  Directory.Packages.props
  .editorconfig
  nuget.config
  Aic.Product.sln
```

## Project Naming

Use the pattern:

```
Aic.{ProductOrCustomer}.{Capability}.{Layer}
```

Examples:

```
Aic.GreenWave.CaseManagement.Api
Aic.GreenWave.CaseManagement.Application
Aic.GreenWave.CaseManagement.Domain
Aic.GreenWave.CaseManagement.Infrastructure
Aic.GreenWave.CaseManagement.Desktop
```

## Layer Responsibilities

| Layer           | Responsibility                                                        | Must not contain                              |
| --------------- | --------------------------------------------------------------------- | --------------------------------------------- |
| Domain          | Core business concepts, rules, entities, value objects                | EF Core, HTTP, UI, infrastructure             |
| Application     | Use cases, commands, queries, orchestration, validation               | UI, database-specific logic unless abstracted |
| Infrastructure  | EF Core, external services, messaging, file system, identity adapters | UI logic, core domain decisions               |
| API/Desktop/App | Transport and presentation                                            | Business rules, direct persistence logic      |
| Tests           | Automated verification                                                | Production-only configuration                 |

## Dependency Direction

Dependencies should point inward:

```
API / UI -> Application -> Domain
Infrastructure -> Application / Domain
```

The Domain project should not depend on Infrastructure.

## Build Standard

The solution must build from the root:

```bash
dotnet restore
dotnet build --configuration Release
dotnet test --configuration Release
```

## Documentation Standard

Each repository must include:

* README
* setup instructions
* architecture overview
* build instructions
* test instructions
* deployment notes
* security notes
* support notes
* ADR folder
