This repository demonstrates my expertise in various architectures and design patterns, including:
- API Design
- Clean Architecture
- Domain-Driven Design (DDD)
- Command Query Responsibility Segregation (CQRS)
- MediatR
- Specifications Pattern
- Repository Pattern
The project is built over multiple layers, each with a different responsibility, following the principles of Clean Architecture:
- Responsible for exposing data, allowing third parties to make calls to the endpoints and GET or POST data.
- Utilizes the MediatR pattern to facilitate communication between endpoints and backend services, ensuring cleaner and more organized code.
- Contains the core business logic, including models and services such as the Reservation service, following Domain-Driven Design (DDD) principles.
- Manages data repositories, providing methods to add, remove, or list data. The Flight and Promotion repositories are seeded from JSON files whenever you run the application, implementing the Repository pattern.
- Used to encapsulate the logic of querying data, making the code more readable and maintainable.
- Separates the read and write operations to optimize performance and scalability.
- The API exposes the following operations (see appendixes for further details):
- GET /Flight: Used to search for available flights on a certain date between two different locations.
- POST /Reservation: Used to create a reservation in the system.
- GET /Reservation: Used to retrieve a reservation previously made.
- Every endpoint returns appropriate error messages when the operation cannot be achieved for some reason.
- For storage, we use in-memory collections to avoid external dependencies.
- For the initial data state, use the provided JSON.
You can explore the API using Swagger UI at: http://localhost:5005/swagger/index.html