8000 GitHub - diego-lutke/zeenchat
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

diego-lutke/zeenchat

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

60 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ZeenChat - Real-time Encrypted Chat Application

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.

GitHub Repository

Features

  • πŸ”’ 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

Tech Stack

  • Backend: Django 5.1
  • WebSockets: Django Channels
  • Database: SQLite (default), compatible with PostgreSQL
  • Frontend: HTML, JavaScript, Tailwind CSS
  • Message Queue: Redis
  • Encryption: cryptography.fernet

Prerequisites

  • Python 3.8 or higher
  • Redis Server
  • Git

Installation

Clone the Repository

git clone https://github.com/frzn23/zeenchat.git
cd zeenchat

Setting up Virtual Environment

Windows

python -m venv venv
venv\Scripts\activate

Linux/MacOS

python3 -m venv venv
source venv/bin/activate

Install Dependencies

pip install -r requirements.txt

Install and Start Redis Server

Windows

  1. Download Redis for Windows from Redis Downloads
  2. Install and start the Redis service
redis-server

Linux

sudo apt update
sudo apt install redis-server
sudo systemctl start redis-server

MacOS

brew install redis
brew services start redis

πŸ› οΈ Database Setup

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.


Setup with Docker (Recommended)

  1. Install Docker Follow the official instructions to install Docker for your OS: Install Docker

  2. Install Docker Compose Docker Desktop includes Docker Compose by default. If not, install it separately: Install Docker Compose

  3. Start the PostgreSQL container

    Run the following command from the project root:

    docker-compose -f docker-compose.yml up

Manual PostgreSQL Database Setup (Without Docker)

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.


Linux / macOS Instructions

  1. Switch to the postgres user:

    sudo -u postgres -i
  2. Launch the PostgreSQL shell:

    psql
  3. 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;
  4. Exit psql:

    \q
  5. Exit the postgres user shell:

    exit

Windows Instructions

  1. Install PostgreSQL from the official installer.

    • During installation, set a password for the default postgres user.
    • Install additional tools like pgAdmin and psql CLI.
  2. Open psql Shell:

    • From Start Menu β†’ PostgreSQL β†’ SQL Shell (psql) OR
    • Use Command Prompt (ensure psql.exe is in your PATH).
  3. Login as the postgres user using the password you set during installation.

  4. Run the following SQL commands:

    CREATE DATABASE zeenchat;
    CREATE USER dev WITH ENCRYPTED PASSWORD 'devpass';
    GRANT ALL PRIVILEGES ON DATABASE zeenchat TO dev;
  5. Exit the shell:

    \q

Database Connection Info

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

Source the env

export $(cat .env | xargs)

Migrations

python manage.py makemigrations
python manage.py migrate

Create Superuser (Admin)

python manage.py createsuperuser

Run Development Server

python manage.py runserver

The application will be available at http://127.0.0.1:8000

Security Features

  • 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

Project Structure

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

Production Deployment

For production deployment, ensure you:

  1. Set DEBUG=False in .env
  2. Configure proper ALLOWED_HOSTS
  3. Set up SSL/TLS certificates
  4. Use a production-grade database (PostgreSQL recommended)
  5. Configure a production web server (Nginx recommended)
  6. Set up proper firewalls and security groups
  7. Enable all security headers
  8. Use strong passwords for all services

Contributing

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/improvement)
  3. Make changes and comGPL (git comGPL -am 'Add new feature')
  4. Push to the branch (git push origin feature/improvement)
  5. Create a Pull Request

Contributors

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!

Security Issues

If you discover any security-related issues, please email farzeenghaus23@gmail.com instead of using the issue tracker.

License

This project is licensed under the GPL License - see the LICENSE file for details.

Support

For support:

Acknowledgments

  • Django Channels team for the WebSocket implementation
  • Tailwind CSS for the UI framework
  • All contributors and supporters of the project

Author

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 47.2%
  • HTML 27.5%
  • JavaScript 22.4%
  • CSS 2.9%
0