How microsoft/nubesgen works
Project Type and Purpose
• NubesGen is an open-source, full-stack “Infrastructure as Code” (IaC) generator. It provides:
• A Java-based CLI (under cli/) for local use.
• A Spring Boot REST server (under rest-server/) that exposes HTTP endpoints to generate and download IaC templates.
• A documentation site (under docs/) built with VuePress.
• A set of Terraform root modules (under terraform/) for provisioning NubesGen itself or sample infrastructure.
• End Users
• CLI Tool
• Web UI or HTTP Client
• Documentation Site
• REST Server
• Controllers (MVC layer)
• Service Layer (CodeGeneratorService, ConfigurationService, TelemetryService, TemplateListService)
• Template Engine & Resource Scanner (Mustache templates under src/main/resources/nubesgen/…)
• Compression Services (Zip, TarGz)
• Template Repository
• Bicep templates
• Terraform modules
• Pulumi templates
• CI/CD & Build Infrastructure
• GitHub Actions workflows
• Docker / Native images (GraalVM Dockerfile)
• Terraform Root Modules
• Container-apps, storage-blob modules for self-deployment
Relationships and Data Flows
• User (CLI or Web UI) → HTTP request → REST Controller
• Controller → delegates to Service Layer → picks configuration & templates
• Service Layer → Template Engine → generates raw files → Compression Service → returns archive
• REST Server → HTTP response with zip/tar artifact
• CLI Tool receives archive → unpacks to local project directory
• CI/CD pipelines → build and publish CLI JARs, REST Docker images, docs site
Architectural Patterns and Principles
• MVC pattern in REST server (Controllers → Services → Utils)
• Template-method pattern for language-specific scanners (JavaScanner, NodeJsScanner, etc.)
• Separation of concerns: CLI vs. server vs. docs vs. Terraform modules
• Mustache templates for code generation (decoupled from Java logic)
• Compression and packaging as pluggable services
Relevant Technologies
• Java 17, Maven, Spring Boot
• Mustache template engine
• GraalVM native build (Dockerfile.native)
• GitHub Actions for CI/CD
• VuePress for docs
• Terraform & Pulumi templates