A comprehensive dashboard for managing Discord Webhooks and automating message delivery. Create and manage multiple webhook configurations, define reusable message templates with variable placeholders, schedule automated messages with flexible scheduling rules, and trigger them via serverless cron jobs.
- Webhook Management: Create, configure, and manage multiple Discord Webhook endpoints
- Message Templates: Define reusable message templates with customizable variable placeholders
- Flexible Scheduling: Set up recurring message schedules with customizable delivery rules
- Automated Delivery: Trigger scheduled messages automatically via serverless cron jobs
- Test Functionality: Verify webhook configurations with test message sends
- Audit Logging: Complete record of all message deliveries with success/failure status and timestamps
- Intuitive Dashboard: Manage all webhooks, templates, and schedules in one place
- Frontend: Next.js 16 (App Router), React 19, TypeScript
- Backend: Next.js API Routes, Server Actions
- Database: SQLite with MikroORM (embedded, no external database required)
- UI Components: shadcn/ui, Radix UI, Tailwind CSS
- Testing: Vitest with Testing Library
- Scheduling: Vercel Cron Jobs, node-cron
- Desktop: Electron (for macOS local application)
discord-webhook-manager/
├── app/ # Next.js App Router pages and API routes
│ ├── api/ # API endpoints for webhooks, templates, schedules
│ ├── webhooks/ # Webhook management pages
│ ├── templates/ # Template management pages
│ └── page.tsx # Dashboard home page
├── components/ # React components
│ ├── layout/ # Layout components
│ ├── webhook/ # Webhook-related components
│ ├── template/ # Template-related components
│ └── ui/ # shadcn/ui components
├── db/ # Database layer
│ ├── entities/ # MikroORM entity definitions
│ └── migrations/ # Database migrations
├── electron/ # Electron desktop application
│ ├── main.js # Electron main process
│ ├── preload.js # Electron preload script for IPC
│ ├── jsconfig.json # JavaScript configuration for Electron
│ └── scripts/ # Build scripts
├── services/ # Business logic services
│ ├── webhookService.ts
│ ├── templateService.ts
│ ├── scheduleService.ts
│ └── messageService.ts
├── contexts/ # React contexts
├── hooks/ # Custom React hooks
├── lib/ # Utility functions
└── types/ # TypeScript type definitions
- Node.js 18+ and pnpm (or npm/yarn)
- Discord Webhook URL (for testing)
Note: No external database installation required. The application uses SQLite, which is embedded and stores data locally in the ./data/ directory.
-
Clone the repository:
git clone https://github.com/yourusername/discord-webhook-manager.git cd discord-webhook-manager -
Install dependencies:
pnpm install
-
Set up environment variables:
cp .env.example .env.local
Edit
.env.localand configure:DATABASE_PATH: SQLite database file path (default:./data/discord-webhook.db)NODE_ENV: Development or production
-
Start the development server:
pnpm dev
Open http://localhost:3003 in your browser to access the dashboard.
pnpm dev- Start development server on port 3003pnpm build- Build for productionpnpm start- Start production serverpnpm test- Run tests in watch modepnpm test:run- Run tests oncepnpm test:coverage- Generate test coverage reportpnpm lint- Run ESLint
pnpm electron:dev- Start Electron development mode (includes Next.js dev server)pnpm electron:build- Build Next.js and package Electron applicationpnpm electron:build:dir- Build Electron app without creating installers (for testing)
- Navigate to the dashboard
- Click "Add Webhook" button
- Enter webhook name and Discord Webhook URL
- Optionally select a message template to apply
- Save the webhook
- Go to the Templates section
- Create a new template with message content
- Use variable placeholders (e.g.,
{variable_name}) for dynamic content - Save the template
- Select a webhook from the dashboard
- Create a new schedule
- Define the schedule rules (frequency, timing)
- Optionally select a message template
- Enable the schedule to start automated delivery
- Select a webhook
- Click "Test Send" button
- Verify the test message appears in Discord
- Check the audit log for delivery status
The project follows Test-Driven Development (TDD) principles. Tests are included for:
- API endpoints
- Service layer business logic
- Template parsing and rendering
- Scheduling logic
- Edge cases and error handling
Run tests with:
pnpm test # Watch mode
pnpm test:run # Single run
pnpm test:coverage # With coverage reportThe application uses SQLite as an embedded database. The database file is automatically created and managed:
- Development:
./data/discord-webhook.db - Test:
./data/test.db - Production (Electron):
~/Library/Application Support/Discord Webhook Manager/discord-webhook.db
Note: Database schema is automatically synchronized on application startup. No manual migration commands are required.
- macOS 10.13 or later
- Node.js 18+
Note: No external database installation required. SQLite is embedded in the application.
Start the Electron application in development mode:
pnpm electron:devThis command:
- Starts the Next.js development server on port 3003
- Launches the Electron application window
- Enables hot reload for code changes
- Activates local Cron Jobs for scheduling
Build the Electron application for macOS:
pnpm electron:buildThis command:
- Builds the Next.js production bundle
- Packages the application with Electron Builder
- Creates both
.dmgand.zipinstallers for both Intel (x64) and Apple Silicon (arm64)
Output files will be in the dist/ directory:
Discord Webhook Manager-x.x.x-arm64.dmg- DMG installer for Apple SiliconDiscord Webhook Manager-x.x.x.dmg- DMG installer for IntelDiscord Webhook Manager-x.x.x-arm64-mac.zip- ZIP archive for Apple SiliconDiscord Webhook Manager-x.x.x-mac.zip- ZIP archive for Intelmac-arm64/- Application bundle directory for Apple Siliconmac/- Application bundle directory for Intel
Test the packaged application without creating installers:
pnpm electron:build:dirThe application will be available in dist/mac-arm64/ or dist/mac/ directory.
- Double-click the
.dmgfile to open the installer - Drag the "Discord Webhook Manager" application to the Applications folder
- Wait for the copy process to complete
- Open Applications folder and double-click "Discord Webhook Manager" to launch
For testing purposes, you can launch directly from the build output:
open ./dist/mac-arm64/Discord\ Webhook\ Manager.appOr for Intel Macs:
open ./dist/mac/Discord\ Webhook\ Manager.appOnce installed in the Applications folder:
- Open Finder and navigate to Applications
- Find Discord Webhook Manager
- Double-click to launch
Or use the command line:
open /Applications/Discord\ Webhook\ Manager.appNote: The first launch may take 5-10 seconds as the Next.js server initializes.
The application uses SQLite with automatic database management. Environment variables are optional.
Place .env.local in the project root directory (optional):
DATABASE_PATH=./data/discord-webhook.db
CRON_SCHEDULE=* * * * *
CRON_SECRET=development-secretThe application automatically stores data in:
~/Library/Application Support/Discord Webhook Manager/discord-webhook.db
Optionally, create .env.local for custom configuration:
mkdir -p ~/Library/Application\ Support/Discord\ Webhook\ Manager
cat > ~/Library/Application\ Support/Discord\ Webhook\ Manager/.env.local << EOF
CRON_SCHEDULE=* * * * *
CRON_SECRET=your-secret-here
EOFEnvironment Variables:
DATABASE_PATH: SQLite database file path (optional, auto-configured)CRON_SCHEDULE: Cron expression for scheduling (default:* * * * *- every minute)CRON_SECRET: Secret token for cron endpoints (default:development-secret)
The easiest way to deploy the web version is using Vercel:
- Push your code to GitHub
- Import the repository in Vercel
- Configure environment variables in Vercel dashboard
- Deploy
For detailed instructions, see Vercel Deployment Documentation.
Ensure these variables are set in your production environment:
DATABASE_PATH: SQLite database file path (optional, defaults to./data/discord-webhook.db)NODE_ENV: Set to "production"
Note: For web deployment, SQLite works well for single-instance deployments. For multi-instance or serverless deployments, consider using a cloud database service.
Cause: Application initialization error or permission issue
Solution:
-
Check if the data directory is writable:
ls -la ~/Library/Application\ Support/Discord\ Webhook\ Manager/
-
Try launching from terminal to see error messages:
./dist/mac-arm64/Discord\ Webhook\ Manager.app/Contents/MacOS/Discord\ Webhook\ Manager
-
Verify the application bundle is complete:
ls -la /Applications/Discord\ Webhook\ Manager.app/Contents/
-
Check for quarantine attribute (macOS security):
xattr -d com.apple.quarantine /Applications/Discord\ Webhook\ Manager.app
-
Ensure sufficient disk space for the database
- Check
.env.localforCRON_SCHEDULEvariable - Verify the cron expression is valid
- Check application logs for errors
To see detailed error messages, launch the application from the terminal:
open -a "Discord Webhook Manager" --args --verboseOr directly run the executable:
./dist/mac-arm64/Discord\ Webhook\ Manager.app/Contents/MacOS/Discord\ Webhook\ ManagerFor more detailed troubleshooting, see ELECTRON_TESTING.md.
Contributions are welcome! Please ensure:
- All tests pass:
pnpm test:run - Code is properly linted:
pnpm lint - New features include tests
- Commit messages are clear and descriptive
This project is open source and available under the MIT License.