🚀 Decentra

A decentralized, Discord-like chat server and client that is non-federated and self-hostable

Overview

Decentra is a decentralized, self-hosted, Discord-adjacent chat platform meant for those that may not like the federated and non-private practices of Discord.

Why Decentra?

I created Decentra because I was unsatisfied with other selfhosted and open source options that were available. Many of them like Rocket Chat and Revolt lacked ease of setup, had high resource overhead, and lacked a comfortable UI that was as easy to use as Discord. Other options like Spacebar for example had the UI, but lacked recent development, had large libraries, had slow UX and high overhead, and were nearly impossible to setup properly.


The goal for Decentra is to be simple, easy to run with 1 command, and always free and decentralized. I want this to be able to run on a free VPS or raspberry pi and not be limited in terms of features. Development will continue constantly, always adding new features or improving the current ones to make them bullet proof.


I also wanted Android, Windows, Mac, and Linux native clients so that Decentra can feel as similar to the Discord experience without sacrificing privacy

✨ Features

💬

Real-Time Messaging

WebSocket-based instant messaging with complete message history stored in PostgreSQL.

🖥️

Servers & Channels

Create multiple servers with text and voice channels. Granular permissions for channel management.

👥

Friend System

Search for users, add friends, and enjoy private direct messaging conversations.

🎤

Voice Chat

Direct voice calls and voice channels using peer-to-peer WebRTC connections.

💾

Persistent Storage

All data stored in PostgreSQL - users, messages, servers persist across restarts.

🔐

Secure Authentication

Username/password authentication with invite code system for controlled access.

🐳

Docker Ready

Fully containerized with Docker and Docker Compose for easy deployment.

🌐

Modern Web UI

Beautiful, responsive Discord-like interface accessible from any browser.

📧

Email Notifications

SMTP support for system emails with configurable settings in admin panel.

🔌

REST API

HTTP REST API available for desktop app integration and automation.

🏗️ Architecture

Server Layer

  • server.py: Combined HTTP and WebSocket server
  • database.py: PostgreSQL data layer
  • api.py: REST API endpoints
  • Handles authentication, messaging, and real-time communication

Database

  • PostgreSQL 16: Production-ready relational database
  • Stores users, servers, channels, messages, and friendships
  • Docker volume for data persistence
  • Automatic schema initialization

Web Client

  • index.html: Login and signup page
  • chat.html: Main chat interface
  • voice.js: WebRTC voice implementation
  • Discord-like responsive UI design

Technology Stack