dusk chat

dusk chat

a peer-to-peer community chat platform. no central server. your data stays yours.

version license rust tauri solid-js p2p

--- ## 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 ```bash 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 ```bash sudo pacman -Syu sudo pacman -S --needed \ webkit2gtk-4.1 \ base-devel \ curl \ wget \ file \ openssl \ appmenu-gtk-module \ libappindicator-gtk3 \ librsvg \ xdotool ```
fedora ```bash 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 ```bash sudo emerge --ask \ net-libs/webkit-gtk:4.1 \ dev-libs/libappindicator \ net-misc/curl \ net-misc/wget \ sys-apps/file ```
opensuse ```bash 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 ```bash 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) ```bash 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](https://wiki.nixos.org/wiki/Tauri).
#### macos install [xcode](https://developer.apple.com/xcode/resources/) from the mac app store or the apple developer website. launch it once after installing so it finishes setup. #### windows 1. install [microsoft c++ build tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) and check "desktop development with c++" during setup 2. webview2 is pre-installed on windows 10 (1803+) and windows 11. if you're on an older version, install the [webview2 runtime](https://developer.microsoft.com/en-us/microsoft-edge/webview2/) 3. install rust via [rustup](https://rustup.rs) or `winget install --id Rustlang.Rustup` -- make sure the MSVC toolchain is selected as default ### installation 1. clone the repository ```bash git clone https://git.clxud.dev/duskchat/app dusk-chat cd dusk-chat ``` 2. install frontend dependencies ```bash bun install ``` 3. (optional) clone and run the relay server locally ```bash git clone https://git.clxud.dev/duskchat/relay relay-server cd relay-server cargo run ``` ### running the app #### development mode (full app) ```bash bun run tauri dev ``` this compiles the rust backend and starts the vite dev server on port 1420. #### frontend only (no tauri shell) ```bash 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: ```env DUSK_RELAY_ADDR=/ip4//tcp//p2p/ ``` ## development commands ```bash # 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 ``` ## contributing 1. fork the repository and install dependencies as described above 2. create a feature branch (`git checkout -b feature/my-feature`) 3. make your changes with clear commit messages 4. ensure application is in a working state and all tests pass if applicable 5. submit a pull request with a detailed description of your changes and the problem they solve. ## license see the main project license file.