# Dashboard Setup Guide


# 1. 📦 Extracting the Dashboard Files

When you purchased the dashboard add-on (or if it came in a separate bundle), you likely received a .zip file (for example, Razor Bot Dashboard Nebula v2.zip).

  1. Locate the ZIP file containing the dashboard.
  2. Extract/Unzip the contents of the archive. Inside, you will find a folder named Dashboard.
  3. Copy the entire Dashboard folder.

# 2. 📂 Merging with the Source Code

You must insert the Dashboard folder directly into your main bot environment.

  1. Open the folder where your Razor Source Code is located (the folder containing index.js, package.json, and config.js).
  2. Paste the Dashboard folder directly into this root directory.

Your directory structure should now look exactly like this:

Razor Source Code/
├── Commands/
├── Dashboard/      <-- Paste it exactly here!
├── Events/
├── config.js
├── index.js
└── package.json

# 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:

  // Dashboard Configuration //
  dashboard: {
    enabled: true,           // Set this to true to turn on the dashboard
    port: 5500,              // The port the web server will run on (default is 5500)
    domain: "http://localhost:5500", // The public URL of your dashboard
    sessionSecret: "razor-super-secret-key-change-this", // Change this to a random secure string!
  },

# 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.

  1. Select your Razor Bot application.
  2. On the left sidebar, click OAuth2 -> General.
  3. Scroll down to the Redirects section.
  4. Click Add Redirect and enter your domain followed by /auth/callback.
    • Example (Local): http://localhost:5500/auth/callback
    • Example (Live Domain): https://dashboard.yourdomain.com/auth/callback
  5. Click Save Changes.

# 5. 🚀 Launch the Dashboard

You're done! Now, simply run the bot as usual in your terminal:

npm start

Watch your console logs. You should see a success message indicating that the Razor Dashboard is locked, loaded, and running successfully on your specified port!