How payara/ecosystem-starter works
Purpose and Shape
Payara Starter is a Maven multi-module project that provides: (1) a browser-based application starter and generator, and (2) a Maven archetype for creating deployable Payara applications. The root build coordinates starter-ui, starter-generator, and starter-archetype via pom.xml.
Primary Entry Points
The deployed starter is a Jakarta EE/Payara web application. Its HTTP/API boundary is centered on starter-ui/src/main/java/fish/payara/starter/ERDiagramResource.java and application-generation endpoints under starter-ui/src/main/java/fish/payara/starter/resources/ApplicationResource.java. The browser shell is starter-ui/src/main/webapp/index.html.
The distributable project-template entry point is the Maven archetype descriptor at starter-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml.
UI and ER-Diagram Intake
starter-ui hosts the static ER designer and predefined Mermaid ER examples under starter-ui/src/main/webapp/erDiagram and client assets such as starter-ui/src/main/webapp/assets/main.js. Submitted diagrams reach resource endpoints, where they can be parsed directly or enhanced through chat-oriented flows:
• starter-ui/src/main/java/fish/payara/starter/ERDiagramPlainChat.java
• starter-ui/src/main/java/fish/payara/starter/ERDiagramEnhanceChat.java
• starter-ui/src/main/java/fish/payara/starter/ERDiagramResource.java
AI, Rate Limiting, and External Boundaries
AI integration is isolated in starter-ui/src/main/java/fish/payara/starter/LangChainChatService.java, with client construction in starter-ui/src/main/java/fish/payara/starter/OpenAIFactory.java. This is the external OpenAI/LangChain boundary and should be governed by MicroProfile configuration in starter-ui/src/main/resources/META-INF/microprofile-config.properties.
Request protection is separated into starter-ui/src/main/java/fish/payara/starter/IpRateLimitFilter.java and starter-ui/src/main/java/fish/payara/starter/RateLimited.java, placing rate control before expensive AI-backed operations.
Generation Pipeline
starter-generator converts Mermaid-derived ER input into a domain model and generated application source. starter-generator/src/main/java/fish/payara/starter/application/generator/ERDiagramParser.java parses the diagram into ERModel, Entity, Attribute, and Relationship objects under starter-generator/src/main/java/fish/payara/starter/application/domain.
starter-generator/src/main/java/fish/payara/starter/application/generator/CRUDAppGenerator.java renders that model into a CRUD application using FreeMarker templates. Output layers include JPA descriptors, repositories, REST controllers, JSF backing beans/views, and HTML:
• starter-generator/src/main/resources/template/descriptor
• starter-generator/src/main/resources/template/repository
• starter-generator/src/main/resources/template/rest
UI-to-Artifact Orchestration
The UI module owns request-level generation options and artifact delivery. starter-ui/src/main/java/fish/payara/starter/resources/ApplicationGenerator.java bridges UI requests to generator behavior; starter-ui/src/main/java/fish/payara/starter/resources/ApplicationConfiguration.java represents/configures requested application variants. DockerImageTagService.java provides a boundary for Docker image tag resolution, likely used when assembling deployment-oriented output.
Generated Starter Archetype
The archetype packages a baseline Payara app rather than using the ER generator. Its template includes REST resources, optional security/bootstrap material, web pages, Maven and Gradle builds, and Docker support:
• starter-archetype/src/main/resources/archetype-resources/pom.xml
• starter-archetype/src/main/resources/archetype-resources/src/main/java/resource/HelloWorldResource.java
• starter-archetype/src/main/resources/archetype-resources/Dockerfile
Security-oriented template content is isolated under starter-archetype/src/main/resources/archetype-resources/src/main/java/secured, with LDAP seed data at starter-archetype/src/main/resources/archetype-resources/src/main/resources/ldap-test.ldif.
Runtime and Delivery
The principal runtime is Payara/Jakarta EE, using REST, CDI, JPA, JSF, and MicroProfile configuration. The UI is packaged as a web application with Payara deployment metadata in starter-ui/src/main/webapp/WEB-INF/payara-web.xml. Maven is the repository build system; generated applications additionally support Gradle and Docker. CI is defined by Jenkinsfile.
Main entry points: index.html Browser shell · pom.xml Maven reactor · ApplicationGenerator.java Application generator bridge · ERDiagramResource.java ER and application API
Components 21
Starter UI
Deployed Payara web application.
- Browser shell · Hosts the ER designer and generation UI.
starter-ui/src/main/webapp/index.html - ER designer assets · Includes Mermaid ER examples and client behavior.
starter-ui/src/main/webapp/erDiagram - ER and application API · Accepts diagrams and application-generation requests.
starter-ui/src/main/java/fish/payara/starter/ERDiagramResource.java - Application endpoints · Exposes application-generation operations.
starter-ui/src/main/java/fish/payara/starter/resources/ApplicationResource.java - IP rate limiting · Protects costly AI-backed requests.
starter-ui/src/main/java/fish/payara/starter/IpRateLimitFilter.java - Diagram chat flows · Plain and enhancement flows process submitted diagrams.
starter-ui/src/main/java/fish/payara/starter/ERDiagramPlainChat.java - LangChain chat service · Isolates the OpenAI/LangChain boundary.
starter-ui/src/main/java/fish/payara/starter/LangChainChatService.java - MicroProfile config · Supplies AI integration settings.
starter-ui/src/main/resources/META-INF/microprofile-config.properties - Application generator bridge · Applies requested variants and delivers generated artifacts.
starter-ui/src/main/java/fish/payara/starter/resources/ApplicationGenerator.java - Docker tag resolver · Resolves image tags for deployment-oriented output.
starter-ui/src/main/java/fish/payara/starter/resources/DockerImageTagService.java - Payara web deployment · Packages the UI for Payara.
starter-ui/src/main/webapp/WEB-INF/payara-web.xml
ER Generator
Transforms Mermaid ER diagrams into CRUD source.
- ER diagram parser · Converts Mermaid ER input into the domain model.
starter-generator/src/main/java/fish/payara/starter/application/generator/ERDiagramParser.java - ER domain model · ERModel, entities, attributes, and relationships.
starter-generator/src/main/java/fish/payara/starter/application/domain - CRUD app generator · Renders a complete CRUD application from the ER model.
starter-generator/src/main/java/fish/payara/starter/application/generator/CRUDAppGenerator.java - CRUD templates · Produces descriptors, repositories, REST, JSF, and HTML.
starter-generator/src/main/resources/template
Maven Archetype
Packages a baseline Payara application template.
- Archetype descriptor · Defines the distributable baseline application template.
starter-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml - Baseline app template · Includes REST, pages, builds, Docker, and optional security material.
starter-archetype/src/main/resources/archetype-resources
Other components
- Maven reactor · Coordinates the three project modules.
pom.xml - Jenkins CI
Jenkinsfile - OpenAI / LangChain
- Generated Payara app · Deployable application with Maven/Gradle and Docker support.
Connections 22
- Maven reactor → Browser shell: builds
- Maven reactor → ER diagram parser: builds
- Maven reactor → Archetype descriptor: builds
- Browser shell → ER designer assets: loads
- Browser shell → ER and application API: submits diagrams
- Browser shell → Application endpoints: requests generation
- IP rate limiting → ER and application API: guards
- ER and application API → Diagram chat flows: uses
- Diagram chat flows → LangChain chat service: enhances diagrams
- MicroProfile config → LangChain chat service: configures
- LangChain chat service → OpenAI / LangChain: calls
- Application endpoints → Application generator bridge: delegates
- Application generator bridge → Docker tag resolver: resolves tags
- Application generator bridge → ER diagram parser: parses ER input
- ER diagram parser → ER domain model: creates
- ER domain model → CRUD app generator: drives rendering
- CRUD templates → CRUD app generator: rendered by
- CRUD app generator → Generated Payara app: emits source
- Payara web deployment → Browser shell: deploys UI
- Archetype descriptor → Baseline app template: packages
- Baseline app template → Generated Payara app: creates baseline app
- Jenkins CI → Maven reactor: builds