How yuzutech/kroki works
Main Components
a. API Gateway (Server):
• ‘server’ module as the central component. This Java web server (built using Maven and powered by Vert.x) exposes REST endpoints that accept HTTP GET and POST requests.
• It handles authentication, request decoding (using deflate + base64 encoding), logging, error handling, and routing.
b. Companion Services:
c. Build and Deployment Infrastructure:
• The Maven build system for the Java components.
• TaskRunner (using Taskfile) to coordinate Maven builds and Docker image builds.
• Docker images and Docker Compose orchestration, which define how the gateway and multiple companion containers interact.
d. External Interfaces:
• CI/CD pipelines (GitHub Actions workflows) to run tests and build images.
• External configuration via environment variables (for instance, KROKI_MERMAID_HOST, etc.) that link the gateway with its companion containers.
Relationships & Interactions
c. Optionally, indicate the feedback paths (responses with rendered images like SVG, PNG, etc.) returning from the companion services back to the gateway and ultimately to the client.
d. An indication of logging, error handling, and caching strategies incorporated by the gateway.
Architectural Patterns & Technologies
a. Use the API Gateway pattern as the core design principle – the gateway centralizes client interaction and dispatches requests to microservices.
b. Pattern-wise, this is a microservices-based design: the companion services are independent, containerized, and separately deployable.
c. Technologies to highlight:
– Java, Vert.x, and Maven for the server.
– Node.js and micro for companion services.
– Docker (and Docker Compose) as the container orchestration tool.
– Task (the build tool) for automation.
– GitHub Actions for CI/CD.