👥 User Management
Add New User
Current Users
🔑 Change Password
Changing password for:
📡 Mode: Checking…   |   Last refreshed:
⏳ Checking live database connection…
📊 Server Overview

Real-time economy snapshot for SunRise RedM 1.0

Total Players
from database
👥
Online Now
checking…
🟢
Cash in Circulation
across all players
💵
Total Bank Assets
all banks combined
🏦
Blood Money
illicit funds tracked
🩸
Total Kills
all time
💀
Horses Registered
0
named & tracked
🐴
Richest Player
👑
🏆 Top 10 Wealthiest Players
Wealth Leaderboard
#PlayerCashBankBlood MoneyTotalStatus
🩸 Blood Money Overview
Top Blood Money Holders
#PlayerBlood MoneyKillsOutlawStatus
👤 Player Information

Click any player name to view their complete profile. All columns from the player table.

All Players
🔍
IDCitizenIDSteam Name CharacterJobGang CashBank Total Blood MoneyOutlaw KillsHorses WeightLast Updated
🏦 Bank Overview

Total assets held in each bank across all players

Grand Total — All Banks
Combined server economy
$0

📈 Per-Player Bank Breakdown
Bank Distribution
🔍
PlayerMain BankValentineBlackwaterRhodesArmadilloBlood MoneyTotal
🐴 Horse Registry

All registered horses from the horses table. Click owner name to view player profile.

Total Horses
0
🐴
Alive
0
Dead
0
💀
Stabled
0
🏠
Horse Registry
🔍
IDCIDNameModel OwnerGenderAgeXP StableBornSelected
💼 Management Funds

Job fund balances from the managements_funs table

Funds by Job
Total:
JobTotal AmountEntriesTypes
Loading…
📋 All Entries
Raw Fund Entries
🔍
IDJob NameAmountType
🏠 Houses

All registered properties from rex_houses. Click owner to view player profile.

Total Houses
0
🏠
Total Value
💰
Total Credit Owed
💳
Property Registry
🔍
House IDCitizenIDCharacterFull NameOwnerPriceCreditAgent
💀 Kill Statistics

Click a player name to view their full profile.

Total Kills
0
💀
Top Killer
🎯
Server Avg K/D
⚖️
Most Deaths
☠️
Kill Leaderboard
🔍
#PlayerKillsDeathsK/DBlood MoneyOutlawStatus
⚙️ Setup & Hosting Guide

How to install, configure and host this dashboard for SunRise RedM 1.0

🔌 Live Database Connection
Checking connection…
Contacting /api — credentials are set server-side via .env
API path locked to: /api — credentials managed by .env on the server
📋 Step-by-Step Hosting Guide
1
Folder Structure
Your project should look like this — the dashboard HTML lives in public/ so express.static serves it on the same port as the API:
sunrise-dashboard/

├── server.js          # Node.js API

├── .env               # DB credentials (never commit this)

├── package.json

└── public/

    └── index.html     # Rename sunrise-dashboard.html to index.html
Then visit http://your-server:3000 — the dashboard loads and /api auto-resolves. No URL config needed.
2
Requirements
You need Node.js 18+, MySQL/MariaDB (same DB your RedM server uses), and a web server or VPS. No changes to your RedM server are needed — the dashboard is read-only.
3
Install Dependencies
# Create project folder

mkdir sunrise-dashboard && cd sunrise-dashboard

npm init -y

npm install express mysql2 cors dotenv
3
Create server.js
// server.js — place in your project root next to .env

const express = require('express');

const mysql   = require('mysql2/promise');

const cors    = require('cors');

const path    = require('path');

require('dotenv').config();



const app = express();

app.use(cors());



// Serve the dashboard HTML from the same server

app.use(express.static(path.join(__dirname, 'public')));



// DB pool — credentials come ONLY from .env, never from the browser

const db = mysql.createPool({

  host:     process.env.DB_HOST,

  user:     process.env.DB_USER,

  password: process.env.DB_PASS,

  database: process.env.DB_NAME,

  waitForConnections: true,

  connectionLimit: 10

});



// /api/players — all columns from the player table

app.get('/api/players', async (req, res) => {

  try {

    const [rows] = await db.execute(`

      SELECT id, citizenid, cid, license, name, outlawstatus,

             money, charinfo, job, gang, position, metadata,

             inventory, weight, slots, last_updated,

             kills, deaths

      FROM player ORDER BY id ASC`);

    // Parse JSON columns

    rows.forEach(r => {

      ['money','charinfo','job','gang','position','metadata','inventory']

        .forEach(k => { try { r[k] = JSON.parse(r[k]); } catch(e) { r[k] = {}; } });

    });

    res.json(rows);

  } catch(e) {

    console.error(e);

    res.status(500).json({ error: e.message });

  }

});



// /api/horses — all columns from the horses table

app.get('/api/horses', async (req, res) => {

  try {

    const [rows] = await db.execute(`

      SELECT h.id, h.cid, h.selected, h.model, h.name,

             h.components, h.xp, h.age, h.gender, h.stable,

             h.born_date, h.last_age_update, h.dead,

             p.name AS owner_name, p.citizenid

      FROM horses h

      LEFT JOIN player p ON h.cid = p.cid

      ORDER BY h.id ASC`);

    rows.forEach(r => {

      try { r.components = JSON.parse(r.components); } catch(e) { r.components = {}; }

    });

    res.json(rows);

  } catch(e) {

    res.status(500).json({ error: e.message });

  }

});



// /api/banks — server-side aggregation totals

app.get('/api/banks', async (req, res) => {

  try {

    const [rows] = await db.execute(`

      SELECT

        SUM(JSON_EXTRACT(money, '$.bank'))        AS bank,

        SUM(JSON_EXTRACT(money, '$.valbank'))      AS valbank,

        SUM(JSON_EXTRACT(money, '$.blkbank'))      AS blkbank,

        SUM(JSON_EXTRACT(money, '$.rhobank'))      AS rhobank,

        SUM(JSON_EXTRACT(money, '$.armbank'))      AS armbank,

        SUM(JSON_EXTRACT(money, '$.bloodmoney'))   AS bloodmoney,

        SUM(JSON_EXTRACT(money, '$.cash'))         AS cash

      FROM player`);

    res.json(rows[0]);

  } catch(e) {

    res.status(500).json({ error: e.message });

  }

});



app.listen(3000, () => console.log('🌅 SunRise Dashboard API running on http://localhost:3000'));
4
.env File
DB_HOST=localhost

DB_USER=your_db_user

DB_PASS=your_db_password

DB_NAME=your_redm_database
5
Start with PM2 (recommended)
npm install -g pm2

pm2 start server.js --name sunrise-api

pm2 save && pm2 startup
6
Serve the Dashboard
Place sunrise-dashboard.html inside a public/ folder in the same directory as server.js. The server already serves static files from that folder via express.static, so visiting http://your-vps-ip:3000 will load the dashboard and /api will resolve automatically — no URL config needed. Alternatively, put it behind Nginx as a reverse proxy on port 80/443.
7
Optional: Password Protection
npm install express-basic-auth

# In server.js before routes:

const auth = require('express-basic-auth');

app.use(auth({ users:{'admin':'your_password'}, challenge:true }));