Skip to content

samueljrodriguez/DCS-Statistics-Dashboard

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

169 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽ–๏ธ DCS Statistics Dashboard

Transform your DCS server data into a stunning, interactive web dashboard with real-time API integration!

Live Analytics DCSServerBot Security Responsive

๐ŸŽฏ What's New in v1.0.0

๐Ÿš€ Advanced Admin Panel

  • ๐ŸŽ›๏ธ Role-Based Access Control - Multi-tier permission system (Air Boss, Squadron Leader, Pilot)
  • ๐Ÿ” Secure Authentication - Modern login system with session management
  • ๐Ÿ”„ Auto-Update System - One-click updates from GitHub with version tracking
  • ๐Ÿ’พ Backup & Restore - Automatic backups before updates with version metadata
  • ๐ŸŽจ Theme Manager - Pre-built themes (Sky Pirates, Grim Reapers, Blue Angels, more!)

โœจ Modern Professional Interface

  • ๐Ÿ–ผ๏ธ Cinematic Header - Epic DCS combat scene background with professional overlay
  • ๐ŸŽจ Unified Design System - Consistent cards, buttons, and styling across all pages
  • ๐Ÿ“ฑ Dynamic Responsive Layout - Adapts fluidly to any screen size (98% mobile width to 1400px desktop)
  • ๐Ÿ” Unified Search Experience - Consistent search bars with advanced functionality

๐Ÿ›ก๏ธ Advanced Features

  • ๐Ÿ“Š Feature Management - Granular control over every dashboard element
  • ๐ŸŒ Enhanced API Client - Bulletproof error handling and retry logic
  • ๐Ÿณ Zero-Config Docker - Complete containerized deployment with auto-setup
  • ๐Ÿ“ˆ Performance Monitoring - Built-in API health checks and status indicators

๐Ÿ“ธ Modern Dashboard Preview

Experience a professional-grade statistics platform featuring:

  • ๐Ÿ† Top 10 Leaderboards with trophy displays and combat rankings
  • ๐Ÿ’ฐ Credits System with unified pilot card interface
  • ๐Ÿ‘จโ€โœˆ๏ธ Individual Pilot Profiles with dynamic statistics and combat charts
  • ๐Ÿ›ก๏ธ Squadron Management with member tracking (optional)
  • ๐Ÿ–ฅ๏ธ Live Server Status with mission info and mod displays
  • ๐ŸŽฏ Unified Search - Find pilots instantly across all pages

โšก Quick Start

๐Ÿ”ง Prerequisites

  • โœ… DCSServerBot by Special K with REST API enabled
  • โœ… PHP 8.3+ web server OR Docker
  • โœ… Web hosting (shared hosting works Requires Port Forwarding Not All Hosts allow)

๐Ÿš€ Installation Options

Option 1: Traditional Web Hosting

  1. Download the latest release and extract
  2. Upload the dcs-stats/ folder to your web server
  3. Access https://yourdomain.com/dcs-stats/
  4. Follow the setup wizard to create your admin account
  5. Configure your DCSServerBot API endpoint

Option 2: Docker Deployment (Zero Configuration!)

# Clone the repository
git clone https://github.com/Penfold-88/DCS-Statistics-Dashboard.git
cd DCS-Statistics-Dashboard

# Start with Docker (that's it!)
docker compose up -d

# Access at http://localhost:8080

The Docker setup automatically:

  • โœ… Creates all required directories
  • โœ… Sets proper permissions
  • โœ… Initializes the database
  • โœ… Configures the web server
  • โœ… No manual configuration needed!

