The Razor Web Dashboard is a powerful plugin that provides a stunning, full-stack graphical interface to manage your bot and Discord server. Follow these precise steps to properly install and configure it with your source code.
1. π Codebase Integration
In Razor v2.0.8 Beta, the Web Dashboard is now natively integrated directly into the core source directory under theDashboard/ folder out-of-the-box. There is no need to manually copy or extract external zip folders unless you are updating or using a customized theme.
Your project directory structure looks like this:
2. π Session & Payment Configs (.env)
The Web Dashboard uses Express sessions backed by MongoDB (sharing your core botβsMONGODB_URL connection string) and requires the Discord Client Secret for secure OAuth2 logins.
Ensure the following variables are defined in your root .env file:
Stripe Subscription Integration (Optional)
If you want to offer automated premium plans and subscription checkouts via your dashboard, follow the steps below to configure Stripe.Retrieve your Stripe API Keys
- Sign in to your Stripe Dashboard.
- To test payments without real money, toggle Test Mode (located in the top-right corner of the dashboard).
- Navigate to Developers β‘οΈ API Keys.
- Copy your Secret Key (starts with
sk_test_for testing, orsk_live_for production). - In your project, locate the file
Dashboard/.env.example, rename it toDashboard/.env, and add your secret key:
Set Up Local Webhook Testing
To process payments and automatically provision premium status to servers/users, the Stripe billing system needs to communicate back with your application via webhooks.
- Download and install the Stripe CLI for your operating system.
- Open your terminal and log in to your Stripe account:
- Run the following command to forward webhook events to your local dashboard server:
- Copy the webhook signing secret from the console output (starts with
whsec_...). - Add it to your
Dashboard/.envfile:
Transition to Production
Once youβre ready to accept live payments:
- Toggle off Test Mode in your Stripe Dashboard.
- Copy your live Secret Key (
sk_live_...) and place it in your productionDashboard/.env. - Go to Developers β‘οΈ Webhooks in the Stripe Dashboard and click Add Endpoint.
- Set the Endpoint URL to your public production URL:
- Click Select events and choose
checkout.session.completed(and any other events your app listens to, such as subscription events). - Click Add Endpoint to save.
- Copy the new live signing secret (
whsec_...) generated for this production webhook endpoint and update your productionDashboard/.env:
3. βοΈ Configuring config.js
Now that the files are in place, you must tell the bot how to run the web server.
Open your config.js file and locate the Dashboard Configuration section. Update the variables as shown below:
4. π Setting Up the Discord OAuth2 Callback
To allow users to log in to your dashboard securely via Discord, you absolutely must whitelist your callback URL in the Discord Developer Portal.- Select your Razor Bot application.
- On the left sidebar, click OAuth2 -> General.
- Scroll down to the Redirects section.
- Click Add Redirect and enter your domain followed by
/callback.- Example (Local):
http://localhost:5500/callback - Example (Live Domain):
https://dashboard.yourdomain.com/callback
- Example (Local):
- Click Save Changes.
5. π Launch the Dashboard
Youβre done! Now, simply run the bot as usual in your terminal:6. π‘οΈ Developer Admin Panel
Razor v2.0.8 Beta ships with an advanced Admin Dashboard restricted solely to the developer. It is accessed by visiting the/admin path of your dashboard (e.g., http://localhost:5500/admin).
Available Admin Sections:
- Overview Panel (
/admin/overview) β Displays live metrics about the botβs health, including heap memory usage, system latency, connected guilds/channels count, client websocket ping, and bot process uptime. - User Management (
/admin/users) β Search, inspect, and manage Discord users. Allows developers to completely purge user metadata (warnings, leveling XP, balance cache, AFK, and blacklists) with a single click. - Server Overview (
/admin/servers) β View active guilds where the bot is joined, inspect member counts, owner details, generate instant invite links, or force the bot to leave specific servers remotely. - Blacklists Control (
/admin/blacklists) β Manage global blacklists. You can blacklist individual users or whole guilds with custom reasons. Blacklisted guilds are automatically left by the bot. - Global Broadcasts (
/admin/broadcast) β Broadcast critical announcements or alerts. Targets include DMing all server owners, posting to system channels, or finding the first chat channel. - Premium & Plan Management (
/admin/premium//admin/premium-plans) β Create premium subscriptions dynamically, specify validity duration, and grant/revoke user/guild premium status. - Dynamic Command & Feature Locks (
/admin/premium-commands//admin/premium-features) β Enforce premium subscription limits on specific Discord commands or dashboard page access. - Maintenance Toggle (
/admin/maintenance) β Enable a site-wide maintenance screen dynamically to block guild users from modifying dashboard settings during database migration or system updates.
