A secure, real-time chat application with one-on-one messaging, group rooms, and WebRTC voice/video calling. All messages are end-to-end encrypted for privacy.
A web-based chat platform designed for secure and private communication. Built with Django Channels for real-time WebSocket messaging and WebRTC for peer-to-peer voice/video calls. All messages are end-to-end encrypted to ensure privacy.
| Feature | Description |
|---|---|
| User Authentication | Secure registration and login system |
| One-on-One Messaging | Private conversations with any user |
| Group Chat Rooms | Public or password-protected rooms |
| End-to-End Encryption | Messages encrypted before transmission |
| Voice & Video Calls | Real-time WebRTC calls within group rooms |
| Image Sharing | Share images via Cloudinary integration |
| Read Receipts | Track message delivery status |
| Real-Time Delivery | Instant message delivery via WebSockets |
| Layer | Technology |
|---|---|
| Backend | Python, Django, Django Channels, Daphne (ASGI) |
| Frontend | HTML, CSS, Vanilla JavaScript |
| Real-Time | WebSockets, WebRTC |
| Database | Firebase Firestore & Realtime Database (chat), SQLite (auth) |
| Storage | Cloudinary (image uploads) |
┌──────────────────────────────────────────────┐
│ Browser Client │
│ ┌──────────┐ ┌──────────┐ ┌───────────┐ │
│ │ Chat UI │ │ WebRTC │ │ E2E Enc │ │
│ └─────┬────┘ └─────┬────┘ └───────────┘ │
└────────┼─────────────┼───────────────────────┘
│ WebSocket │ WebRTC (P2P)
┌────────▼─────────────▼───────────────────────┐
│ Django + Channels │
│ ┌──────────────┐ ┌──────────────────────┐ │
│ │ Daphne ASGI │ │ WebSocket Consumer │ │
│ └──────┬───────┘ └──────────┬───────────┘ │
└─────────┼─────────────────────┼──────────────┘
│ │
┌─────────▼──────┐ ┌──────────▼───────────────┐
│ Firebase │ │ Cloudinary │
│ (Messages + │ │ (Image Storage) │
│ Realtime DB) │ │ │
└─────────────────┘ └──────────────────────────┘
RealTimeChat/
├── ChatApp/ # Core Django app
│ ├── consumers.py # WebSocket consumer for real-time events
│ ├── models.py # Django models
│ ├── views.py # Views for rendering pages
│ └── urls.py # URL patterns
├── ChatProject/ # Django project settings
│ ├── settings.py # Project configuration
│ ├── asgi.py # ASGI entry point for Channels
│ └── urls.py # Root URL configuration
├── templates/ # HTML templates
├── static/ # CSS and JavaScript
├── firebase_config.py # Firebase initialization
├── config/ # Firebase config files
└── manage.py # Django CLI
- Python 3.9+
- A Firebase project
- A Cloudinary account
-
Clone the repository
git clone https://github.com/ba2hannn/realtime-encrypted-chat.git cd realtime-encrypted-chat -
Set up virtual environment
python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate pip install -r requirements.txt
-
Configure Firebase
- Download service account key from Firebase Console → Project Settings → Service Accounts
- Save as
RealTimeChat/config/firebaseAdmin_config.json - Create
RealTimeChat/config/pyrebase_config.jsonwith your web app's Firebase config
-
Configure Cloudinary Set environment variables:
export CLOUDINARY_CLOUD_NAME=your_cloud_name export CLOUDINARY_API_KEY=your_api_key export CLOUDINARY_API_SECRET=your_api_secret
-
Run migrations and start server
python RealTimeChat/manage.py migrate python RealTimeChat/manage.py runserver
Open
http://127.0.0.1:8000in your browser.
- Sign up for a new account or log in
- Create a new chat room or join an existing one
- Start messaging, sharing images, or initiate a voice/video call
This project is licensed under the MIT License — see the LICENSE file for details.
Built by ba2hannn