Initial implementation of the chat application with MariaDB and ArangoDB integration, including Docker setup and web interface.
This commit is contained in:
2
web/Dockerfile
Normal file
2
web/Dockerfile
Normal file
@@ -0,0 +1,2 @@
|
||||
FROM nginx:alpine
|
||||
COPY . /usr/share/nginx/html
|
||||
17
web/index.html
Normal file
17
web/index.html
Normal 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
12
web/scripts.js
Normal 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
4
web/style.css
Normal 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%; }
|
||||
Reference in New Issue
Block a user