Skip to content

Amin4424/ChatApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatApp

Note: This repository contains the public, open-source component and architectural overview of a secure messaging system. The full implementation details and proprietary source code related to the project developed for the client are confidential and protected under NDA.


A feature-rich, cross-platform desktop chat application built with C++ and Qt, supporting real-time messaging, file sharing, and voice communication with end-to-end encryption.

Features

Core Messaging

  • Real-time Communication: WebSocket-based instant messaging
  • Multi-user Support: Simultaneous connections with multiple clients
  • Message History: Persistent storage using SQLite
  • Message Management: Edit and delete sent messages
  • Dual Messaging Modes: Broadcast to all users or private one-to-one chat

Security

  • AES-256-GCM Encryption: Military-grade encryption for all messages
  • Encrypted File Transfers: Secure file sharing with chunk-based encryption
  • OpenSSL Integration: Industry-standard cryptographic library

Media Support

  • Voice Messages: Record and playback voice messages
  • Audio Waveform Visualization: Visual representation of audio messages
  • File Sharing: Resumable file uploads/downloads using TUS protocol
  • Multi-format Support: Handle various file types with progress tracking

User Interface

  • Modern UI Design: Clean, intuitive interface with custom themes
  • Dark/Light Themes: Customizable appearance
  • User List Management: Real-time user presence indicators
  • Toast Notifications: Non-intrusive message alerts
  • Responsive Layout: Adapts to different window sizes

Architecture

The application follows a clean MVC (Model-View-Controller) architecture with modular design:

ChatApp/
├── Client/              # Desktop client application
│   ├── Controller/      # Client-side business logic
│   ├── Model/          # WebSocket client, database, user model
│   └── View/           # UI components and windows
├── Server/             # Multi-user server application
│   ├── Controller/     # Server-side message routing
│   ├── Model/         # WebSocket server, TUS server, database
│   └── View/          # Server UI and user management
├── CommonCore/        # Shared cryptography and file transfer
│   ├── CryptoManager
│   ├── TusUploader/Downloader
│   └── NotificationManager
├── CommonUI/          # Reusable UI components
│   ├── Message components (Text, Audio, File)
│   ├── Theme system
│   └── Widgets (ChatHeader, InputWidget, etc.)
└── assets/           # Application resources (icons, images)

Technology Stack

  • Language: C++17
  • UI Framework: Qt 5.12+ / Qt 6.2+
  • Build System: CMake 3.16+
  • Networking: Qt WebSockets
  • Security: OpenSSL 1.1.1+
  • Database: SQLite (Qt SQL Module)
  • File Transfer: TUS Protocol (resumable uploads)
  • Multimedia: Qt Multimedia

Prerequisites

All Platforms

  • CMake 3.16 or higher
  • C++17 compatible compiler
  • Qt 5.12+ or Qt 6.2+
    • Qt Core
    • Qt Widgets
    • Qt WebSockets
    • Qt Sql
    • Qt Multimedia
    • Qt Network

Linux

sudo apt-get install build-essential cmake qt6-base-dev qt6-websockets-dev \
                     qt6-multimedia-dev libssl-dev libsqlite3-dev

Windows

  • Qt (MinGW or MSVC)
  • OpenSSL for Windows (Download here)
  • Update OpenSSL paths in CMakeLists.txt (lines 45-51) based on your installation

macOS

brew install cmake qt@6 openssl

Building

Clone the Repository

git clone https://github.com/Amin4424/ChatApp.git
cd ChatApp

Build with CMake

mkdir build
cd build
cmake ..
cmake --build .

Platform-Specific Notes

Windows

  1. Install OpenSSL from slproweb.com
  2. Update CMakeLists.txt with your OpenSSL installation path:
    IMPORTED_LOCATION "YOUR_PATH/OpenSSL-Win64/lib/VC/x64/MD/libssl.lib"
    INTERFACE_INCLUDE_DIRECTORIES "YOUR_PATH/OpenSSL-Win64/include"
  3. Build using Qt Creator or CMake with MinGW/MSVC

Linux

cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)

macOS

cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/qt@6 ..
make -j$(sysctl -n hw.ncpu)

Running

Start the Server

./ServerApp

The server will start on:

  • WebSocket: Port 8080 (configurable)
  • TUS File Server: Port 1080

Start the Client

./ClientApp
  1. Enter server IP address and port
  2. Connect to begin chatting

Usage

Sending Messages

  • Type your message in the input field
  • Press Enter or click Send
  • Messages are encrypted before transmission

File Sharing

  1. Click the attachment icon
  2. Select file(s) to upload
  3. Files are encrypted and uploaded using TUS protocol
  4. Recipients can download with progress tracking

Voice Messages

  1. Click and hold the microphone icon
  2. Record your message
  3. Release to send
  4. Waveform visualization shows audio content

Message Management

  • Edit: Click the edit icon on your messages
  • Delete: Click the delete icon to remove messages

Database

The application uses SQLite for persistent storage:

  • Client: client_chat.db - Stores local message history
  • Server: server_chat.db - Centralized message archive

Network Protocols

WebSocket Communication

  • Port: 8080 (default, configurable)
  • Protocol: WSS (WebSocket Secure)
  • Encryption: AES-256-GCM at application layer

File Transfer (TUS)

  • Port: 1080 (default)
  • Protocol: TUS (Tunable Upload Server)
  • Chunk Size: 5MB
  • Features: Resumable uploads, encryption support

Security Features

  • End-to-End Encryption: All messages encrypted with AES-256-GCM
  • Chunk-Based File Encryption: Large files encrypted in 5MB chunks
  • Secure Key Generation: OpenSSL-based key management
  • Encrypted Storage: Message database can be encrypted (optional)

Configuration

Key configuration options in the code:

Server (ServerController.cpp):

int webSocketPort = 8080;  // WebSocket server port
int tusServerPort = 1080;  // File upload server port

Client (ClientController.cpp):

QString serverAddress = "ws://localhost:8080";  // Server address

Project Status

This is a fully functional chat application with core features implemented. For detailed status information, see the project analysis in recent commits.

Completion Level: ~85-90%

  • ✅ Real-time messaging
  • ✅ File and voice sharing
  • ✅ Message encryption
  • ✅ Cross-platform support
  • ⚠️ User authentication (not implemented)
  • ⚠️ Advanced features (video calls, screen sharing)

Known Issues & TODOs

  1. File Encryption API: Complete full file encryption methods (CommonCore/CryptoManager.cpp:83, :89)
  2. Windows Build: Consider VCPKG integration for automated OpenSSL dependency management
  3. User Authentication: Login system not yet implemented
  4. CI/CD: Automated builds and testing pipeline pending

Contributing

This is a demonstration/educational project. The full commercial implementation is proprietary.

License

This public version is provided for educational and demonstration purposes. The complete implementation is proprietary and confidential.

Contact

For questions about the public components of this project, please open an issue on GitHub.


Built with ❤️ using C++ and Qt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors