# hariprasanth-jcode/spring_boot_hugging_face_ai architecture

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

- Interactive diagram: https://gitdiagram.com/hariprasanth-jcode/spring_boot_hugging_face_ai
- Repository: https://github.com/hariprasanth-jcode/spring_boot_hugging_face_ai

## Overview

This Spring Boot service exposes a prompt-to-text endpoint backed by a Hugging Face model. The principal flow is an HTTP request to the controller, prompt formatting and response extraction in the service, then a Feign POST to the configured model endpoint. The application entry point enables Feign clients. HFRequest and HFResponse are present but are not used in the shown flow. The graph reflects the sampled source; no README or configuration contents were provided.

Main entry points: [`src/main/java/com/aiapp/huggingfaceapi/HuggingFaceClient.java`](https://github.com/hariprasanth-jcode/spring_boot_hugging_face_ai/blob/master/src/main/java/com/aiapp/huggingfaceapi/HuggingFaceClient.java) (Feign client), [`src/main/java/com/aiapp/huggingfaceapi/AIController.java`](https://github.com/hariprasanth-jcode/spring_boot_hugging_face_ai/blob/master/src/main/java/com/aiapp/huggingfaceapi/AIController.java) (AI controller), [`src/main/java/com/aiapp/huggingfaceapi/HuggingFaceService.java`](https://github.com/hariprasanth-jcode/spring_boot_hugging_face_ai/blob/master/src/main/java/com/aiapp/huggingfaceapi/HuggingFaceService.java) (Generation service), [`src/main/java/com/aiapp/huggingfaceapi/HuggingfaceapiApplication.java`](https://github.com/hariprasanth-jcode/spring_boot_hugging_face_ai/blob/master/src/main/java/com/aiapp/huggingfaceapi/HuggingfaceapiApplication.java) (Spring Boot app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_controller["AI controller<br/>[AIController.java]"]
end

subgraph group_generation["Text Generation"]
  node_service["Generation service"]
end

subgraph group_integration["Hugging Face Integration"]
  node_client["Feign client"]
  node_application["Spring Boot app"]
end

node_caller(("API caller"))
node_model{{"Hugging Face model API"}}

node_caller -->|"requests generation"| node_controller
node_controller -->|"delegates prompt"| node_service
node_service -->|"sends model request"| node_client
node_client -->|"posts prompt"| node_model
node_application -->|"enables Feign"| node_client

click node_controller "https://github.com/hariprasanth-jcode/spring_boot_hugging_face_ai/blob/master/src/main/java/com/aiapp/huggingfaceapi/AIController.java"
click node_service "https://github.com/hariprasanth-jcode/spring_boot_hugging_face_ai/blob/master/src/main/java/com/aiapp/huggingfaceapi/HuggingFaceService.java"
click node_client "https://github.com/hariprasanth-jcode/spring_boot_hugging_face_ai/blob/master/src/main/java/com/aiapp/huggingfaceapi/HuggingFaceClient.java"
click node_application "https://github.com/hariprasanth-jcode/spring_boot_hugging_face_ai/blob/master/src/main/java/com/aiapp/huggingfaceapi/HuggingfaceapiApplication.java"

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_controller toneBlue
class node_service toneAmber
class node_client,node_application,node_caller,node_model toneMint
```

## Components

### HTTP API

- [AI controller](https://github.com/hariprasanth-jcode/spring_boot_hugging_face_ai/blob/master/src/main/java/com/aiapp/huggingfaceapi/AIController.java): `src/main/java/com/aiapp/huggingfaceapi/AIController.java`

### Text Generation

- [Generation service](https://github.com/hariprasanth-jcode/spring_boot_hugging_face_ai/blob/master/src/main/java/com/aiapp/huggingfaceapi/HuggingFaceService.java): `src/main/java/com/aiapp/huggingfaceapi/HuggingFaceService.java`

### Hugging Face Integration

- [Feign client](https://github.com/hariprasanth-jcode/spring_boot_hugging_face_ai/blob/master/src/main/java/com/aiapp/huggingfaceapi/HuggingFaceClient.java): `src/main/java/com/aiapp/huggingfaceapi/HuggingFaceClient.java`
- [Spring Boot app](https://github.com/hariprasanth-jcode/spring_boot_hugging_face_ai/blob/master/src/main/java/com/aiapp/huggingfaceapi/HuggingfaceapiApplication.java): `src/main/java/com/aiapp/huggingfaceapi/HuggingfaceapiApplication.java`

### Other components

- **API caller**
- **Hugging Face model API**

## Connections

- API caller → AI controller: requests generation (evidence: `src/main/java/com/aiapp/huggingfaceapi/AIController.java`)
- AI controller → Generation service: delegates prompt (evidence: `src/main/java/com/aiapp/huggingfaceapi/AIController.java`)
- Generation service → Feign client: sends model request (evidence: `src/main/java/com/aiapp/huggingfaceapi/HuggingFaceService.java`)
- Feign client → Hugging Face model API: posts prompt (evidence: `src/main/java/com/aiapp/huggingfaceapi/HuggingFaceClient.java`)
- Spring Boot app → Feign client: enables Feign (evidence: `src/main/java/com/aiapp/huggingfaceapi/HuggingfaceapiApplication.java`)
