A real-time anonymous chat built with Flask and Socket.IO. Each user picks a name on first visit, and messages are delivered instantly to everyone currently online.
- Real-time messaging β messages broadcast to all connected users, no refresh needed
- Permanent names β the name is stored server-side and can never be changed or claimed again, even if the user clears their browser's localStorage. Only the original owner can reclaim it, via a secret token
- Online counter β live count of connected users in the header
- Message history β all messages persisted in SQLite and replayed on reconnect
- 500 character limit on messages, enforced client- and server-side
- Enter sends a message, Shift+Enter adds a newline
Flask 3.1.3 Β· Flask-SocketIO 5.6.1 Β· Flask-SQLAlchemy 3.1.1 Β· SQLAlchemy 2.1.2 Β· SQLite
The frontend is plain HTML/CSS/JS with no framework; the Socket.IO client loads from a CDN.
pip install flask flask-socketio flask-sqlalchemy
flask --app app runThen open http://127.0.0.1:5000. Tables are created automatically on first run.