Skip to content

JerrettDavis/DiscordDataMirror

Repository files navigation

🔮 DiscordDataMirror

A powerful, self-hosted solution for archiving and exploring Discord server data

.NET License Release Docker

📖 Documentation · 🐛 Report Bug · 💡 Request Feature


🎯 What is DiscordDataMirror?

DiscordDataMirror is a complete Discord archiving solution that captures, stores, and lets you explore all data from your Discord servers. It runs as a background service, silently recording every message, member, channel, and reaction in real-time — creating a permanent, searchable backup that you fully control.

Why do you need this?

  • Discord has retention limits — Messages can be auto-deleted, and server owners can purge history at any time
  • Users delete messages — Important context disappears when people delete their messages
  • Servers get deleted — Community history can vanish overnight
  • Discord's search is limited — You can't search deleted messages or export your data easily
  • Compliance requirements — Some organizations need to archive communications

DiscordDataMirror solves all of these problems by maintaining a complete, independent copy of your Discord data.


✨ Features

📝 Comprehensive Message Archiving

Every message is captured the instant it's sent, before it can be deleted or modified. You'll never lose important discussions, announcements, or memories again.

  • Real-time capture via Discord's Gateway API
  • Preserves message content, embeds, and formatting
  • Tracks edits and deletions (original content retained)
  • Supports all message types: replies, pins, system messages
  • Full attachment metadata (with optional local caching)

👥 Complete Member Tracking

Maintain a complete record of everyone who has ever been in your servers.

  • User profiles with avatars, usernames, and creation dates
  • Guild-specific data: nicknames, roles, join dates
  • Join/leave history tracking
  • Bot account flagging

📁 Full Server Structure Mirroring

The entire server hierarchy is preserved, including ephemeral content.

  • All channel types: text, voice, forums, stages, categories
  • Thread capture (including auto-archived threads)
  • Role hierarchy and permissions
  • Channel topics and descriptions

🔍 Powerful Search

Find any message across all your servers instantly.

  • Full-text search powered by PostgreSQL
  • Filter by server, channel, user, or date range
  • Search deleted messages
  • Export search results

🎨 Beautiful Dashboard

A modern, Discord-like interface for browsing your archives.

Dashboard Preview

  • Familiar Discord-style message rendering
  • Channel browser with message counts
  • User activity timelines
  • Real-time sync status monitoring

🐳 Docker Ready

Deploy anywhere with Docker Compose.

docker pull ghcr.io/jerrettdavis/discorddatamirror-bot:latest
docker pull ghcr.io/jerrettdavis/discorddatamirror-dashboard:latest

🔭 Built with .NET Aspire

Modern cloud-native architecture with built-in observability.

  • Automatic service discovery
  • Distributed tracing
  • Health checks and metrics
  • Centralized logging

🚀 Quick Start

Prerequisites

Requirement Version
.NET SDK 10.0+
Docker Desktop 4.0+
Discord Bot Token Get one here

Installation

Option 1: Docker Compose (Recommended for Production)

# Clone the repository
git clone https://github.com/JerrettDavis/DiscordDataMirror.git
cd DiscordDataMirror/publish

# Configure environment
cp .env.example .env
# Edit .env with your Discord token and settings

# Start the stack
docker compose up -d

Option 2: Local Development

# Clone the repository
git clone https://github.com/JerrettDavis/DiscordDataMirror.git
cd DiscordDataMirror

# Configure bot token
./scripts/setup-bot.ps1  # Windows
./scripts/setup-bot.sh   # Linux/Mac

# Run with Aspire
cd src/DiscordDataMirror.AppHost
dotnet run

First Run

  1. Aspire Dashboard: Open https://localhost:17113 to see all services
  2. Data Dashboard: Open https://localhost:5001 to browse archived data
  3. Discord Server: Verify the bot appears online in your server

The bot will begin syncing historical messages in the background. This may take several minutes for large servers.


📊 Screenshots

Dashboard Overview

Dashboard Overview

View all your monitored servers at a glance with message counts, member stats, and sync status.

Channel Browser

