This folder contains the components of the Infrastructure Layer of the project. The Infrastructure Layer is responsible for providing concrete implementations of various services, such as data persistence, message queues, and external APIs.
The Infrastructure Layer is organized into the following sub-folders:
adapters
: Contains adapter classes used to convert between different data formats or interfaces.config
: Contains configuration files for various infrastructure components.entities
: Contains entity classes used for data persistence.handlers
: Contains handler classes for various event-driven functionalities, such as API Gateway events, Cognito triggers, and DynamoDB streams.helpers
: Contains helper classes and functions used in the infrastructure layer.mappers
: Contains mapper classes for converting between domain entities and infrastructure entities.providers
: Contains classes responsible for providing instances of infrastructure services.repositories
: Contains concrete implementations of repository interfaces for data persistence.services
: Contains concrete implementations of domain services, such as authentication and user management.
The components in the Infrastructure Layer are responsible for:
- Implementing concrete services used by the Application and Domain Layers.
- Managing data persistence through repositories.
- Handling external system interactions, such as messaging and API calls.
When working with the Infrastructure Layer, follow these best practices:
- Keep the Infrastructure Layer decoupled from the Application and Domain Layers.
- Use adapters and mappers to convert between different data formats or interfaces.
- Ensure that infrastructure concerns, such as data persistence and external system interactions, are separated from business logic.
- Follow the Dependency Inversion Principle to enable easier testing and maintainability.
When adding new functionality to the Infrastructure Layer, ensure that you:
- Follow the existing project structure and organization.
- Update this README.md file if needed.
- Write tests for new components and functionality.
- Adhere to the project's coding style and best practices.