┌─────────────┐ ┌──────────────────┐
│ Browser │ │ Spring Backend │
│ (React UI) │ │ │
│ │ HTTP │ Chat Controller │
│ ├──────►│ Model Service │
│ │ │ Inference Engine│
└─────────────┘ └──────────────────┘
│
│ sessionStorage
▼
Client-side Session State
-
Home Page
-
Product information
-
CTA: New Discussion
-
Chat Page
-
Sidebar with discussions
-
Chat window
-
Session-based conversation handling
-
Chat Interaction Flow
-
User starts a new discussion
-
Frontend generates sessionId
-
User sends a message
-
Frontend sends:
POST /api/agent/chat?sessionId=...
-
Backend:
-
Validates training state
-
Generates response
-
Backend returns plain text
-
Frontend renders response in chat UI
Chat {
id: string
title: string
messages: Message[]
}
Message {
role: "user" | "assistant"
content: string
}ChatWindow
├── Sidebar
│ ├── New Discussion
│ └── Discussion List
├── ChatHeader
│ └── Home Navigation
├── MessageList
│ ├── UserMessage
│ └── AssistantMessage
└── ChatInput