Complete update distribution system for BattleMaster gaming platform.
-
Copy this folder to your localhost:
C:\xampp\htdocs\battlemaster-update-server -
Access admin panel:
http://localhost/battlemaster-update-server/admin.php Password: admin123 -
Configure your main project to use this update server in
config/update.php:'api_url' => 'http://localhost/battlemaster-update-server/api/v1'
battlemaster-update-server/
├── index.php # Main API endpoint handler
├── admin.php # Admin control panel (UI)
├── package-update.php # Update packaging script
├── version.json # Current version info
├── config.json # Server configuration
├── changelog.json # Release notes for all versions
├── .htaccess # Apache rewrite rules
├── updates/ # ZIP update packages (auto-created)
│ ├── 1.0.5.zip
│ ├── 1.0.4.zip
│ └── ...
└── README.md # This file
Contains information about the latest version:
latest_version- Current version numberdownload_url- URL to download the updaterelease_notes- Brief description of changesmigration_required- Whether database migrations are neededchecksum- MD5 hash for verification
Server configuration:
global_update_enabled- Master switch for update distributionrequire_license- Whether to validate license keysmax_download_size- Maximum ZIP file size
-
Edit
package-update.php:$sourceProjectPath = 'C:/xampp/htdocs/battlemaster'; $version = '1.0.5';
-
Run the script:
php package-update.php
-
The script will:
- Create ZIP from your project
- Exclude protected files (.env, vendor, storage)
- Generate checksum
- Update version.json
- Save to /updates directory
-
Create a ZIP file with these folders:
/app /config /database/migrations /resources /routes /public /bootstrap artisan composer.json package.json -
Name it:
{version}.zip(e.g.,1.0.5.zip) -
Place in
/updatesdirectory -
Update
version.jsonmanually
.env- Environment configuration/vendor/*- Composer dependencies/node_modules/*- NPM dependencies/storage/*- User uploads and logs/public/storage- Storage symlink*.log- Log files
GET /api/v1/check-update?version=1.0.0&license=XXXX
Response:
{
"current_version": "1.0.0",
"latest_version": "1.0.5",
"update_available": true,
"download_url": "http://localhost/.../download-update?...",
"release_notes": "Bug fixes and improvements",
"migration_required": true,
"checksum": "a1b2c3d4...",
"file_size": 5242880
}
GET /api/v1/download-update?token=SECRET_KEY&version=1.0.5
Response:
ZIP file download
GET /api/v1/changelog?version=1.0.5
Response:
{
"version": "1.0.5",
"changes": {
"added": [...],
"fixed": [...],
"improved": [...]
}
}
Change the default token in index.php:
define('AUTH_TOKEN', 'YOUR_SECRET_KEY_HERE');Also update in buyer's config/update.php:
'auth_token' => 'YOUR_SECRET_KEY_HERE'Change in admin.php:
define('ADMIN_PASSWORD', 'your_secure_password');-
Disable Global Updates
- Go to admin panel
- Toggle OFF "Enable Global Updates"
- This prevents buyers from seeing test updates
-
Create Update Package
php package-update.php
-
Test Update on Clean Installation
- Install your app fresh
- Try the update
- Verify all features work
-
Update Changelog
- Edit
changelog.json - Add detailed release notes
- Edit
-
Enable Global Updates
- Toggle ON in admin panel
- Now buyers can see and download
-
Push to GitHub
git init git add . git commit -m "Update server v1.0.5" git push origin main
-
Update Download URLs
- In
version.json, change:
"download_url": "https://your-domain.com/api/v1/download-update?..."
- In
-
Deploy to Server
- Upload to web hosting
- Configure Apache/Nginx
- Update DNS records
Copilot, please:
1. Update $version to '1.0.6' in package-update.php
2. Run the packaging script
3. Update changelog.json with these changes:
- Fixed wallet sync issues
- Added new tournament features
4. Update version.json release notes
Copilot, please:
1. Commit all changes in update server
2. Push to GitHub repository
3. Update version.json download_url to production URL
Copilot, please:
1. Open config.json
2. Set "global_update_enabled" to true/false
Access: http://localhost/battlemaster-update-server/admin.php
- ✅ View current version statistics
- ✅ Toggle global update distribution
- ✅ Update version information
- ✅ View available update packages
- ✅ Monitor package sizes and dates
- ✅ View server configuration
- Latest version number
- Total available updates
- Distribution status (ON/OFF)
- Buyer logs into admin panel
- Clicks "System Updates"
- Clicks "Check for Updates"
- System calls:
/api/v1/check-update - If update available, shows details
- Buyer clicks "Update Now"
- System:
- Downloads ZIP
- Creates backup
- Extracts files
- Runs migrations
- Clears cache
- Update complete!
- Check if
global_update_enabledis true in config.json - Verify version numbers are correct
- Check API endpoint is accessible
- Verify ZIP file exists in /updates directory
- Check file permissions (755 for directories, 644 for files)
- Verify auth token matches
- Check source project path in package-update.php
- Verify PHP ZipArchive extension is enabled
- Check disk space
Use Semantic Versioning:
- Major: Breaking changes (2.0.0)
- Minor: New features, backward compatible (1.1.0)
- Patch: Bug fixes (1.0.1)
- Create GitHub repository
- Push update server code
- Use GitHub Releases for ZIP files
- Update
download_urlto GitHub release URL
- Upload to web hosting (cPanel, VPS, etc.)
- Configure Apache/Nginx
- Set up SSL certificate
- Update API URLs in buyer config
- Upload ZIPs to CDN (Cloudflare, DigitalOcean Spaces)
- Use CDN URLs for downloads
- Keep API on separate server
For issues or questions:
- GitHub: Create an issue
- Email: support@yourdomain.com
Version: 1.0.0
Last Updated: December 9, 2025
Author: DaveeDeCoder