8.5 KiB
dusk chat
a peer-to-peer community chat platform. no central server. your data stays yours.
what is dusk chat
dusk chat is a decentralized alternative to discord. every user runs a full node and client in a single desktop app with peer discovery through a custom relay server. messages sync between peers using CRDTs (conflict-free replicated data types), so there's no single point of failure and no server that can read your messages.
key features
- serverless: no central database or message storage. every peer stores their own data
- privacy-first: end-to-end encrypted by design. the relay only forwards encrypted bytes
- offline-first: continue chatting while offline. messages sync when you reconnect
- crdt-powered: automatic conflict resolution using automerge. no message loss
- lan discovery: automatic peer discovery on local networks via mDNS
- wan connectivity: connect to peers anywhere via relay server and rendezvous protocol
- invite codes: share communities without exposing IP addresses
getting started
prerequisites
- bun: package manager for frontend (https://bun.sh)
- rust: for backend and relay server (https://rustup.rs)
- node: for tauri cli (comes with bun)
system dependencies
dusk chat is built on tauri v2, which requires platform-specific system libraries. install the dependencies for your OS before building.
linux
debian / ubuntu
sudo apt update
sudo apt install libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev
arch / manjaro
sudo pacman -Syu
sudo pacman -S --needed \
webkit2gtk-4.1 \
base-devel \
curl \
wget \
file \
openssl \
appmenu-gtk-module \
libappindicator-gtk3 \
librsvg \
xdotool
fedora
sudo dnf check-update
sudo dnf install webkit2gtk4.1-devel \
openssl-devel \
curl \
wget \
file \
libappindicator-gtk3-devel \
librsvg2-devel \
libxdo-devel
sudo dnf group install "c-development"
gentoo
sudo emerge --ask \
net-libs/webkit-gtk:4.1 \
dev-libs/libappindicator \
net-misc/curl \
net-misc/wget \
sys-apps/file
opensuse
sudo zypper up
sudo zypper in webkit2gtk3-devel \
libopenssl-devel \
curl \
wget \
file \
libappindicator3-1 \
librsvg-devel
sudo zypper in -t pattern devel_basis
alpine
sudo apk add \
build-base \
webkit2gtk-4.1-dev \
curl \
wget \
file \
openssl \
libayatana-appindicator-dev \
librsvg
note: alpine containers don't include fonts by default. install at least one font package (e.g. font-dejavu) for text to render correctly.
ostree (silverblue / kinoite)
sudo rpm-ostree install webkit2gtk4.1-devel \
openssl-devel \
curl \
wget \
file \
libappindicator-gtk3-devel \
librsvg2-devel \
libxdo-devel \
gcc \
gcc-c++ \
make
sudo systemctl reboot
nixos
see the nixos wiki page for tauri.
macos
install xcode from the mac app store or the apple developer website. launch it once after installing so it finishes setup.
windows
- install microsoft c++ build tools and check "desktop development with c++" during setup
- webview2 is pre-installed on windows 10 (1803+) and windows 11. if you're on an older version, install the webview2 runtime
- install rust via rustup or
winget install --id Rustlang.Rustup-- make sure the MSVC toolchain is selected as default
installation
- clone the repository
git clone https://git.clxud.dev/duskchat/app dusk-chat
cd dusk-chat
- install frontend dependencies
bun install
- (optional) clone and run the relay server locally
git clone https://git.clxud.dev/duskchat/relay relay-server
cd relay-server
cargo run
running the app
development mode (full app)
bun run tauri dev
this compiles the rust backend and starts the vite dev server on port 1420.
frontend only (no tauri shell)
bun run dev
this will run the vite dev server without the tauri backend. useful for faster iteration on UI components with mock data.
wan connectivity setup
dusk chat comes with a built-in relay server (relay.duskchat.app) that serves as the primary relay for peer discovery. you can also run your own locally or deploy it to a cloud provider.
to add your own:
DUSK_RELAY_ADDR=/ip4/<relay-ip>/tcp/<port>/p2p/<relay-peer-id>
development commands
# install frontend dependencies
bun install
# run full app (rust + vite)
bun run tauri dev
# run frontend only (demo data)
bun run dev
# build for production
bun run tauri build
# run relay server
cd relay-server && cargo run
# run relay server with custom port
DUSK_RELAY_PORT=4002 cargo run
desktop packaging (windows / macos / linux)
run packaging commands from the app/ directory.
# all bundles supported by your current OS
bun run package
# linux bundles
bun run package:linux
# macOS bundles
bun run package:macos
# windows bundles
bun run package:windows
expected bundle outputs are written to:
app/src-tauri/target/release/bundle/
common artifact types by platform:
- linux:
appimage,deb,rpm - macos:
.app,.dmg - windows:
nsisinstaller,msi
ci packaging workflow
cross-platform packaging is automated in:
app/.gitea/workflows/desktop-packaging.yml
workflow behavior:
- runs a matrix build on self-hosted gitea runners for linux, macos, and windows
- uses runner label sets:
- linux:
self-hosted,linux,x64 - macos:
self-hosted,macos - windows:
self-hosted,windows,x64
- linux:
- installs bun + rust, then runs platform-specific packaging scripts from
app/package.json - archives bundles from
app/src-tauri/target/release/bundle/into:ci-artifacts/dusk-linux-bundles.tar.gzci-artifacts/dusk-macos-bundles.tar.gzci-artifacts/dusk-windows-bundles.zip
- attempts artifact upload with
actions/upload-artifact(best effort) - always keeps a fallback copy in runner workspace at
ci-artifacts/(printed in logs), so artifacts can still be collected when artifact-service compatibility differs across gitea setups
workflow triggers:
- manual dispatch (
workflow_dispatch) - version tag pushes matching
v* - pull requests touching
app/**(including packaging files)
runner assumptions:
- runners are provisioned and registered in gitea with the labels listed above
- linux runners either provide tauri system deps already, or support
apt-getinstallation during the workflow - macos/windows signing and notarization are not configured in this workflow; output installers are unsigned unless runner-side signing is added
contributing
- fork the repository and install dependencies as described above
- create a feature branch (
git checkout -b feature/my-feature) - make your changes with clear commit messages
- ensure application is in a working state and all tests pass if applicable
- submit a pull request with a detailed description of your changes and the problem they solve.
license
see the main project license file.