================================================================================
              SLEEKDEPLOY - DEPLOYMENT & SETUP GUIDE (HINGLISH)
================================================================================

Yeh guide aapko step-by-step samjhayegi ki is PHP File Uploader & Hosting System 
ko apne local computer ya kisi bhi web hosting/cPanel par kaise deploy aur run karna hai.

--------------------------------------------------------------------------------
OPTION 1: Local Computer Pe Kaise Run Karein?
--------------------------------------------------------------------------------

Agar aap isko apne PC/Laptop par test karna chahte hain:

Step 1: PHP Server Tools Install Karein
* Apne system par XAMPP, Laragon, ya MAMP me se koi ek software install karein.

Step 2: Project Files Place Karein
* XAMPP user: Apne C:/xampp/htdocs/ folder ke andar ek naya folder banayein, 
  jaise "fileupload", aur is project ki saari files usme copy kar dein.
* Laragon user: C:/laragon/www/ folder ke andar copy karein.

Step 3: Run built-in PHP server (Alternative & Easiest Way)
* Agar aapke PC par PHP already command line me installed hai, toh is project directory
  ko VS Code me open karein, terminal kholein, aur yeh command chalayein:
  
  php -S localhost:8000

Step 4: Browser me check karein
* Apne browser me open karein: http://localhost/fileupload/ (XAMPP ke liye)
  ya http://localhost:8000 (Built-in PHP server ke liye).

--------------------------------------------------------------------------------
OPTION 2: cPanel / Shared Hosting Pe Kaise Deploy Karein?
--------------------------------------------------------------------------------

Agar aapke paas domain aur shared hosting (Namecheap, Hostinger, GoDaddy, etc.) hai:

Step 1: Zip File Banayein
* Apne computer par is project ke folder ki saari files (config.php, functions.php, 
  api.php, index.html/index.php, admin.php, and deploy folder) ko select karke 
  ek zip archive (.zip) bana lein.

Step 2: cPanel Log in Karein
* Apne hosting provider ke dashboard me jaakar cPanel login karein.

Step 3: File Manager Open Karein
* cPanel me "File Manager" par click karein aur `public_html` directory me jayein.
* Agar aap sub-domain par host kar rahe hain, toh sub-domain ke custom folder me jayein.

Step 4: Upload aur Extract Karein
* Top menu me "Upload" button par click karke apni banayi hui zip file ko upload karein.
* Upload complete hone ke baad, zip file par right-click karke "Extract" kar dein.

Step 5: Permissions Check Karein
* ensure karein ki `deploy` folder ka permission `755` set ho taaki PHP files 
  ko write aur save kar sake.

Step 6: Ab aapka link live hai!
* Apne domain name ko visit karein (jaise: https://yourdomain.com/).

--------------------------------------------------------------------------------
OPTION 3: VPS Server (Ubuntu/Nginx/Apache) Par Kaise Deploy Karein?
--------------------------------------------------------------------------------

Agar aap VPS use kar rahe hain:

Step 1: Files ko Git/SFTP ke zariye `/var/www/html/fileupload` me upload karein.
Step 2: Folder owners ko Nginx/Apache group me assign karein:
        sudo chown -R www-data:www-data /var/www/html/fileupload
Step 3: Write permissions allow karein `deploy` aur `database.json` ke liye:
        sudo chmod -R 755 /var/www/html/fileupload
        sudo chmod -R 777 /var/www/html/fileupload/deploy

--------------------------------------------------------------------------------
ZAROORI SETTINGS (deployment ke baad sabse pehle karein):
--------------------------------------------------------------------------------

1. Change Authorization Keys (Bohot Zaroori Hai):
   - file open karein: `config.php`
   - Line number 7 par `DEPLOYMENT_KEYS` array me default keys ko badal kar 
     apna khud ka strong secret key set karein:
     
     define('DEPLOYMENT_KEYS', [
         'apna-custom-strong-key-here'
     ]);

2. Max Upload Size Limit (Optional):
   - Agar aapko 100MB se badi files upload karni hain, toh `config.php` me 
     `MAX_FILE_SIZE` ki value badlein.
   - Sath hi apne Server ke `php.ini` file me `upload_max_filesize` aur 
     `post_max_size` ko bhi increase karein.

3. Spam & Brute Force IP Blocking (Automated):
   - System me dynamic security protection built-in hai.
   - Agar koi person/bot 5 times lagatar galat auth key enter karega (chahe UI se ya API se), 
     toh uska IP address **24 hours ke liye automatic block** ho jayega.
   - Yeh logs aur tracking `deploy/failed_attempts.json` file me live save hoti hain.


================================================================================
SleekDeploy is ready to go! Kisi bhi problem ke liye ap.log checks kar sakte hain.
================================================================================
