r/SpringBoot • u/Spring_AI_Architect • 23d ago
How-To/Tutorial Show Reddit: Built a 100% local, enterprise-grade Spring Boot 3.x service bootstrapper using Spring AI & Ollama (Java 21)
Hey everyone,
As a Java Principal Architect, one of my recurring pain points is the compliance risk and Day-1 friction of bootstrapping new projects. In strict corporate environments, utilizing cloud-hosted LLM APIs to draft initial scaffolding or internal schemas poses massive data privacy and IP leakage risks.
To solve this within the host perimeter, I built OllamaSprout—an automated accelerator designed to translate plain-text domain requirements into production-ready, ready-to-run Java services out-of-the-box.
🚀 What it does
It streams code from a local model and programmatically compiles a complete, valid Maven directory tree directly onto your disk. It generates fully realized structural layers: Controller ➡️ Service ➡️ Repository ➡️ JPA Entity with 100% written code (absolutely zero trailing ellipses ... or // TODO shortcuts).
🛠️ The Architectural Stack
- Framework: Spring Boot 3.x
- AI Integration: Spring AI
- Local Inference Engine: Ollama running
qwen2.5-coder:7b - Language & Build: Java 21 & Maven
🧠 Deep-Tech Optimization Highlights
- Resource Preservation (RAM Reclaiming): To ensure a developer's workstation remains unburdened, the system includes custom orchestration to ensure that once the generation process completes, the system completely reclaims the heavy memory footprint occupied by Ollama.
- Deterministic Parsing & Disk I/O: Safely translates streamed markdown multi-file blocks into structured directories on disk with exact package boundary alignments.
- Eclipse/IntelliJ Target Compliance: The generated
pom.xmluses root schema tags tailored specifically to satisfy Eclipse's offline cache validation rules, avoiding compilation hiccups during network-isolated imports.
🔮 Architecture Roadmap
The application's core state model is abstractly structured to support iterative modular growth. The next milestone is allowing developers to point the tool at an existing codebase to inject new controller/service slices or database entities programmatically.
💻 Source Code
The project is licensed under Apache-2.0 and includes the full engineering story, validation endpoints, and environment configurations: 🔗 https://github.com/tpkani2026/ollamasprout-bootstrapper.git
I’d love to get your architectural feedback on the scaffolding strategy, your thoughts on localized AI generation patterns for corporate stacks, and how you see local model orchestration fitting into the enterprise SDLC!
1
u/ninjazee124 22d ago
You are the building for the 1% that won’t use a cloud LLM - expect no to little use of this
1
u/sereikis 22d ago
for the markdown-to-files boundary, add fixtures with an absolute path,
../traversal and a symlink pointing outside the output directory, and verify none can write outside the intended root. local inference doesn't make generated paths trustworthy; for existing-repo mode, keep those containment checks separate from the overwrite/collision check.