From be0fde0bdb7beac22ece45c24d2bc3d54102df4b Mon Sep 17 00:00:00 2001 From: usernames122 <88596366+usernames122@users.noreply.github.com> Date: Thu, 7 Aug 2025 23:57:27 +0200 Subject: [PATCH] first commit --- .gitignore | 2 ++ main.py | 20 +++++++++++++++ requirements.txt | 2 ++ templates/chat.html | 60 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 .gitignore create mode 100644 main.py create mode 100644 requirements.txt create mode 100644 templates/chat.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a7b4a14 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +venv +webchat.db \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..88d3586 --- /dev/null +++ b/main.py @@ -0,0 +1,20 @@ +from flask import Flask, render_template +from flask_socketio import SocketIO, send +import sqlite3 + +app = Flask(__name__) +socketio = SocketIO(app) + + +@socketio.on('message') +def onMessage(msg): + send(msg, broadcast=True) + + +@app.route('/') +def routeLogin(): + return render_template("chat.html") + + +if __name__ == '__main__': + socketio.run(app, host='0.0.0.0', debug=True, allow_unsafe_werkzeug=True) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..8760bf7 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +flask +flask-socketio diff --git a/templates/chat.html b/templates/chat.html new file mode 100644 index 0000000..3535a5c --- /dev/null +++ b/templates/chat.html @@ -0,0 +1,60 @@ + + + + + + WebChat...? + + + + + +
+ + + \ No newline at end of file