2025-10-10 05:12:54 -04:00
2025-10-10 05:12:54 -04:00
2025-10-10 05:12:54 -04:00
2025-10-10 05:12:54 -04:00
2025-10-02 17:31:49 -04:00
2025-10-10 05:12:54 -04:00
2025-10-09 06:13:48 -04:00

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

  1. Clone and install dependencies:

    git clone <repository-url>
    cd ECS-FullStack
    npm install  # Run in both frontend/ and backend/ directories
    
  2. Configure Discord App:

  3. Database Setup:

    CREATE DATABASE ecs_fullstack;
    CREATE USER ecs_user WITH PASSWORD 'your_password';
    GRANT ALL PRIVILEGES ON DATABASE ecs_fullstack TO ecs_user;
    
  4. 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:3001
    

    frontend/.env:

    REACT_APP_API_BASE=http://localhost:3002
    
  5. Start the application:

    # Backend (includes Discord bot)
    cd backend && npm start
    
    # Frontend (separate terminal)
    cd frontend && npm start
    
  6. Invite Bot to Server:

    • Use OAuth2 URL Generator in Discord Developer Portal
    • Select bot and applications.commands scopes
    • 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 settings
  • GET /api/servers/:guildId/members - Server member list
  • GET /api/servers/:guildId/channels - Text channels
  • GET /api/servers/:guildId/roles - Server roles

Invites

  • GET /api/servers/:guildId/invites - List invites
  • POST /api/servers/:guildId/invites - Create invite
  • DELETE /api/servers/:guildId/invites/:code - Delete invite

Moderation

  • POST /api/servers/:guildId/moderate - Ban/kick/timeout users
  • GET /api/servers/:guildId/admin-logs - View moderation logs

Live Notifications

  • GET/POST /api/servers/:guildId/live-notifications - Settings
  • GET/POST /api/servers/:guildId/twitch-users - Watched users

Environment Variables

Required

  • DATABASE_URL - PostgreSQL connection string
  • DISCORD_CLIENT_ID - Discord app client ID
  • DISCORD_CLIENT_SECRET - Discord app client secret
  • DISCORD_BOT_TOKEN - Bot token

Optional

  • TWITCH_CLIENT_ID - Twitch app client ID
  • TWITCH_CLIENT_SECRET - Twitch app client secret
  • BOT_PUSH_URL - For separate bot/backend deployment
  • CORS_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_URL format and credentials
  • CORS errors: Check CORS_ORIGIN matches your frontend URL
  • Bot not responding: Ensure bot has proper permissions in server
  • Invite deletion fails: Check ENCRYPTION_KEY is 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

  1. Fork the repository
  2. Create feature branch
  3. Make changes with tests
  4. Submit pull request

License

MIT License - see LICENSE file for details.


Updated: October 9, 2025

Description
ECS Full Stack application. This is an all-in-one Discord bot, admin panel, and backend.
https://www.ehchadservices.com
Readme 999 KiB
Languages
JavaScript 98.9%
HTML 0.6%
CSS 0.5%