Summary
Add support for aggregating Discord statistics across multiple servers with per-user configuration. This will allow the backend to monitor multiple Discord servers simultaneously, while giving end-users the ability to select which servers to include in their personalized analytics views.
User Stories
As a Server Administrator
- I want to configure the backend to monitor multiple Discord servers so that I can provide analytics across all my communities
- I want to manage server credentials centrally so that I don't have to redeploy for each new server
- I want to see which servers are currently being monitored and their connection status
As an End User
- I want to select which of my Discord servers to include in my analytics so that I can focus on the communities I care about
- I want to save my server preferences so that I don't have to reconfigure them every time
- I want to see aggregated statistics across all my selected servers in a single dashboard
- I want to toggle individual servers on/off to compare different communities
- I want to see per-server breakdowns as well as cross-server aggregations
Current Behavior
Currently, the application:
- Only supports viewing statistics for one Discord server at a time
- Requires manual server ID input for each query
- Has no persistent user preferences or settings
- No aggregation capabilities across multiple servers
Proposed Behavior
Backend Changes
-
Multi-Server Configuration
- Support multiple Discord bot tokens/credentials in configuration
- Store server configurations in a database or config file
- Monitor multiple servers simultaneously via single bot or multiple bots
- Health checks for each monitored server connection
-
Server Registry
- Database schema to store monitored servers
- API endpoints to manage server configurations (CRUD operations)
- Server metadata (name, icon, description, join date, etc.)
- Connection status tracking
-
Aggregation Engine
- New API endpoints for multi-server statistics
- Query parameter or request body to specify which servers to aggregate
- Efficient data aggregation across multiple guilds
- Support for both aggregated and per-server breakdowns
Frontend Changes
-
User Settings Page
- New settings/preferences screen
- List of all available monitored servers
- Checkbox/toggle interface to select servers for aggregation
- Save preferences to localStorage or user profile (if auth implemented)
- Server search/filter capabilities
-
Enhanced Dashboard
- Toggle between "All Servers" and "Individual Server" views
- Multi-server statistics with clear labeling
- Comparison mode to view metrics side-by-side
- Server selector dropdown for quick filtering
- Visual indicators showing which servers are included in current view
-
Server Management UI (Admin)
- Admin panel to add/remove monitored servers
- Display server connection status
- Test connectivity for each server
- View server-specific configuration
Technical Requirements
Backend API Endpoints
GET /api/discord/servers # List all monitored servers
POST /api/discord/servers # Add new server to monitor
DELETE /api/discord/servers/:serverId # Remove server from monitoring
GET /api/discord/servers/:serverId/health # Check server connection status
GET /api/discord/stats/multi/guild # Aggregated guild stats
POST /api/discord/stats/multi/messages # Aggregated message stats
Body: { serverIds: string[] }
GET /api/discord/stats/multi/activity # Cross-server activity
Query: ?serverIds=id1,id2,id3
GET /api/discord/stats/comparison # Side-by-side comparison
Query: ?serverIds=id1,id2,id3
Database Schema
// Server Configuration
interface MonitoredServer {
id: string; // Guild ID
name: string;
icon?: string;
description?: string;
botToken?: string; // Optional: separate bot per server
addedAt: Date;
lastSeen: Date;
isActive: boolean;
settings: {
messageLimit: number;
refreshInterval: number;
};
}
// User Preferences (if implementing user auth)
interface UserPreferences {
userId: string;
selectedServers: string[]; // Array of server IDs
defaultView: 'aggregated' | 'individual';
savedAt: Date;
}
Frontend State Management
// User Settings Context/Store
interface UserSettings {
selectedServerIds: string[];
viewMode: 'aggregated' | 'individual' | 'comparison';
availableServers: MonitoredServer[];
}
// Aggregated Stats Types
interface AggregatedGuildStats {
totalServers: number;
totalMembers: number;
totalOnlineMembers: number;
totalChannels: number;
perServerStats: GuildStats[];
}
interface AggregatedMessageStats extends MessageStats {
perServerStats: {
serverId: string;
serverName: string;
stats: MessageStats;
}[];
}
Implementation Considerations
Phase 1: Backend Multi-Server Support
Phase 2: Frontend Settings & Selection
Phase 3: Aggregated Views
Phase 4: Admin Interface (Optional)
UI/UX Mockup Ideas
Settings Page
┌─────────────────────────────────────────┐
│ Settings │
│ │
│ Your Discord Servers │
│ ┌───────────────────────────────────┐ │
│ │ ✓ My Gaming Community │ │
│ │ 1,234 members • Online │ │
│ ├───────────────────────────────────┤ │
│ │ ✓ Dev Team Server │ │
│ │ 56 members • Online │ │
│ ├───────────────────────────────────┤ │
│ │ ☐ Friends Hangout │ │
│ │ 23 members • Online │ │
│ └───────────────────────────────────┘ │
│ │
│ [Save Preferences] │
└─────────────────────────────────────────┘
Aggregated Dashboard Header
Viewing: My Gaming Community, Dev Team Server (2 servers)
[Change Servers] [View Mode: Aggregated ▼]
Security Considerations
Performance Considerations
Testing Requirements
Documentation Updates
Acceptance Criteria
Backend
Frontend
User Experience
Future Enhancements
- User authentication and server-side preference storage
- Real-time updates via WebSocket
- Scheduled reports across multiple servers
- Advanced filtering (by date range, channel type, etc.)
- Export aggregated data to CSV/JSON
- Shareable dashboard links
- Server comparison analytics (growth rates, engagement metrics, etc.)
- Cross-server user activity tracking (for users in multiple servers)
Related Issues
None yet - this is a foundational feature request
Labels
enhancement, feature, backend, frontend, multi-server, aggregation, high-priority
Estimated Complexity: High
Estimated Effort: Large (3-4 weeks)
Priority: Medium-High
Dependencies: None
Summary
Add support for aggregating Discord statistics across multiple servers with per-user configuration. This will allow the backend to monitor multiple Discord servers simultaneously, while giving end-users the ability to select which servers to include in their personalized analytics views.
User Stories
As a Server Administrator
As an End User
Current Behavior
Currently, the application:
Proposed Behavior
Backend Changes
Multi-Server Configuration
Server Registry
Aggregation Engine
Frontend Changes
User Settings Page
Enhanced Dashboard
Server Management UI (Admin)
Technical Requirements
Backend API Endpoints
Database Schema
Frontend State Management
Implementation Considerations
Phase 1: Backend Multi-Server Support
Phase 2: Frontend Settings & Selection
Phase 3: Aggregated Views
Phase 4: Admin Interface (Optional)
UI/UX Mockup Ideas
Settings Page
Aggregated Dashboard Header
Security Considerations
Performance Considerations
Testing Requirements
Documentation Updates
Acceptance Criteria
Backend
Frontend
User Experience
Future Enhancements
Related Issues
None yet - this is a foundational feature request
Labels
enhancement,feature,backend,frontend,multi-server,aggregation,high-priorityEstimated Complexity: High
Estimated Effort: Large (3-4 weeks)
Priority: Medium-High
Dependencies: None