# aurluce/text2ulm architecture

> Architecture diagram of the GitHub repository aurluce/text2ulm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aurluce/text2ulm
- Repository: https://github.com/aurluce/text2ulm

## Overview

Text2UML is a Streamlit application that turns a natural-language system description into one of seven UML diagram types and offers rendered and source-file results. The primary workflow is description and type selection, AI-based model generation, consistency validation, PlantUML construction, and image rendering. The diagram catalogue and shared models support distinct diagram domains; configuration controls the Groq and rendering integrations. The excerpts show the main calls, but not all rendering and output-handling details, so uncertain internal links are omitted.

Main entry points: [`app.py`](https://github.com/aurluce/text2ulm/blob/main/app.py) (Streamlit interface), [`services/ai_service.py`](https://github.com/aurluce/text2ulm/blob/main/services/ai_service.py) (AI generation), [`services/uml_generator.py`](https://github.com/aurluce/text2ulm/blob/main/services/uml_generator.py) (PNG/SVG rendering), [`models/uml_model.py`](https://github.com/aurluce/text2ulm/blob/main/models/uml_model.py) (Diagram models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_streamlit_app["Streamlit interface<br/>[app.py]"]
  node_result["Diagram results<br/>[app.py]"]
end

subgraph group_modeling["Diagram modeling"]
  node_diagram_catalog["Diagram catalogue<br/>[diagram_types.py]"]
  node_uml_models["Diagram models<br/>[uml_model.py]"]
  node_shared_utilities["Name utilities<br/>[utils.py]"]
end

subgraph group_generation["Generation pipeline"]
  node_ai_service["AI generation<br/>[ai_service.py]"]
  node_validator["Model validation<br/>[validator.py]"]
end

subgraph group_rendering["Rendering and configuration"]
  node_plantuml_code["PlantUML generation<br/>[uml_generator.py]"]
  node_renderer["PNG/SVG rendering<br/>[uml_generator.py]"]
  node_configuration["Runtime configuration<br/>[config.py]"]
end

node_user(("Diagram author"))
node_groq["Groq API"]
node_local_plantuml["Local PlantUML"]
node_public_plantuml["PlantUML server"]

node_user -->|"describes system"| node_streamlit_app
node_streamlit_app -->|"selects type"| node_diagram_catalog
node_streamlit_app -->|"requests model"| node_ai_service
node_ai_service -->|"requests completion"| node_groq
node_ai_service -->|"uses type rules"| node_diagram_catalog
node_ai_service -->|"parses response"| node_uml_models
node_ai_service -->|"validates model"| node_validator
node_validator -->|"cleans model"| node_uml_models
node_streamlit_app -->|"builds diagram code"| node_plantuml_code
node_plantuml_code -->|"reads diagram model"| node_uml_models
node_plantuml_code -->|"uses identifiers"| node_shared_utilities
node_streamlit_app -->|"requests rendering"| node_renderer
node_renderer -->|"renders locally"| node_local_plantuml
node_renderer -.->|"sends diagram text"| node_public_plantuml
node_ai_service -->|"reads API settings"| node_configuration
node_renderer -->|"reads render settings"| node_configuration
node_streamlit_app -->|"shows and downloads"| node_result

click node_streamlit_app "https://github.com/aurluce/text2ulm/blob/main/app.py"
click node_diagram_catalog "https://github.com/aurluce/text2ulm/blob/main/services/diagram_types.py"
click node_uml_models "https://github.com/aurluce/text2ulm/blob/main/models/uml_model.py"
click node_ai_service "https://github.com/aurluce/text2ulm/blob/main/services/ai_service.py"
click node_validator "https://github.com/aurluce/text2ulm/blob/main/services/validator.py"
click node_plantuml_code "https://github.com/aurluce/text2ulm/blob/main/services/uml_generator.py"
click node_renderer "https://github.com/aurluce/text2ulm/blob/main/services/uml_generator.py"
click node_configuration "https://github.com/aurluce/text2ulm/blob/main/config.py"
click node_shared_utilities "https://github.com/aurluce/text2ulm/blob/main/utils.py"
click node_result "https://github.com/aurluce/text2ulm/blob/main/app.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_streamlit_app,node_result toneBlue
class node_diagram_catalog,node_uml_models,node_shared_utilities toneAmber
class node_ai_service,node_validator,node_groq,node_public_plantuml toneMint
class node_plantuml_code,node_renderer,node_configuration toneRose
class node_user,node_local_plantuml toneIndigo
```

## Components

### User interface

- [Streamlit interface](https://github.com/aurluce/text2ulm/blob/main/app.py): `app.py`
- [Diagram results](https://github.com/aurluce/text2ulm/blob/main/app.py): `app.py`

### Diagram modeling

- [Diagram catalogue](https://github.com/aurluce/text2ulm/blob/main/services/diagram_types.py): `services/diagram_types.py`
- [Diagram models](https://github.com/aurluce/text2ulm/blob/main/models/uml_model.py): `models/uml_model.py`
- [Name utilities](https://github.com/aurluce/text2ulm/blob/main/utils.py): `utils.py`

### Generation pipeline

- [AI generation](https://github.com/aurluce/text2ulm/blob/main/services/ai_service.py): `services/ai_service.py`
- [Model validation](https://github.com/aurluce/text2ulm/blob/main/services/validator.py): `services/validator.py`

### Rendering and configuration

- [PlantUML generation](https://github.com/aurluce/text2ulm/blob/main/services/uml_generator.py): `services/uml_generator.py`
- [PNG/SVG rendering](https://github.com/aurluce/text2ulm/blob/main/services/uml_generator.py): `services/uml_generator.py`
- [Runtime configuration](https://github.com/aurluce/text2ulm/blob/main/config.py): `config.py`

### Other components

- **Diagram author**
- **Groq API**
- **Local PlantUML**
- **PlantUML server**

## Connections

- Diagram author → Streamlit interface: describes system (evidence: `README.md`)
- Streamlit interface → Diagram catalogue: selects type (evidence: `app.py`)
- Streamlit interface → AI generation: requests model (evidence: `app.py`)
- AI generation → Groq API: requests completion (evidence: `services/ai_service.py`)
- AI generation → Diagram catalogue: uses type rules (evidence: `services/ai_service.py`)
- AI generation → Diagram models: parses response (evidence: `services/ai_service.py`)
- AI generation → Model validation: validates model (evidence: `services/ai_service.py`)
- Model validation → Diagram models: cleans model (evidence: `services/validator.py`)
- Streamlit interface → PlantUML generation: builds diagram code (evidence: `app.py`)
- PlantUML generation → Diagram models: reads diagram model (evidence: `services/uml_generator.py`)
- PlantUML generation → Name utilities: uses identifiers (evidence: `services/uml_generator.py`)
- Streamlit interface → PNG/SVG rendering: requests rendering (evidence: `app.py`)
- PNG/SVG rendering → Local PlantUML: renders locally (evidence: `services/uml_generator.py`)
- PNG/SVG rendering → PlantUML server: sends diagram text (evidence: `services/uml_generator.py`)
- AI generation → Runtime configuration: reads API settings (evidence: `services/ai_service.py`)
- PNG/SVG rendering → Runtime configuration: reads render settings (evidence: `services/uml_generator.py`)
- Streamlit interface → Diagram results: shows and downloads (evidence: `app.py`)
