================================================================================
FB v10 FORMBUILDER - NAMECHEAP DEPLOYMENT PACKAGE
================================================================================

CONTENTS:
This ZIP contains the complete FormBuilder Pro application ready to deploy
on Namecheap shared hosting.

FOLDER STRUCTURE:
When extracted, you'll see "formbuilder_deployment/" folder containing:

  ├── config.php                 (auto-generated by setup wizard)
  ├── lib.php                    (core library)
  ├── index.php                  (public forms list)
  ├── form.php                   (public form renderer)
  ├── admin.php                  (admin dashboard)
  ├── setup.php                  (setup wizard - delete after use)
  ├── book.php                   (booking page)
  ├── plans.php                  (membership plans)
  ├── checkout.php               (checkout page)
  ├── api/                       (REST API endpoints)
  ├── admin/                     (admin pages)
  ├── booking/                   (booking module)
  ├── lib/                       (PHP classes)
  ├── data/                      (uploads, PDFs, submissions)
  ├── vendor/                    (Composer dependencies)
  ├── composer.json              (PHP dependencies)
  ├── .htaccess                  (routing & security)
  └── README.md                  (documentation)

================================================================================
QUICK DEPLOYMENT STEPS
================================================================================

1. EXTRACT THE ZIP
   Extract "formbuilder_deployment/" to your computer

2. UPLOAD TO NAMECHEAP
   - Connect via FTP to your Namecheap account
   - Navigate to public_html/
   - Create folder: public_html/formbuilder/
   - Upload ALL contents of formbuilder_deployment/ into formbuilder/
   - Set permissions: data/ = 755, files = 644

3. RUN SETUP WIZARD
   - Visit: https://yourdomain.com/formbuilder/setup.php
   - Complete 5 setup steps (database, SMTP, etc.)
   - Wizard automatically deletes setup.php when done

4. LOG IN & CREATE FORMS
   - Visit: https://yourdomain.com/formbuilder/admin.php
   - Log in with admin credentials from setup
   - Create your first form

5. TEST PUBLIC FORM
   - Visit: https://yourdomain.com/formbuilder/
   - Click your form and submit a test entry
   - Verify submission appears in admin inbox

================================================================================
WHAT YOU NEED BEFORE UPLOADING
================================================================================

✓ Namecheap account with shared hosting
✓ FTP/SFTP credentials from Namecheap
✓ MySQL database created in cPanel (with username & password)
✓ SMTP credentials (Gmail app password, SendGrid, or Namecheap SMTP)
✓ PHP 7.4+ enabled (verify in cPanel)
✓ FTP client (FileZilla, WinSCP, or use Namecheap File Manager)

================================================================================
CRITICAL URLS AFTER DEPLOYMENT
================================================================================

Setup Wizard:
  https://yourdomain.com/formbuilder/setup.php

Admin Dashboard:
  https://yourdomain.com/formbuilder/admin.php

Public Forms List:
  https://yourdomain.com/formbuilder/

Public Booking Page (if enabled):
  https://yourdomain.com/formbuilder/booking/book.php

================================================================================
SETUP WIZARD CONFIGURATION
================================================================================

Step 2 will ask for:

Database:
  - Host: localhost
  - Name: prefix_formbuilder_db (from cPanel)
  - User: prefix_formbuilder_user (from cPanel)
  - Password: [your MySQL password]

Admin:
  - Email: your-email@example.com
  - Password: [create strong password]

SMTP (Email):
  - Host: smtp.gmail.com (or your SMTP server)
  - Port: 587 (TLS) or 465 (SSL)
  - Username: your-email@gmail.com
  - Password: [Gmail app password or SMTP password]
  - From: noreply@yourdomain.com

================================================================================
FOLDER PERMISSIONS (IMPORTANT!)
================================================================================

After uploading, set these permissions via cPanel File Manager:

  data/              → 755
  data/pdfs/         → 755
  data/uploads/      → 755
  All .php files     → 644

If permissions are wrong, file uploads and PDF generation will fail.

================================================================================
TROUBLESHOOTING
================================================================================

Database Connection Failed:
  → Verify MySQL credentials are correct
  → Check database host is "localhost"
  → Ensure user has ALL PRIVILEGES

Emails Not Sending:
  → Verify SMTP credentials
  → Use Gmail app password (not regular password)
  → Check SMTP port: 587 (TLS) or 465 (SSL)
  → Verify OpenSSL extension enabled in PHP

File Upload Not Working:
  → Set data/uploads/ permissions to 755
  → Check disk space available
  → Verify PHP write permissions

Setup Wizard Not Accessible:
  → Ensure setup.php is in formbuilder/ folder
  → Check file permissions (644)
  → Try: https://yourdomain.com/formbuilder/setup.php

================================================================================
AFTER SETUP
================================================================================

1. ✓ Delete setup.php (wizard does this automatically)
2. ✓ Change admin password from setup password
3. ✓ Enable HTTPS (AutoSSL in Namecheap)
4. ✓ Set up automatic backups in cPanel
5. ✓ Create your first form and test
6. ✓ Configure booking module (optional)
7. ✓ Monitor submissions regularly

================================================================================
SUPPORT RESOURCES
================================================================================

FormBuilder Documentation:
  See README.md in this package

Namecheap Support:
  https://www.namecheap.com/support/

PHP Documentation:
  https://www.php.net/docs.php

MySQL Documentation:
  https://dev.mysql.com/doc/

Stripe Documentation (for booking):
  https://stripe.com/docs

================================================================================
DEPLOYMENT COMPLETE!
================================================================================

Your FormBuilder is ready to deploy. Follow the steps above and you'll have
a fully functional form builder with booking capabilities on Namecheap.

Good luck! 🚀

================================================================================
