4.1 KiB
4.1 KiB
Ditchcord
Ditchcord is a self-hosted, privacy-oriented chat application built with Svelte 5 and SpacetimeDB. Designed as a modern, lightweight alternative to commercial platforms, it prioritizes performance, low-latency communication, and high feature density without the bloat.
🚀 Features
Ditchcord offers a rich, Discord-inspired user experience backed by a highly scalable, WebAssembly-powered database architecture.
- Multi-Server & Channel Support: Organize your communities with dedicated Text, Voice, and Threaded channels.
- Blazing Fast Pagination: Uses a sophisticated hybrid "Recent Activity Cache" to load channels instantly, with on-demand expansion for deep history scrollback.
- Real-Time Voice & Video: Integrated WebRTC signaling via SpacetimeDB for low-latency audio channels and screen sharing.
- Rich Media & Profiles: Support for custom emojis, image uploads (up to 10MB), and customizable user profiles (avatars, banners, biographies).
- Modern Svelte 5 UI: Built with Svelte Runes for granular reactivity, featuring custom portaled dropdowns, context menus, and a responsive design that adapts to your screen.
- Tauri Ready: The Vite configuration is tailored for easy packaging as a native desktop application via Tauri.
🗺️ Roadmap
We are actively developing Ditchcord. Here is what's coming next:
- Direct Messaging: Private, 1-on-1 conversations outside of server contexts.
- Mentions & Notifications: Robust
@userand@roletagging with RLS-protected notification delivery. - Read Status: Unread badges and indicators for channels and servers.
- Message Interactions: Replying directly to messages (in addition to threading), grouping consecutive messages, and GIF integration.
- Server Management: Private servers, invite links, role-based permission systems, and custom server avatars.
- Customization: Full theming support (Dark/Light mode toggles) and hotkey shortcuts.
🛠️ Technology Stack
- Frontend: Svelte 5 (TypeScript, Vite, Vanilla CSS)
- Backend: SpacetimeDB (TypeScript/WASM module)
- Real-time Comms: WebRTC (Peer-to-peer audio/video)
- Desktop: Tauri (Planned/Configured)
Architecture Highlights
Ditchcord leverages SpacetimeDB's client-side cache model to eliminate traditional REST API bottlenecks.
- Zero-Latency Switching: The client subscribes to a lightweight
recent_messagetable for all joined servers on startup. This populates the UI instantly when switching channels. - Surgical Subscriptions: The heavy
messagehistory table is only subscribed to on-demand when a user explicitly requests older messages, saving bandwidth and memory. - WASM Reducers: All database mutations (sending messages, updating profiles) are handled by deterministic TypeScript reducers compiled to WebAssembly and executed transactionally on the server.
📦 Getting Started
Prerequisites
- Node.js (v18+)
- pnpm
- SpacetimeDB CLI (
spacetime)
Backend Setup (SpacetimeDB)
- Navigate to the backend module directory:
cd spacetimedb - Install dependencies:
npm install - Publish the module to your SpacetimeDB instance (e.g.,
maincloudor a local instance). Note: The first publish creates the database.spacetime publish --server maincloud ditchcord - Generate the TypeScript bindings for the frontend:
npm run spacetime:generate
Frontend Setup (Svelte 5)
- Navigate to the project root:
cd .. - Install dependencies:
pnpm install - Configure your environment variables (create a
.env.localfile if necessary) to point to your published SpacetimeDB instance:VITE_SPACETIMEDB_HOST=wss://maincloud.spacetimedb.com VITE_SPACETIMEDB_DB_NAME=ditchcord - Run the development server:
pnpm run dev
📄 License
This project is open-source. Please see the LICENSE file for details.