================================================================================
SKILL BATTLE - CPANEL DEPLOYMENT & SETUP GUIDE
================================================================================

This package contains the complete, 100% production-ready Skill Battle application,
including the latest database export (`database_final.sql`), unauthenticated `/main`
onboarding redirects, customized withdraw flow, match cards, and all assets.

--------------------------------------------------------------------------------
STEP 1: UPLOAD & EXTRACT FILES IN CPANEL
--------------------------------------------------------------------------------
1. Log into your cPanel dashboard.
2. Go to "File Manager" -> Navigate to "public_html" (or your target sub-folder / subdomain).
3. Click "Upload" and upload `skillbattle_cpanel_final.zip`.
4. Right-click the uploaded zip file and select "Extract".
5. Ensure hidden files are visible in cPanel File Manager:
   (Click "Settings" at top-right -> Check "Show Hidden Files (dotfiles)" -> Save).
   Ensure `.htaccess` and `.env` are present in your root directory.

--------------------------------------------------------------------------------
STEP 2: CREATE DATABASE IN CPANEL
--------------------------------------------------------------------------------
1. In cPanel, navigate to "MySQL Databases" (or "MySQL Database Wizard").
2. Create a new database (e.g., `yourcpaneluser_skillbattle`).
3. Create a new database user and generate a secure password.
4. Add the User to the Database and grant "ALL PRIVILEGES".

--------------------------------------------------------------------------------
STEP 3: IMPORT THE DATABASE DUMP
--------------------------------------------------------------------------------
1. In cPanel, open "phpMyAdmin".
2. Select your newly created database from the left-hand menu.
3. Click the "Import" tab at the top.
4. Click "Choose File" and select `database_final.sql` included in this package.
5. Click "Go" at the bottom to import all tables, settings, games, and user data.

--------------------------------------------------------------------------------
STEP 4: CONFIGURE ENVIRONMENT & DATABASE (.env)
--------------------------------------------------------------------------------
Open `.env` in the cPanel File Manager Code Editor and update the following:

   APP_BASE_URL=https://yourdomain.com/
   DB_HOST=localhost
   DB_NAME=yourcpaneluser_skillbattle
   DB_USER=yourcpaneluser_dbuser
   DB_PASS=your_db_password

   # Set CI_ENV to production when live
   CI_ENV=production

   # Push Notifications (Optional)
   ONESIGNAL_APP_ID=your_onesignal_app_id
   ONESIGNAL_REST_API_KEY=your_onesignal_rest_api_key

--------------------------------------------------------------------------------
STEP 5: FILE PERMISSIONS & DIRECTORY WRITABILITY
--------------------------------------------------------------------------------
Ensure the following folders have write permissions (chmod 755 or 775):
   - `uploads/` (and all subfolders: games, banners, profiles, etc.)
   - `application/cache/`
   - `application/logs/`

--------------------------------------------------------------------------------
STEP 6: ACCESSING YOUR APPLICATION
--------------------------------------------------------------------------------
- User Web App:     https://yourdomain.com/
  * Visitors not logged in will automatically land on the onboarding page (`/main`).
  * Direct Login / Register available from the onboarding slider.
  * Logged in users access games, tournaments, wallet, and profile seamlessly.

- Admin Panel:      https://yourdomain.com/admin  (or /admin2020)
  * Default Admin Login credentials:
    Username / Email: admin@gmail.com
    Password: admin
  * Note: You can change the admin password inside Admin Panel -> Settings -> Change Password.
================================================================================
