How oatpp/example-microservices works
Project Type & Purpose
• This is a microservices architecture example built with Oat++. The key objective is to run individual microservices (book-service, user-service) either as standalone apps listening on specific ports (8001 and 8002 respectively) or as a combined monolithic executable.
• The facade service on port 8000 acts as an orchestrator – merging book and user data to respond to client requests.
Main Components
a. Client/External Consumers: Represent the clients that consume the unified API (e.g., via curl).
b. Facade Service:
• Acts as the API gateway.
• Contains controllers (BookController, UserController) and service logic to merge data from backend services.
• Runs on port 8000.
c. Book-Service:
• Contains its own controller (BookController) and database logic (see the db sub-folder and BookDto).
• Runs on port 8002.
d. User-Service:
• Contains its own controller (UserController) and database logic (see its db folder and UserDto).
• Runs on port 8001.
e. Optional: Monolith Build
• A combined monolith build (monolith/all-services) showing that all microservices can be compiled together.
Architectural Relationships & Interaction
• Incoming API calls arriving at the facade.
• Facade service making HTTP/REST calls or internal calls to book-service and user-service to retrieve respective data.
• Data flow back from both services to the facade, and then finally to the client.
• You may also include deployment/dependency relationships (for example, communication via network ports).
• That Docker is used for containerization (each service has its own Dockerfile) and that CMake is used for building the project.
Technical Stack & Architectural Patterns
• That the services use the Oat++ framework for REST APIs with Swagger integration (SwaggerComponent).
• That the pattern includes a layered structure (controllers, DTOs, database abstraction) which may be depicted with multiple small layers inside each service component.
• Possibility for monolithization – you could have an inset or alternate view showing the consolidated monolith layering all services together.
• Each component should have a clear label.
[Client]
│
▼
[Facade Service (8000)]
│ │
▼ ▼
[User Service (8001)] [Book Service (8002)]
Along with detailed annotations for internal components (controllers, DTOs, database modules) within each service. This approach captures both the microservices pattern and the unique aggregation done by the facade.