Skip to content

RonitKiranMurmu/Chatify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Chatify - Secure Decentralized Chat

Python Flask MongoDB License

A secure, real-time chat application with end-to-end encryption using the Signal Protocol (libsignal).

πŸŽ“ Project Type

Final Year College Project - Computer Science/Engineering
Academic Year: 2025-2026

✨ Features

Core Features

  • πŸ” End-to-End Encryption using Signal Protocol (X3DH + Double Ratchet)
  • πŸ’¬ Private Chat - Secure 1-to-1 messaging
  • πŸ‘₯ Group Chat - Multi-user encrypted conversations
  • πŸ“ File Sharing - Share encrypted files, images, videos (up to 16MB)
  • 🎀 Voice Messages - Record and send audio messages
  • πŸ“± Device Linking - QR-based secure multi-device support
  • 🌐 Server-Wide Chat - Public chat room

UX Features

  • ⌨️ Typing indicators
  • βœ… Read receipts (sent/delivered/read)
  • 🟒 Online/offline status
  • 😊 Message reactions
  • ✏️ Edit/delete messages
  • πŸŒ™ Dark/light mode
  • πŸ“± Responsive design (mobile-friendly)
  • πŸ˜€ Emoji picker (200+ emojis)
  • 🎬 GIF picker (GIPHY integration)
  • πŸ”— Rich text formatting (markdown)

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      Encrypted      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      Key Exchange      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Client A   β”‚ ◄──────Messages─────►│    Server    │◄────& Message Relay───►│  Client B   β”‚
β”‚ (libsignal) β”‚      (ciphertext)    β”‚ Flask+Socket β”‚     (public keys)      β”‚ (libsignal) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
      β”‚                                      β”‚
      β”‚                                      β–Ό
      β–Ό                               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                       β”‚   MongoDB    β”‚
β”‚  IndexedDB  β”‚                       β”‚   - Users    β”‚
β”‚ (private    β”‚                       β”‚   - Messages β”‚
β”‚  keys)      β”‚                       β”‚   - Groups   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Backend:

  • Flask (Python web framework)
  • Flask-SocketIO (WebSocket support)
  • MongoDB (Database)
  • libsignal (Signal Protocol implementation)
  • bcrypt (Password hashing)

Frontend:

  • HTML5, CSS3, JavaScript (ES6+)
  • TailwindCSS (Styling)
  • @signalapp/libsignal-client (E2E encryption)
  • Socket.IO client (Real-time communication)
  • Dexie.js (IndexedDB for key storage)

πŸ“‹ Prerequisites

  • Python 3.9 or higher
  • MongoDB 6.0+ (local or Atlas)
  • Modern web browser (Chrome, Firefox, Edge)
  • Git

πŸš€ Installation & Setup

1. Clone the repository

git clone https://github.com/yourusername/chatify.git
cd chatify

2. Create virtual environment

python -m venv venv

# Windows
venv\Scripts\activate

# Linux/Mac
source venv/bin/activate

3. Install Python dependencies

pip install -r requirements.txt

4. Configure environment variables

Create a .env file in the root directory:

# Flask Configuration
FLASK_APP=app.py
FLASK_ENV=development
SECRET_KEY=your-secret-key-here-change-in-production

# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017/chatify
# Or use MongoDB Atlas:
# MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/chatify

# Server Configuration
HOST=0.0.0.0
PORT=5000
DEBUG=True

# File Upload
MAX_FILE_SIZE=16777216  # 16MB in bytes
UPLOAD_FOLDER=uploads

5. Setup MongoDB

  • Option A (Local): Install MongoDB Community Edition
  • Option B (Cloud): Create free cluster on MongoDB Atlas

6. Setup GIPHY API (Optional - for GIF picker)

To enable the GIF picker feature:

  1. Go to GIPHY Developers
  2. Create a free account
  3. Create a new app (choose "SDK" type)
  4. Copy your API key
  5. Open templates/chat.html and replace YOUR_GIPHY_API_KEY_HERE with your actual API key

Note: The app works without this - GIF picker just won't load GIFs until configured.

7. Run the application

python app.py

The application will be available at: http://localhost:5000

πŸ“ Project Structure

