Self-hosted Discord alternative - Go backend
- Go 93.7%
- HTML 4.7%
- Shell 1.4%
- Makefile 0.2%
WebUI's registration handler was missing the logic to assign Admin role to the first registered user. Only the API endpoint in main.go had this. |
||
|---|---|---|
| cmd | ||
| deploy | ||
| docs | ||
| frontend | ||
| internal | ||
| pkg/trpcclient | ||
| scripts | ||
| .git-credentials.env | ||
| .gitignore | ||
| AGENTS.md | ||
| CLAUDE.md | ||
| CODEX.md | ||
| GEMINI.md | ||
| GLM.md | ||
| go.mod | ||
| go.sum | ||
| integration_test.go | ||
| main.go | ||
| Makefile | ||
| PLAN.md | ||
| PROGRESS.md | ||
| README.md | ||
| sqlc.yaml | ||
MumsiCord
A self-hosted chat platform with text channels, voice chat, roles, permissions, file sharing, and custom emojis. Built with Go and SQLite.
Features
- Text channels organized in categories with rich permissions
- Voice chat via WebRTC (Pion)
- Role-based permissions with global, channel-role, and channel-user overrides
- File uploads with MIME type validation
- Custom emojis
- Invite system
- Three clients: web UI, terminal (TUI), and desktop (Wails)
- Real-time updates via tRPC over WebSocket and SSE
- Security hardened -- CORS allowlist, CSP, rate limiting, input validation
Architecture
Clients Server
+-----------+ +---------------------------+
| Web UI |--HTTP/SSE------->| HTTP routes |
| TUI |--WebSocket------>| tRPC WebSocket handler |
| Desktop |--WebSocket------>| Pub/Sub broker |
+-----------+ | SQLite + sqlc |
| Pion WebRTC (voice) |
+---------------------------+
Quickstart
Server
# Build
CGO_ENABLED=1 go build -o mumsicord .
# Configure (required: JWT secret)
export MUMSICORD_JWT_SECRET=$(openssl rand -base64 32)
# Run
./mumsicord
# Server starts on :3000
Open http://localhost:3000 for the web UI.
TUI Client
cd cmd/tui
CGO_ENABLED=0 go build -o mumsicord-tui .
./mumsicord-tui --server ws://localhost:3000/trpc
Desktop Client
cd cmd/desktop
wails build
# Binary in build/bin/
Building from Source
Requirements: Go 1.22+, GCC (for SQLite CGO)
# Server (requires CGO for SQLite)
CGO_ENABLED=1 go build -o mumsicord .
# TUI (no CGO needed)
CGO_ENABLED=0 go build -o mumsicord-tui ./cmd/tui
# Desktop (requires Wails CLI)
cd cmd/desktop && wails build
# Run tests
CGO_ENABLED=1 go test ./...
Packaging Scripts
bash scripts/build-server.sh 1.0 # build/mumsicord-server-1.0-linux-amd64.tar.gz
bash scripts/build-tui.sh 1.0 # cross-compiled archives in build/tui/
bash scripts/build-desktop.sh 1.0 # desktop archive in build/desktop/
make package-all VERSION=1.0 # all of the above
Documentation
- Admin Guide -- installation, configuration, security, backup
- User Guide -- using the web UI, TUI, and desktop clients
- API Reference -- HTTP endpoints, tRPC procedures, WebSocket protocol
Project Structure
.
+-- main.go Server entry point
+-- internal/
| +-- config/ Environment-based configuration
| +-- auth/ JWT + bcrypt authentication
| +-- database/ SQLite schema, migrations, sqlc queries
| +-- router/ tRPC procedure handlers
| +-- permissions/ Role-based permission resolver
| +-- pubsub/ In-memory pub/sub broker
| +-- trpc/ tRPC-over-WebSocket protocol
| +-- ratelimit/ Per-IP token bucket rate limiter
| +-- files/ File upload/download handler
| +-- voice/ WebRTC voice room management
| +-- web/ Web UI handlers and templates
| +-- plugins/ Plugin system
+-- pkg/trpcclient/ Shared tRPC client library
+-- frontend/ Embedded web UI assets
+-- cmd/tui/ Terminal client
+-- cmd/desktop/ Wails desktop client
+-- deploy/ systemd service + env template
+-- scripts/ Build/packaging scripts
+-- docs/ Documentation
License
All rights reserved.