ChitChat is a simple real-time chat application built with Flask, Redis, and Celery. It allows multiple users to communicate instantly in a shared chatroom environment. The project demonstrates the use of asynchronous task queues, message broadcasting, and real-time updates using Python's popular web and messaging frameworks.
- Real-Time Messaging: Messages are broadcast instantly to all users in the chatroom.
- Asynchronous Task Processing: Celery is used to handle message storage and broadcasting without blocking the main application.
- Persistent Storage: Redis is used for storing messages, ensuring they persist and can be retrieved later.
- Multi-User Support: Multiple users can join the chat, each with their own unique username.
- Simple and Responsive UI: A clean and responsive user interface built with HTML, Bootstrap, and JavaScript.
- Flask: A lightweight web framework for Python.
- Redis: An in-memory data structure store used as a message broker and for persistent storage.
- Celery: An asynchronous task queue/job queue based on distributed message passing.
- Bootstrap: A CSS framework used to create a responsive front-end.
- JavaScript & jQuery: For handling real-time updates and DOM manipulation.
-
Clone the repository:
git clone https://github.com/imriadutta/chitchat.git cd chitchat -
Set up a virtual environment:
python3 -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Start Redis server:
redis-server
-
Start Celery worker:
celery -A app.celery worker --loglevel=info
-
Run the Flask application:
python3 app.py
-
Access the application: Open your browser and go to
http://127.0.0.1:5000/.
- Visit the homepage to join the chat.
- Enter your username and start messaging.
- Messages will be broadcast to all users in real-time.