How lesis-lat/templates-microservice works
Project type and purpose
• This is a lightweight HTTP microservice (“Vulnerabilities Templates Micro‑service”) written in Perl (Mojolicious), which reads YAML templates from disk and exposes them via RESTful JSON endpoints.
• Its sole responsibility is to serve vulnerability‐report templates over HTTP, making it a specialized back‑end service with no front‑end UI or database.
File structure
• Top‑level files:
• app.pl – the Mojolicious application entry point (routes, controllers, JSON rendering)
• cpanfile – declares Perl module dependencies
• Dockerfile – containerizes the service
• .github/workflows/* – CI/CD pipelines for linting, security scanning, container builds
• Key folder:
• templates/ – contains ~50+ YAML files, each describing a vulnerability template
• No “frontend”, no database directories—everything is in a single service.
README for additional insights
• The service runs as a standalone HTTP daemon (default port 9090 mapping to container port 80)
• Deployment methods: direct Perl invocation or Docker container
• CI pipelines enforce code quality and security gates
Diagramming recommendations
• Rectangles for services (API, CI/CD, container runtime)
• Parallelogram for external entities (Clients, Load Balancer)
• Blue for runtime components (service, container)
• Green for infrastructure/ops (CI/CD pipelines, orchestrator)
• Orange for data/config stores (templates folder)
• Client → Service (requests)
• Service → Templates store (read)
• Service → Client (JSON response)
• GitHub Actions → Docker registry → Runtime platform
Essential architectural elements
• Statelessness: no DB, so multiple instances can run in parallel.
• Immutability of templates on disk—versioned via Git and baked into the image.
• CI/GitHub Actions workflows as an integral part of the delivery pipeline.
• Don’t overcomplicate: the service’s core is really “HTTP in → YAML load → JSON out.”