A high-performance, real-time chat application built with Django 6.0, Django Channels, and Redis. This project serves as a comprehensive "spike" to demonstrate scalable WebSocket architecture, robust notification systems, and premium UI/UX.
- Real-time Messaging: Instant delivery powered by WebSockets and Redis.
- Group & Private Chats: Support for public rooms and 1-on-1 direct messaging.
- Premium UI: WhatsApp-inspired theme with a clean, responsive layout.
- Message Persistence: Full chat history saved in SQLite.
- Message Grouping: Smart grouping by date (Today, Yesterday, etc.).
- Typing Indicators: Real-time "User is typing..." feedback.
- WhatsApp-style Ticks:
- Sent: Single Tick (✓)
- Read: Blue Double Tick (✓✓)
- Bulk Read Sync: Messages are automatically marked as read when you enter a room or focus the window.
- Lobby Badges: Real-time unread count badges for every conversation in the lobby.
- Desktop Notifications: Native browser alerts for new messages when the window is out of focus.
- Tab Title Notifications: Dynamic unread counts in the browser tab (e.g.,
(3) Chat Room). - Manual Permission Control: Dedicated button to enable/request notification permissions.
- Robust Reconnection: Automatic reconnection with exponential backoff and visual status indicators.
- Connection Monitoring: Real-time tracking of active socket connections.
- Redis Error Handling: Custom middleware to gracefully handle Redis downtime without crashing the app.
- Session Isolation: Configured for multi-user testing in the same browser using unique session cookies.
- Backend: Django 6.0, Django Channels 4.0
- Asynchronous Server: Daphne (ASGI)
- Channel Layer: Redis
- Database: SQLite
- Frontend: Vanilla JavaScript (ES6+), HTML5, CSS3
- Python 3.10+
- Redis Server (Running on port 6379)
-
Clone & Install Dependencies:
pip install -r requirements.txt
-
Start Redis: Ensure Redis is running. If using Docker:
docker run -p 6379:6379 -d redis:5
-
Database Setup:
python manage.py migrate
-
Run the Application:
python manage.py runserver
-
Access: Open http://127.0.0.1:8000 in your browser.
For in-depth technical details, diagrams, and architectural analysis, please refer to:
implementation_docs.txt: Complete technical breakdown in plain text.Django_Chat_App_Spike_Documentation.docx: Executive summary and feature overview.Django_Chat_App_Technical_Deep_Dive.docx: High-fidelity documentation with system diagrams and flowcharts.
To test real-time features between different users:
- Open the app in two different browsers (e.g., Chrome and Firefox).
- Or use a standard window and an Incognito/Private window.
- The app is configured with unique session cookies to prevent login conflicts during local testing.