How alexandrebruno/ocr.aivision works
Main Components
• API Layer (Presentation):
• OCR.AIVision.Api project as the entry point for external requests.
• Endpoints (e.g., OCREndpoints.cs) defining routes such as POST /OCR/ProcessarImagemDeStringBase64 and /OCR/ProcessarImagemDeArquivo.
• That this layer uses Minimal API concepts and acts as the interface for client interactions.
• Application Layer (Business Logic):
• OCR.AIVision.Application project which handles dependency injection (ServiceConfig.cs), helper functions, and service implementations (OCRService.cs).
• Role of interfaces (IOCRService.cs) to abstract business logic.
• Domain Layer:
• OCR.AIVision.Domain project containing the core entities (OCRRequest and OCRResponse) and configuration files (oci.config).
• Role in modeling the problem domain and encapsulating core business rules.
• External Integrations:
• External services like Oracle AI Vision, accessed via the OCI.DotNetSDK libraries (OCI.DotNetSDK.Aivision and OCI.DotNetSDK.Common).
• Configuration files necessary for Oracle authentication (oci.pem and oci.config) and application settings (appsettings.json).
Relationships and Interactions
• Client requests hit the API endpoint, which then delegates calls to the Application layer.
• The Application layer implements business logic and calls into the Domain layer as needed (e.g., mapping OCRRequest/Response).
• The Application layer communicates with Oracle AI Vision via the SDK, sending images (base64 encoded or file uploads) for processing.
• How responses with objects like OCRResponse (including the CorrelationId) are passed back through the layers to the client.
Architectural Patterns and Principles
• DDD: Demonstrate separation between the Domain (pure business model), the Application (services and orchestration), and the API (interface).
• Minimal API: Reflect that the API layer is designed with minimal overhead.
• Dependency Injection: Mention the Injections/ServiceConfig.cs in the Application layer that wires up the services.
Relevant Technologies, Frameworks, and Libraries
• .NET 8 and Minimal API framework for building lightweight HTTP services.
• Oracle AI Vision SDKs (OCI.DotNetSDK.Aivision, OCI.DotNetSDK.Common) for integrating with external image processing.
• Docker for containerized deployment.
• The configuration management via appsettings.json and Oracle’s config files (oci.config, oci.pem).
Final Detailed Steps
• Next, detail the Domain layer with essential entities and domain rules.
• Finally, connect everything to external Oracle services indicating dependency on OCI SDK libraries.
• And don’t forget to show the Docker container at the outer perimeter if discussing deployment.