Channel Browser

Navigate your server's channel structure with Discord-like familiarity. See message counts and quickly jump to any channel.

Message Viewer

Message Viewer

Read messages exactly as they appeared in Discord, complete with embeds, reactions, and reply chains.

Sync Status

Sync Status

Monitor real-time synchronization progress across all your servers.


⚙️ Configuration

Essential Settings

Setting Description Default
Discord:Token Your bot's authentication token Required
Discord:SyncOnStartup Fetch historical messages on start true
Sync:MaxHistoricalMessages Max messages per channel to backfill 10000
Attachments:EnableCaching Download attachments locally false

Environment Variables (Docker)

Discord__Token=your-bot-token
Sync__MaxHistoricalMessages=50000
Attachments__EnableCaching=true

📖 See the full configuration reference for all options.


🏗️ Architecture

DiscordDataMirror follows Domain-Driven Design and Clean Architecture principles:

┌─────────────────────────────────────────────────┐
│              Presentation                       │
│    (Dashboard, Bot Worker Service)              │
├─────────────────────────────────────────────────┤
│              Application                        │
│    (Commands, Queries, Handlers, DTOs)          │
├─────────────────────────────────────────────────┤
│              Domain                             │
│    (Entities, Aggregates, Value Objects)        │
├─────────────────────────────────────────────────┤
│              Infrastructure                     │
│    (EF Core, Discord.Net, Repositories)         │
└─────────────────────────────────────────────────┘

Technology Stack

Layer Technology
Runtime .NET 10
Orchestration Aspire 13.1
Dashboard Blazor Server + MudBlazor
Database PostgreSQL 17
Discord API Discord.Net
CQRS MediatR
ORM Entity Framework Core

📖 See ARCHITECTURE.md for detailed documentation.


📁 Project Structure

DiscordDataMirror/
├── src/
│   ├── DiscordDataMirror.AppHost/           # Aspire orchestrator (start here!)
│   ├── DiscordDataMirror.ServiceDefaults/   # Shared Aspire defaults
│   ├── DiscordDataMirror.Domain/            # Domain layer (entities, events)
│   ├── DiscordDataMirror.Application/       # Application layer (CQRS)
│   ├── DiscordDataMirror.Infrastructure/    # Infrastructure layer (EF, Discord)
│   ├── DiscordDataMirror.Bot/               # Discord bot worker
│   └── DiscordDataMirror.Dashboard/         # Blazor dashboard
├── tests/                                    # Unit and integration tests
├── docs/                                     # Documentation (DocFX)
├── scripts/                                  # Setup and utility scripts
├── publish/                                  # Docker Compose files
└── README.md

📖 Documentation

Document Description
Getting Started Complete setup walkthrough
Features Detailed feature descriptions
Configuration All configuration options
Bot Setup Discord Developer Portal guide
Deployment Production deployment with Docker
Architecture System design and patterns
FAQ Frequently asked questions
Troubleshooting Common issues and solutions
Contributing How to contribute

🛡️ Privacy & Security

What data is collected?

  • All messages, members, channels, and roles from servers the bot can access
  • No data leaves your infrastructure — everything stays on your servers

Security best practices

  • Store bot tokens in user secrets or secure vaults (never in code)
  • Use HTTPS for dashboard access
  • Restrict database access to trusted networks
  • Enable PostgreSQL encryption at rest for sensitive data
  • Regular backups to secure, separate storage

Compliance considerations

  • Inform your community that messages are being archived
  • Honor GDPR/CCPA data deletion requests
  • Consider retention policies for sensitive data

🤝 Contributing

We welcome contributions of all kinds!

# Development workflow
git clone https://github.com/JerrettDavis/DiscordDataMirror.git
cd DiscordDataMirror
dotnet build
dotnet test

📜 License

This project is licensed under the MIT License — see the LICENSE file for details.


🙏 Acknowledgments


Made with ❤️ by the community

⭐ Star this repo if you find it useful!

About

A Discord archival solution built with .NET Aspire - archive messages, channels, members, and attachments with a Discord-like Blazor dashboard

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors