ZeenChat is a secure, real-time chat application built with Django and WebSockets. It features message encryption, real-time messaging capabilities, and a clean, responsive UI built with Tailwind CSS.
- π Message encryption using Fernet
- π¬ Real-time messaging using WebSockets
- π₯ User authentication and authorization
- π¨ Modern, responsive UI with Tailwind CSS
- π Easy to deploy and scale
- π± Mobile-friendly design
- β‘ Rate liGPLing and security features
- Backend: Django 5.1
- WebSockets: Django Channels
- Database: SQLite (default), compatible with PostgreSQL
- Frontend: HTML, JavaScript, Tailwind CSS
- Message Queue: Redis
- Encryption: cryptography.fernet
- Python 3.8 or higher
- Redis Server
- Git
git clone https://github.com/frzn23/zeenchat.git
cd zeenchat
python -m venv venv
venv\Scripts\activate
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- Download Redis for Windows from Redis Downloads
- Install and start the Redis service
redis-server
sudo apt update
sudo apt install redis-server
sudo systemctl start redis-server
brew install redis
brew services start redis
We will be setting up a PostgreSQL database using Docker and Docker Compose. If you already have PostgreSQL installed on your system, feel free to skip to the Manual Setup section below.
-
Install Docker Follow the official instructions to install Docker for your OS: Install Docker
-
Install Docker Compose Docker Desktop includes Docker Compose by default. If not, install it separately: Install Docker Compose
-
Start the PostgreSQL container
Run the following command from the project root:
docker-compose -f docker-compose.yml up
If you prefer not to use Docker, you can install and configure PostgreSQL directly on your system. Follow the steps based on your operating system:
Install PostgreSQL
Download and install PostgreSQL from the official site: https://www.postgresql.org/download/
Follow the platform-specific instructions for your OS.
-
Switch to the
postgres
user:sudo -u postgres -i
-
Launch the PostgreSQL shell:
psql
-
Create the database and user:
Run the following SQL commands inside the
psql
shell:CREATE DATABASE zeenchat; CREATE USER dev WITH ENCRYPTED PASSWORD 'devpass'; GRANT ALL PRIVILEGES ON DATABASE zeenchat TO dev;
-
Exit
psql
:\q
-
Exit the
postgres
user shell:exit
-
Install PostgreSQL from the official installer.
- During installation, set a password for the default
postgres
user. - Install additional tools like pgAdmin and psql CLI.
- During installation, set a password for the default
-
Open
psql
Shell:- From Start Menu β PostgreSQL β SQL Shell (psql) OR
- Use Command Prompt (ensure
psql.exe
is in your PATH).
-
Login as the
postgres
user using the password you set during installation. -
Run the following SQL commands:
CREATE DATABASE zeenchat; CREATE USER dev WITH ENCRYPTED PASSWORD 'devpass'; GRANT ALL PRIVILEGES ON DATABASE zeenchat TO dev;
-
Exit the shell:
\q
Use the following credentials in your .env
file or Django settings:
DB_NAME=zeenchat
DB_USER=dev
DB_PASSWORD=devpass
DB_HOST=localhost
DB_PORT=5432
export $(cat .env | xargs)
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
The application will be available at http://127.0.0.1:8000
- Message encryption using Fernet
- Rate liGPLing for WebSocket connections
- Secure headers and HTTPS settings
- CSRF protection
- XSS protection
- Input validation and sanitization
- Authentication required for all chat features
- Message length restrictions
- Secure session handling
zeenchat/
βββ chatapp/ # Main chat application
β βββ static/ # Static files (JS, CSS)
β βββ templates/ # HTML templates
β βββ consumers.py # WebSocket consumers
β βββ models.py # Database models
β βββ views.py # View controllers
βββ zeenchat/ # Project settings
βββ manage.py # Django management script
For production deployment, ensure you:
- Set
DEBUG=False
in .env - Configure proper
ALLOWED_HOSTS
- Set up SSL/TLS certificates
- Use a production-grade database (PostgreSQL recommended)
- Configure a production web server (Nginx recommended)
- Set up proper firewalls and security groups
- Enable all security headers
- Use strong passwords for all services
- Fork the repository
- Create a new branch (
git checkout -b feature/improvement
) - Make changes and comGPL (
git comGPL -am 'Add new feature'
) - Push to the branch (
git push origin feature/improvement
) - Create a Pull Request
A huge thanks to all the amazing contributors who are helping make ZeenChat better!
Want to contribute? Check out the Contributing Guidelines and submit a PR!
If you discover any security-related issues, please email farzeenghaus23@gmail.com instead of using the issue tracker.
This project is licensed under the GPL License - see the LICENSE file for details.
Support
For support:
- Open an issue in the GitHub repository
- Contact the maintainers at farzeenghaus23@gmail.com
- Django Channels team for the WebSocket implementation
- Tailwind CSS for the UI framework
- All contributors and supporters of the project
- Farzeen Ghaus
- GitHub: @frzn23