Skip to content

Infrastructure Layer

The Infrastructure Layer implements technical concerns that support the application: database adapters, external services, and framework integrations.

In This Section

Repository Implementations

Implementation Use Case
InMemory Unit testing, prototyping
Sqlite Development, small applications
Mysql Production workloads
Postgresql Production with advanced features

Each module provides repository implementations for all supported databases. Configure in .env:

DATABASE_TYPE=Sqlite
DATABASE_PATH=/path/to/database.sqlite

Dependency Rule

Infrastructure depends on Domain and Application layers:

✅ Infrastructure → Application → Domain
❌ Domain → Infrastructure

Application code depends on interfaces (ports); infrastructure provides implementations (adapters).