4.5 KiB
4.5 KiB
ECS Full Stack
A full-stack Discord bot management dashboard with React frontend, Express backend, and Discord.js bot integration. Server admins can manage bot settings, invites, moderation, and live notifications through a modern web interface.
Features
- Dashboard: View Discord servers and manage per-server settings
- Invite Management: Create, list, and revoke server invites with custom options
- Moderation: Direct ban/kick/timeout actions from web interface with user autocomplete
- Live Notifications: Twitch stream notifications with rich embeds
- Admin Logs: Complete moderation action logging with real-time updates
- Theme Support: Light, dark, and Discord-themed UI options
Quick Start
Prerequisites
- Node.js 18+
- PostgreSQL database
- Discord application with bot user
Setup
-
Clone and install dependencies:
git clone <repository-url> cd ECS-FullStack npm install # Run in both frontend/ and backend/ directories -
Configure Discord App:
- Go to Discord Developer Portal
- Create new application and bot user
- Copy Client ID, Client Secret, and Bot Token
-
Database Setup:
CREATE DATABASE ecs_fullstack; CREATE USER ecs_user WITH PASSWORD 'your_password'; GRANT ALL PRIVILEGES ON DATABASE ecs_fullstack TO ecs_user; -
Environment Configuration:
backend/.env:
DATABASE_URL=postgres://ecs_user:password@localhost:5432/ecs_fullstack DISCORD_CLIENT_ID=your_client_id DISCORD_CLIENT_SECRET=your_client_secret DISCORD_BOT_TOKEN=your_bot_token ENCRYPTION_KEY=your_32_byte_secret BACKEND_BASE=http://localhost:3002 FRONTEND_BASE=http://localhost:3001frontend/.env:
REACT_APP_API_BASE=http://localhost:3002 -
Start the application:
# Backend (includes Discord bot) cd backend && npm start # Frontend (separate terminal) cd frontend && npm start -
Invite Bot to Server:
- Use OAuth2 URL Generator in Discord Developer Portal
- Select
botandapplications.commandsscopes - Choose appropriate permissions
- Visit generated URL to invite bot
Project Structure
ECS-FullStack/
├── frontend/ # React dashboard
├── backend/ # Express API + Discord bot
├── discord-bot/ # Bot wrapper
├── checklist.md # Feature tracking
└── README.md
API Endpoints
Server Management
GET /api/servers/:guildId- Server info and settingsGET /api/servers/:guildId/members- Server member listGET /api/servers/:guildId/channels- Text channelsGET /api/servers/:guildId/roles- Server roles
Invites
GET /api/servers/:guildId/invites- List invitesPOST /api/servers/:guildId/invites- Create inviteDELETE /api/servers/:guildId/invites/:code- Delete invite
Moderation
POST /api/servers/:guildId/moderate- Ban/kick/timeout usersGET /api/servers/:guildId/admin-logs- View moderation logs
Live Notifications
GET/POST /api/servers/:guildId/live-notifications- SettingsGET/POST /api/servers/:guildId/twitch-users- Watched users
Environment Variables
Required
DATABASE_URL- PostgreSQL connection stringDISCORD_CLIENT_ID- Discord app client IDDISCORD_CLIENT_SECRET- Discord app client secretDISCORD_BOT_TOKEN- Bot token
Optional
TWITCH_CLIENT_ID- Twitch app client IDTWITCH_CLIENT_SECRET- Twitch app client secretBOT_PUSH_URL- For separate bot/backend deploymentCORS_ORIGIN- Restrict API access
Development
Running Tests
cd frontend && npm test
cd backend && npm test
Building for Production
cd frontend && npm run build
cd backend && npm run build # If applicable
Troubleshooting
Common Issues
- Database connection failed: Verify
DATABASE_URLformat and credentials - CORS errors: Check
CORS_ORIGINmatches your frontend URL - Bot not responding: Ensure bot has proper permissions in server
- Invite deletion fails: Check
ENCRYPTION_KEYis set
Logs
- Backend logs Discord bot status and API requests
- Frontend console shows API calls and errors
- Check browser Network tab for failed requests
Contributing
- Fork the repository
- Create feature branch
- Make changes with tests
- Submit pull request
License
MIT License - see LICENSE file for details.
Updated: October 9, 2025