chatify/
β”œβ”€β”€ app.py                      # Main Flask application
β”œβ”€β”€ config.py                   # Configuration settings
β”œβ”€β”€ requirements.txt            # Python dependencies
β”œβ”€β”€ .env                        # Environment variables (create this)
β”œβ”€β”€ .gitignore                 # Git ignore rules
β”‚
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ __init__.py            # App initialization
β”‚   β”œβ”€β”€ models.py              # Database models
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ auth.py            # Authentication routes
β”‚   β”‚   β”œβ”€β”€ chat.py            # Chat routes
β”‚   β”‚   β”œβ”€β”€ keys.py            # Key management routes
β”‚   β”‚   └── files.py           # File upload/download routes
β”‚   β”‚
β”‚   β”œβ”€β”€ socket_events.py       # Socket.IO event handlers
β”‚   └── utils/
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ database.py        # Database utilities
β”‚       └── security.py        # Security utilities
β”‚
β”œβ”€β”€ static/
β”‚   β”œβ”€β”€ css/
β”‚   β”‚   └── style.css          # Custom styles
β”‚   β”œβ”€β”€ js/
β”‚   β”‚   β”œβ”€β”€ app.js             # Main JavaScript
β”‚   β”‚   β”œβ”€β”€ crypto.js          # libsignal wrapper
β”‚   β”‚   β”œβ”€β”€ socket.js          # Socket.IO client
β”‚   β”‚   β”œβ”€β”€ ui.js              # UI management
β”‚   β”‚   └── storage.js         # IndexedDB management
β”‚   └── assets/
β”‚       └── images/
β”‚
β”œβ”€β”€ templates/
β”‚   β”œβ”€β”€ base.html              # Base template
β”‚   β”œβ”€β”€ index.html             # Landing page
β”‚   β”œβ”€β”€ register.html          # Registration page
β”‚   β”œβ”€β”€ login.html             # Login page
β”‚   └── chat.html              # Main chat interface
β”‚
β”œβ”€β”€ uploads/                    # File uploads directory
β”‚   └── .gitkeep
β”‚
β”œβ”€β”€ tests/                      # Test files
β”‚   β”œβ”€β”€ test_auth.py
β”‚   β”œβ”€β”€ test_crypto.py
β”‚   └── test_socket.py
β”‚
└── docs/
    β”œβ”€β”€ API.md                 # API documentation
    β”œβ”€β”€ ARCHITECTURE.md        # Architecture details
    └── SECURITY.md            # Security analysis

πŸ” Security Features

  • Signal Protocol (X3DH + Double Ratchet)
  • Forward Secrecy - Each message uses unique keys
  • Post-Compromise Security - Future messages remain secure after key compromise
  • Zero Knowledge Server - Server never sees plaintext messages
  • bcrypt Password Hashing - Secure credential storage
  • TLS/SSL - All transport encrypted (HTTPS/WSS)
  • File Integrity Verification - SHA-256 checksums

πŸ“Š Development Status

  • Phase 0: Project Setup βœ…
  • Phase 1: Authentication
  • Phase 2: libsignal Integration
  • Phase 3: Private Chat
  • Phase 4: Real-Time Features
  • Phase 5: Group Chat
  • Phase 6: File Sharing
  • Phase 7: Message Enhancements
  • Phase 8: Device Linking
  • Phase 9: UI Polish
  • Phase 10: Testing & Documentation

See plan.md for detailed roadmap.

πŸ§ͺ Testing

# Run all tests
pytest

# Run with coverage
pytest --cov=app tests/

# Run specific test file
pytest tests/test_auth.py

πŸ“š Documentation

🎯 Learning Outcomes

This project demonstrates:

  • βœ… Full-stack web development
  • βœ… Real-time communication systems
  • βœ… Applied cryptography (Signal Protocol)
  • βœ… Database design (MongoDB)
  • βœ… Security best practices
  • βœ… Modern software architecture

🀝 Contributing

This is an academic project. If you'd like to suggest improvements:

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

πŸ“„ License

MIT License - See LICENSE file for details

πŸ‘¨β€πŸ’» Author

Your Name
Final Year Project - Computer Science/Engineering
University Name - 2025-2026

πŸ™ Acknowledgments

  • Signal Protocol - Open Whisper Systems
  • Flask & Socket.IO communities
  • MongoDB documentation
  • My project supervisor and peers

πŸ“ž Contact

For questions or demo requests:


Built with ❀️ for secure communication

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors