CPPCord is a native Discord client designed as a lightweight, high-performance alternative to the official Electron-based client. Built entirely with C++23 and Qt 6, it provides a complete Discord experience with significantly lower resource usage and better system integration.
The official Discord client is built with Electron, bundling an entire Chromium browser instance. CPPCord aims to deliver the same functionality with:
- Lower Memory Footprint - Native code with minimal overhead
- Better Performance - Direct system API access and optimized rendering
- Native OS Integration - Secure credential storage and system notifications
- Faster Startup - No JavaScript engine initialization required
- User account authentication (non-bot)
- Secure token storage using platform-native credential managers:
- Windows: Windows Credential Manager
- macOS: Keychain Services
- Linux: libsecret (GNOME Keyring/KWallet)
- Real-time message sending and receiving via Discord Gateway (WebSocket)
- Discord-like message display with HTML/CSS rendering
- Message grouping (same author within 5-minute windows)
- User avatar caching and display
- Date separators with visual dividers
- Permission-based message input (SEND_MESSAGES check)
- Empty channel state indicators
- Guild navigation with icon display (circular, 40x40px)
- Guild sorting by join timestamp
- Channel categorization and hierarchical display
- Channel sorting by category and position
- Direct message support with recent activity sorting
- Guild icon downloading from Discord CDN
- Full voice chat implementation with real-time audio streaming
- Opus audio codec integration (v1.5.2) for encoding/decoding
- libsodium encryption (v1.0.20) with AEAD AES256-GCM support
- Discord voice gateway connection and UDP RTP transport
- Bidirectional audio: microphone input and speaker output
- Support for Discord's rtpsize encryption modes
- Proper RTP header parsing and extension handling
- Native Qt Widgets-based interface
- Fixed-position message layout matching Discord's design
- Responsive avatar and username positioning
- Timestamp formatting with locale support
- Permission-aware UI states
| Component | Technology |
|---|---|
| Language | C++23 |
| GUI Framework | Qt 6.10.1 (Widgets) |
| Build System | CMake 4.2.1 |
| Package Manager | vcpkg |
| Networking | Qt Network (REST), Qt WebSockets (Gateway) |
| Audio Codec | Opus 1.5.2 |
| Encryption | libsodium 1.0.20 |
| Compiler | MSVC 2026 (Windows) / GCC 15.2 (Linux) / Clang 21.1.0 (macOS) |
- Qt Core - Base framework and utilities
- Qt Widgets - Native UI components
- Qt Network - HTTP/HTTPS REST API communication
- Qt WebSockets - Discord Gateway real-time connection
- Qt Multimedia - Audio processing for voice chat
- Project infrastructure and build system
- Qt application framework
- User authentication flow
- Secure token storage (platform-native)
- Discord REST API integration
- WebSocket Gateway connection
- Guild and channel fetching
- Channel categorization and sorting
- Real-time message receiving
- Message sending with permission validation
- Discord-like message display (avatars, grouping, separators)
- User avatar downloading and caching
- Guild icon display
- Direct message support
- DM sorting by recent activity
- Voice library integration (Opus, libsodium)
- Voice channel connection and audio streaming
- Full bidirectional voice chat (input/output)
- AEAD AES256-GCM encryption for voice
- Voice UI (mute/deafen controls, speaking indicators)
- Rich message content (embeds, attachments, reactions)
- Markdown rendering
- User presence and status updates
- Typing indicators
- System notifications
- User settings and preferences
- Theme customization
- Message history pagination
- File uploads
- Emoji picker
Ensure you have the following installed on your system:
- Qt 6.10.1+
- Download from qt.io
- Required modules: Core, Widgets, Network, WebSockets, Multimedia
- CMake 4.2.1+
- vcpkg (package manager for C++ libraries)
- C++23 compatible compiler:
- Windows: Visual Studio 2022 (v17.x) or 2026 (v18.x) with MSVC
- Linux: GCC 15.2+ or Clang 21.1.O+
- macOS: Xcode 26.2+ (includes Clang 21.1.0+)
CPPCord uses vcpkg for dependency management. Set up vcpkg if not already installed:
# Clone vcpkg
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
# Bootstrap (Windows)
.\bootstrap-vcpkg.bat
# Bootstrap (Linux/macOS)
./bootstrap-vcpkg.sh
# Set environment variable
# Windows (PowerShell)
[System.Environment]::SetEnvironmentVariable('VCPKG_ROOT', 'C:\path\to\vcpkg', 'User')
# Linux/macOS (add to .bashrc or .zshrc)
export VCPKG_ROOT=/path/to/vcpkg# Clone the repository
git clone https://github.com/doshibadev/cppcord.git
cd cppcord
# Configure CMake (vcpkg will auto-install dependencies)
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
# Build
cmake --build build --config Release
# Deploy Qt dependencies
C:\Qt\6.10.1\msvc2022_64\bin\windeployqt.exe build\Release\DiscordClient.exe
# Run
.\build\Release\DiscordClient.exe# Install system dependencies (Ubuntu/Debian)
sudo apt update
sudo apt install build-essential cmake git
sudo apt install qt6-base-dev qt6-websockets-dev qt6-multimedia-dev
sudo apt install libsecret-1-dev # For secure token storage
# Clone the repository
git clone https://github.com/doshibadev/cppcord.git
cd cppcord
# Configure and build
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
cmake --build build --config Release -j$(nproc)
# Run
./build/DiscordClient# Install Homebrew (if not already installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Qt
brew install qt@6
# Clone the repository
git clone https://github.com/doshibadev/cppcord.git
cd cppcord
# Configure and build
cmake -B build -S . \
-DCMAKE_PREFIX_PATH=$(brew --prefix qt@6) \
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
cmake --build build --config Release -j$(sysctl -n hw.ncpu)
# Run
./build/DiscordClientcppcord/
├── CMakeLists.txt # Build configuration
├── vcpkg.json # Dependency manifest
├── README.md # Documentation
├── LICENSE # MIT License
├── src/
│ ├── main.cpp # Application entry point
│ ├── core/
│ │ └── (Core application logic)
│ ├── ui/
│ │ ├── LoginDialog.cpp # Authentication UI
│ │ └── MainWindow.cpp # Main application window
│ ├── network/
│ │ ├── DiscordClient.cpp # Discord REST API client
│ │ └── GatewayClient.cpp # WebSocket Gateway handler
│ ├── models/
│ │ ├── Guild.h # Guild data structures
│ │ ├── Channel.h # Channel data structures
│ │ ├── Message.h # Message data structures
│ │ └── User.h # User data structures
│ └── utils/
│ └── TokenStorage.cpp # Secure credential storage
└── build/ # Build output (generated)
Recommended IDEs:
- Qt Creator - Best integration with Qt framework
- Visual Studio (Windows) - Excellent C++ debugging
- Visual Studio Code - Lightweight with CMake extension
- CLion - Full-featured C++ IDE
-
Install required extensions:
- C/C++ (Microsoft) - CMake Tools (Microsoft) - Qt tools (tonka3000) -
Open workspace:
code cppcord
-
Configure CMake:
- Press
Ctrl+Shift+P - Select "CMake: Configure"
- Choose your kit (e.g., "Visual Studio Community 2022 Release - amd64")
- Press
-
Build and run:
- Build:
F7 - Run:
Ctrl+F5
- Build:
- Follow C++ Core Guidelines
- Use Qt naming conventions for Qt-related code
- 4-space indentation
- Descriptive variable and function names
- Document public APIs with comments
# Run unit tests (when implemented)
cd build
ctest --output-on-failure┌─────────────────────────────────────────────────────────────┐
│ UI Layer │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ LoginDialog │ │ MainWindow │ │ Message View │ │
│ └──────┬───────┘ └───────┬──────┘ └────────┬─────┘ │
└─────────┼──────────────────┼──────────────────┼─────────────┘
│ │ │
┌─────────┼──────────────────┼──────────────────┼─────────────┐
│ │ Network Layer │ │
│ ┌──────▼───────┐ ┌───────▼──────┐ ┌────────▼─────┐ │
│ │DiscordClient │ │GatewayClient │ │ CDN (HTTP) │ │
│ │ (REST API) │ │ (WebSocket) │ │ │ │
│ └──────┬───────┘ └───────┬──────┘ └────────┬─────┘ │
└─────────┼──────────────────┼──────────────────┼─────────────┘
│ │ │
┌─────────┼──────────────────┼──────────────────┼─────────────┐
│ │ Data Models │ │
│ ┌──────▼───────┬──────────▼──────┬───────────▼──────┐ │
│ │ Guild │ Channel │ Message │ │
│ │ User │ Role │ Permissions │ │
│ └──────────────┴─────────────────┴──────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
┌─────────▼───────────────────────────────────────────────────┐
│ Utilities & Storage │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │TokenStorage │ │ Avatar Cache │ │ Icon Cache │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────┘
DiscordClient (REST API)
- Handles HTTP requests to Discord's REST API
- Manages authentication and token refresh
- Fetches guilds, channels, messages, and user data
- Implements rate limiting and error handling
GatewayClient (WebSocket)
- Maintains persistent WebSocket connection to Discord Gateway
- Handles real-time events (MESSAGE_CREATE, GUILD_UPDATE, etc.)
- Implements heartbeat and reconnection logic
- Processes and dispatches gateway events
TokenStorage
- Platform-native secure credential storage
- Windows: Credential Manager API
- macOS: Keychain Services API
- Linux: libsecret (GNOME Keyring/KWallet)
MainWindow
- Primary application interface
- Guild and channel navigation
- Message display with Discord-like formatting
- Input handling and permission validation
CPPCord uses Discord API v9 with the following endpoints:
Authentication
GET /users/@me- Current user information- Token-based authentication (user accounts, not bots)
Guilds
GET /users/@me/guilds- List user's guildsGET /guilds/{guild.id}/channels- Guild channels
Channels
GET /channels/{channel.id}/messages- Message historyPOST /channels/{channel.id}/messages- Send messages- Permission validation before message operations
Gateway (WebSocket)
- Real-time event streaming
- Opcode handling (HELLO, HEARTBEAT, IDENTIFY, DISPATCH)
- Event types: MESSAGE_CREATE, GUILD_CREATE, READY, etc.
CDN
- User avatars:
https://cdn.discordapp.com/avatars/{user.id}/{avatar.hash}.png - Guild icons:
https://cdn.discordapp.com/icons/{guild.id}/{icon.hash}.png
Windows
# Build Release
cmake --build build --config Release
# Deploy Qt dependencies
C:\Qt\6.10.1\msvc2022_64\bin\windeployqt.exe build\Release\DiscordClient.exe
# Create installer (using NSIS or WiX)
# Package the Release folder into an installerLinux
# Build Release
cmake --build build --config Release
# Create AppImage (recommended)
# Or use linuxdeployqt for bundling Qt librariesmacOS
# Build Release
cmake --build build --config Release
# Create .app bundle
macdeployqt build/DiscordClient.app -dmgContributions are welcome and appreciated! Whether you're fixing bugs, adding features, or improving documentation, your help makes CPPCord better.
-
Fork the repository
# Click "Fork" on GitHub, then clone your fork git clone https://github.com/doshibadev/cppcord.git -
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Write clean, documented code
- Follow existing code style
- Test your changes thoroughly
-
Commit and push
git add . git commit -m "Add: description of your changes" git push origin feature/your-feature-name
-
Open a Pull Request
- Describe your changes
- Reference any related issues
- Wait for review
Current focus areas for contributions:
- Voice Chat - Complete voice channel connection and audio streaming
- Rich Messages - Embed rendering, markdown support, reactions
- Notifications - System notifications for new messages
- Settings - User preferences and customization
- Performance - Memory optimization and rendering improvements
- Testing - Unit tests and integration tests
Found a bug? Have a feature request?
- Check existing issues first
- Use the GitHub issue tracker
- Provide detailed information:
- Operating system and version
- Qt version
- Steps to reproduce
- Expected vs actual behavior
- Screenshots if applicable
If you discover a security vulnerability, please report it privately:
- Do not open a public issue
- Email: security@cppcord.dev (or contact via GitHub)
- Provide details about the vulnerability
- Allow time for a fix before public disclosure
- Token encryption using platform-native credential stores
- No plaintext password storage
- Secure HTTPS connections for all API requests
- WebSocket TLS encryption (wss://)
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2025 doshibadev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Important Legal Notice
- CPPCord is an unofficial Discord client
- Not affiliated with, endorsed by, or sponsored by Discord Inc.
- Use at your own risk
- Discord's Terms of Service and Community Guidelines apply
- Self-botting and automation may violate Discord's ToS
- The developers are not responsible for any account actions taken by Discord
This project stands on the shoulders of giants:
- Discord - For providing the API and platform
- Qt Project - For the excellent cross-platform framework
- vcpkg - For seamless C++ dependency management
- Opus - For high-quality audio codec
- libsodium - For modern cryptography
- Open Source Community - For tools, libraries, and inspiration
- Complete voice chat implementation
- Voice UI controls (mute, deafen, volume)
- Speaking indicators
- Rich embed rendering
- Markdown message formatting
- Reaction support
- Message editing and deletion
- File upload support
- System notifications
- User settings panel
- Theme customization
- Typing indicators
- Feature parity with essential Discord functionality
- Comprehensive testing suite
- Performance optimization
- Documentation completion
- Documentation: Check this README and code comments
- Issues: Browse or create GitHub Issues
- Discussions: Join GitHub Discussions
- GitHub: @doshibadev
- Discord: doshibadev
Made with passion for native applications and efficient code.
Star this repository if you find it useful!