Initial implementation of the chat application with MariaDB and ArangoDB integration, including Docker setup and web interface.

This commit is contained in:
st-server
2026-01-06 15:26:14 +01:00
parent f0e2fd294b
commit b3f6ecb1bc
13 changed files with 296 additions and 0 deletions

2
web/Dockerfile Normal file
View File

@@ -0,0 +1,2 @@
FROM nginx:alpine
COPY . /usr/share/nginx/html

17
web/index.html Normal file
View File

@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Projekt-LLM Chat</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="chat-container">
<input id="project" placeholder="Projektname">
<div id="messages"></div>
<input id="message" placeholder="Schreibe eine Nachricht">
<button onclick="sendMessage()">Senden</button>
</div>
<script src="script.js"></script>
</body>
</html>

12
web/scripts.js Normal file
View File

@@ -0,0 +1,12 @@
async function sendMessage() {
const project = document.getElementById('project').value;
const message = document.getElementById('message').value;
const res = await fetch('http://localhost:5000/chat', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({project, message})
});
const data = await res.json();
const messagesDiv = document.getElementById('messages');
messagesDiv.innerHTML += `<p><b>Du:</b> ${message}</p><p><b>LLM:</b> ${data.reply}</p>`;
}

4
web/style.css Normal file
View File

@@ -0,0 +1,4 @@
#chat-container { width: 500px; margin: auto; }
#messages { border: 1px solid #ccc; height: 400px; overflow-y: scroll; padding: 5px; margin-bottom: 5px; }
input { width: 80%; margin-bottom: 5px; }
button { width: 18%; }