A comprehensive Discord bot dashboard for managing Whiteout Survival alliance activities
Built by RevCodes
- Member Tracking: Comprehensive member list with role-based permissions
- Activity Monitoring: Track member participation and engagement
- Alliance Statistics: View alliance performance metrics and progress
- Interactive Calendar: Full-featured calendar for alliance events
- Event Management: Create, edit, and manage alliance activities
- Automated Reminders: Discord notifications for upcoming events
- Event History: Track past events and participation
- Active Giveaways: Manage ongoing contests and rewards
- Automated Entries: Handle participant registration
- Winner Selection: Fair and transparent winner selection
- Giveaway History: Complete audit trail of all giveaways
- Real-time Chat: Integrated chat system with Discord sync
- Announcements: Broadcast important alliance news
- Forum Integration: Discussion threads for alliance topics
- Notification System: Comprehensive notification management
- User Management: Admin tools for member oversight
- Moderation Tools: Content and behavior management
- Analytics: Detailed insights into alliance activity
- Task Management: Assign and track alliance tasks
- Discord OAuth: Secure authentication via Discord
- Role-based Access: Granular permission system
- Rate Limiting: Protection against abuse
- Data Validation: Comprehensive input sanitization
- Node.js 18.0 or higher
- MongoDB database (local or MongoDB Atlas)
- Discord application for OAuth
-
Clone the repository
git clone https://github.com/revcodes/bbgwebsite.git cd bbgwebsite -
Install dependencies
npm install
-
Configure environment variables
cp .env.example .env.local
Edit
.env.localwith your configuration:# Database MONGODB_URI=mongodb://localhost:27017/bbg-alliance # NextAuth NEXTAUTH_SECRET=your-super-secret-key-here NEXTAUTH_URL=http://localhost:3000 # Discord OAuth DISCORD_CLIENT_ID=your_discord_application_client_id DISCORD_CLIENT_SECRET=your_discord_application_secret # Discord Bot BOT_TOKEN=your_discord_bot_token GUILD_ID=your_discord_server_guild_id ANNOUNCEMENTS_CHANNEL_ID=your_announcements_channel_id # Public Variables NEXT_PUBLIC_GUILD_ID=your_discord_server_guild_id
-
Set up Discord Application
- Create a Discord application at Discord Developer Portal
- Configure OAuth2 redirect URI:
http://localhost:3000/api/auth/callback/discord - Create a bot and get the bot token
- Invite the bot to your Discord server with appropriate permissions
-
Start the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
npm test # Run tests once
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coveragenpm run test:e2e # Run E2E tests
npm run test:e2e:ui # Run E2E tests with UI# Build the image
docker build -t bbg-alliance-dashboard .
# Run the container
docker run -p 3000:3000 --env-file .env.local bbg-alliance-dashboardversion: '3.8'
services:
app:
build: .
ports:
- "3000:3000"
env_file:
- .env.local
depends_on:
- mongodb
mongodb:
image: mongo:4.4
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
volumes:
mongodb_data:bbgwebsite/
βββ app/ # Next.js 13+ App Router
β βββ api/ # API routes
β βββ components/ # React components
β βββ admin/ # Admin dashboard
β βββ alliance/ # Alliance management
β βββ chat/ # Chat interface
β βββ dashboard/ # Main dashboard
β βββ forum/ # Forum functionality
β βββ giveaways/ # Giveaway system
β βββ profile/ # User profiles
βββ lib/ # Utilities and configurations
β βββ models/ # MongoDB models
β βββ mongodb.js # Database connection
β βββ security.js # Security utilities
β βββ validation.js # Input validation
βββ public/ # Static assets
βββ __tests__/ # Test files
βββ e2e/ # End-to-end tests
βββ utils/ # Helper functions
- Frontend: Next.js 15, React 19, Bootstrap 5
- Backend: Node.js, Express.js, Socket.io
- Database: MongoDB with Mongoose
- Authentication: NextAuth.js with Discord OAuth
- Testing: Jest, Playwright
- Styling: CSS Modules, Bootstrap, Custom CSS
- Deployment: Docker, Vercel-ready
| Variable | Description | Required |
|---|---|---|
MONGODB_URI |
MongoDB connection string | β |
NEXTAUTH_SECRET |
NextAuth.js secret key | β |
NEXTAUTH_URL |
Application URL | β |
DISCORD_CLIENT_ID |
Discord OAuth client ID | β |
DISCORD_CLIENT_SECRET |
Discord OAuth client secret | β |
BOT_TOKEN |
Discord bot token | β |
GUILD_ID |
Discord server ID | β |
ANNOUNCEMENTS_CHANNEL_ID |
Discord announcements channel | β |
ADMIN_ROLE_NAMES |
Admin role names (comma-separated) | β |
RATE_LIMIT_REQUESTS |
Rate limit requests per window | β |
RATE_LIMIT_WINDOW |
Rate limit window in milliseconds | β |
The bot requires the following Discord permissions:
Send MessagesRead Message HistoryManage MessagesEmbed LinksAttach FilesRead Messages/View ChannelsUse Slash Commands
| Script | Description |
|---|---|
npm run dev |
Start development server with custom server |
npm run dev:next |
Start Next.js development server only |
npm run build |
Build for production |
npm start |
Start production server |
npm test |
Run unit tests |
npm run test:e2e |
Run end-to-end tests |
This project uses:
- ESLint for code linting
- Prettier for code formatting
- Jest for unit testing
- Playwright for E2E testing
We welcome contributions! Please see CONTRIBUTING.md for details on:
- Development setup
- Code style guidelines
- Pull request process
- Issue reporting
For security concerns, please review SECURITY.md. This project implements:
- Input validation and sanitization
- Rate limiting
- CSRF protection
- Secure authentication
- Environment variable protection
This project is licensed under the MIT License - see the LICENSE file for details.
- Whiteout Survival community for inspiration
- Discord.js for excellent Discord API integration
- Next.js team for the amazing framework
- Vercel for deployment platform
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Author: RevCodes
Made with β€οΈ by RevCodes
Empowering alliance management through technology
Empowering alliance management through technology