A comprehensive modmail system for Discord servers, enabling users to communicate privately with server moderators through direct messages.
The system consists of three main components:
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Discord Bot │ │ Backend API │ │ Web Dashboard │
│ (TypeScript) │◄──►│ (Rust) │◄──►│ (SvelteKit) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Discord API │ │ PostgreSQL │ │ Discord OAuth │
│ │ │ Database │ │ │
└─────────────────┘ └──────────────────┘ └─────────────────┘
- Discord Bot - Handles DMs, creates threads, manages Discord channels
- Backend API - REST API server for data persistence and management
- Web Dashboard - Moderator interface for thread and macro management
- User Interaction: User sends DM to Discord bot
- Thread Creation: Bot creates thread in backend and Discord channel
- Message Relay: Messages flow bidirectionally between user and moderators
- Web Management: Moderators use dashboard to view history and manage macros
- Thread Closure: Moderators close threads via bot commands or web interface
-
Database Setup:
# Start PostgreSQL with Docker docker-compose up -d postgres
-
Backend:
cd backend cargo run
-
Discord Bot:
cd discord bun install bun run deploy bun run start
-
Frontend:
cd frontend bun install bun run dev
Each component requires specific environment variables. See individual package READMEs for detailed configuration:
The system includes Docker configurations for containerized deployment:
docker-compose up -d
This starts all services with proper networking and database connections.
- Seamless Communication: Users DM the bot, moderators respond in dedicated channels
- Thread Management: Automatic thread creation and organization
- Message History: Complete conversation logs accessible via web dashboard
- Macro System: Predefined responses for common inquiries
- Role-based Access: Discord role integration for moderator permissions
- Backend: Rust, Actix Web, SQLx, PostgreSQL
- Discord Bot: TypeScript, discord.js, Bun
- Frontend: SvelteKit, TypeScript, Vite
- Database: PostgreSQL with SQLx migrations
- Deployment: Docker, Docker Compose