A minimal real-time chat application built using Flask, Flask-SocketIO, and HTML/CSS/JS. The app allows users to register, log in, and chat live with others in real time using WebSockets.
- π User registration and login with password hashing
- π¨οΈ Real-time message broadcasting (Socket.IO)
- π‘ Lightweight Flask backend
- π Persian RTL UI
- πͺ Logout and session management
- π± Responsive and simple UI (custom HTML/CSS)
realtime-chat/ β βββ app.py # Main Flask application βββ templates/ β βββ index.html # Chat interface β βββ register.html # User registration page βββ static/ # (optional) CSS or JS files if separated βββ README.md # You're here!
- π₯ Clone the repo:
git clone https://github.com/your-username/realtime-chat.git
cd realtime-chatβΆοΈ Run the app:
python app.py
- π₯οΈ Open your browser and go to:
http://127.0.0.1:5000/
-
Python 3.7+
-
Flask
-
Flask-SocketIO
-
Werkzeug (comes with Flask)
π requirements.txt:
Flask
Flask-SocketIO
/register: Sign up with username and password (hashed with Werkzeug)
/login: Log in securely
/: Main chatroom (if logged in)
/logout: Ends user session
-
For simplicity, user data is stored in memory (dictionary) β not persistent.
-
Do not use this in production without adding:
-
Database (e.g. SQLite, PostgreSQL)
-
Input validation
-
CSRF protection
-
Session timeout management
Bardia Javadi
Computer Engineering student
GitHub: @bardiw