โš™๏ธ First-Time Setup

  1. Access your dashboard at http://yourdomain.com/dcs-stats/
  2. Click "Start Setup" on the welcome screen
  3. Create your admin account (you'll be the Air Boss!)
  4. Configure DCSServerBot API:
    • Enter your API URL (e.g., http://localhost:8080)
    • Test the connection
    • Save configuration
  5. Customize your dashboard:
    • Choose a theme
    • Enable/disable features
    • Set your Discord link

๐ŸŽ‰ That's it! Your dashboard now displays real-time data from DCSServerBot.

Option 3: Xampp (Minimal Configuration!)

A Full Howto on this can be found in the wiki https://github.com/Penfold-88/DCS-Statistics-Dashboard/wiki

๐ŸŽ›๏ธ Admin Panel Features

๐Ÿ” Secure Access

Access the admin panel at /dcs-stats/site-config/ (NOT /admin!)

๐Ÿ‘ฅ Role-Based Permissions

Role Dashboard Access API Config Updates User Management Themes
Air Boss โœ… Full โœ… โœ… โœ… โœ…
Squadron Leader โœ… View โŒ โŒ โœ… Limited โœ…
Pilot โœ… View Only โŒ โŒ โŒ โŒ

๐Ÿš€ Auto-Update System

  1. Version Tracking - Know exactly what version you're running
  2. Update Notifications - Get alerts when updates are available
  3. One-Click Updates - Update directly from the admin panel
  4. Automatic Backups - Creates backup before every update
  5. Version History - Track all updates and changes
  6. Branch Support - Switch between stable and development branches

๐Ÿ’พ Backup Management

  • Automatic Backups - Before updates and on schedule
  • Manual Backups - Create snapshots anytime
  • Version Metadata - Each backup includes version and branch info
  • Easy Restore - One-click restore to any backup
  • Auto-Cleanup - Keeps only the 5 most recent backups
  • Download Backups - Export for external storage

๐ŸŽจ Theme System

Pre-built professional themes included:

  • ๐Ÿดโ€โ˜ ๏ธ Sky Pirates - Dark theme with green accents
  • ๐Ÿ’€ Grim Reapers - High contrast red theme
  • ๐Ÿ”ต Blue Angels - Navy blue professional theme
  • ๐ŸŒŠ Navy - Classic military styling
  • ๐ŸŽ–๏ธ Air Force - Light blue aviation theme
  • ๐Ÿ”ฅ Danger Zone - Bold orange accents
  • ๐ŸŒ™ Night Ops - Ultra-dark stealth mode
  • โ„๏ธ Arctic - Cool blue winter theme

๐Ÿณ Docker Deployment

Zero-Configuration Setup

Our Docker setup is completely automated - just run and go!

# Clone the repository
git clone https://github.com/Penfold-88/DCS-Statistics-Dashboard.git
cd DCS-Statistics-Dashboard

# Start the container (that's it!)
docker compose up -d

# Access at http://localhost:8080

What Docker Does Automatically

โœ… Directory Creation - All folders created with correct permissions
โœ… File Permissions - Automatically set for web server access
โœ… Database Init - User database created if not exists
โœ… Config Templates - Default configs generated
โœ… Health Checks - Monitors container status
โœ… Auto-Restart - Recovers from crashes
โœ… Volume Persistence - Data survives container updates

Docker Commands

# View logs
docker compose logs -f

# Stop the container
docker compose down

# Update to latest version
docker compose pull
docker compose up -d

# Access container shell
docker compose exec dcs-stats-web bash

Custom Ports

Edit .env file:

# Change from default 8080
WEB_PORT=8090

๐Ÿ”’ Security Features

Multi-Layer Protection

โœ… Authentication System - Secure login with bcrypt password hashing
โœ… Session Management - Secure session handling with CSRF tokens
โœ… Role-Based Access - Granular permissions for every feature
โœ… XSS Prevention - All inputs sanitized and escaped
โœ… Rate Limiting - API abuse prevention with throttling
โœ… Security Headers - CSP, XSS protection, clickjacking prevention
โœ… Input Validation - Comprehensive data filtering
โœ… Secure File Access - Protected directories and files

Admin Security

  • Password strength requirements
  • Failed login tracking
  • Session timeout
  • Activity logging
  • IP-based restrictions (optional)

๐ŸŽฏ Feature Management

Granular Control System

Control exactly what your community sees:

// Homepage Features
'home_server_stats' => true,      // Server statistics cards
'home_top_pilots' => true,        // Top 5 pilots chart
'home_mission_stats' => true,     // Combat statistics
'home_player_activity' => true,   // Activity overview

// Combat Statistics
'pilot_combat_stats' => true,     // Kills, deaths, K/D ratio
'pilot_flight_stats' => true,     // Takeoffs, landings, crashes
'pilot_session_stats' => true,    // Last session data
'pilot_aircraft_chart' => true,   // Aircraft usage charts

// Credits System  
'credits_enabled' => true,        // Enable credits system
'credits_leaderboard' => true,    // Credits rankings

// Squadron Features
'squadrons_enabled' => true,      // Squadron system
'squadron_management' => true,    // Squadron admin tools
'squadron_statistics' => true,    // Squadron stats

๐Ÿ”ง Troubleshooting Guide

๐Ÿ” Admin Panel Access

  • The admin panel is at /dcs-stats/site-config/ (NOT /admin)
  • First user to register becomes the Air Boss
  • Default permissions are set during first setup

๐Ÿ“Š API Connection Issues

# Test API directly
curl http://localhost:8080/ping

# Check admin panel
Dashboard โ†’ API Configuration โ†’ Test Connection

# For Docker users
Use http://host.docker.internal:8080 on Windows/Mac
Use http://172.17.0.1:8080 on Linux

๐ŸŽจ Theme Not Applying

  1. Clear browser cache (Ctrl+F5)
  2. Check theme selection saved in admin panel
  3. Verify CSS file permissions
  4. Check browser console for errors

๐Ÿ”„ Update Failures

  1. Check file permissions on web server
  2. Ensure backup directory is writable
  3. extension=zip Enabled in your php.ini example of a disabled extention is ;extension=zip
  4. Verify GitHub connectivity
  5. Check PHP error logs
  6. Manual update via Docker: docker compose pull && docker compose up -d

๐Ÿ“ Project Structure

DCS-Statistics-Dashboard/
โ”œโ”€โ”€ ๐Ÿ“ dcs-stats/                  # Main web application
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ site-config/            # Admin panel (NEW!)
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ” index.php          # Admin dashboard
โ”‚   โ”‚   โ”œโ”€โ”€ ๐ŸŽจ themes.php         # Theme manager
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ”„ update.php         # Update system
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ’พ backups.php        # Backup management
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ‘ฅ users.php          # User management
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“ api/               # Admin API endpoints
โ”‚   โ”œโ”€โ”€ ๐Ÿ  index.php              # Homepage 
โ”‚   โ”œโ”€โ”€ ๐Ÿ† leaderboard.php        # Combat rankings
โ”‚   โ”œโ”€โ”€ ๐Ÿ’ฐ pilot_credits.php      # Credits leaderboard
โ”‚   โ”œโ”€โ”€ ๐Ÿ‘จโ€โœˆ๏ธ pilot_statistics.php   # Pilot profiles
โ”‚   โ”œโ”€โ”€ ๐Ÿ›ก๏ธ squadrons.php          # Squadron system
โ”‚   โ”œโ”€โ”€ ๐Ÿ–ฅ๏ธ servers.php            # Server status
โ”‚   โ””โ”€โ”€ ๐ŸŽจ themes/                # Theme files
โ”œโ”€โ”€ ๐Ÿณ Dockerfile                 # Production container
โ”œโ”€โ”€ ๐Ÿณ docker-compose.yml         # Docker orchestration
โ””โ”€โ”€ ๐Ÿ“š README.md                  # This guide

๐Ÿค Contributing

We welcome contributions from the DCS community!

Development Setup

# Clone repository
git clone https://github.com/Penfold-88/DCS-Statistics-Website-Uploader.git

# Create feature branch
git checkout -b feature/amazing-feature

# Make changes and test
# Submit pull request

Contribution Guidelines

  • โœ… Follow existing code patterns
  • โœ… Test responsive design
  • โœ… Ensure security best practices
  • โœ… Update documentation
  • โœ… Include screenshots for UI changes

๐Ÿ“„ License & Credits

License

This project is licensed under the MIT License - see LICENSE file.

๐Ÿ™ Acknowledgments

  • DCSServerBot by Special K - The foundation of this system
  • Sky Pirates Squadron - Original development and testing
  • DCS Community - Continuous feedback and improvements
  • Eagle Dynamics - For creating DCS World

๐Ÿš€ Get Started Today

โญ Star this repository if it helps your community!
๐Ÿ› Report issues to help improve the platform
๐Ÿ’ฌ Share with other DCS server administrators
๐ŸŽฎ Join the community and showcase your dashboard

Support Links

Transform your DCS server into a professional gaming platform today! ๐ŸŽ–๏ธ

About

Transform your DCS server data into a stunning, interactive web dashboard with real-time API integration!, Requires DCSSERVERBOT by Special K

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • PHP 86.4%
  • CSS 8.0%
  • JavaScript 4.3%
  • Dockerfile 1.3%