================================================================================
MULTICASTING DEAL FINDER - SIMPLE INSTALLATION GUIDE FOR BEGINNERS
================================================================================

This guide is for beginners who are installing this application using their
web hosting control panel (cPanel, Plesk, StackCP, or similar).

================================================================================
WHAT YOU NEED BEFORE STARTING
================================================================================

1. Web hosting account with control panel access (cPanel, Plesk, etc.)
2. Access to phpMyAdmin or database tools in your control panel
3. An FTP program OR file manager in your control panel
4. The application ZIP file you received
5. About 15-30 minutes

Don't worry - we'll go through everything step by step!

================================================================================
STEP 1: UPLOAD THE FILES
================================================================================

OPTION A: Using Control Panel File Manager (Easier)
----------------------------------------------------

1. Log in to your web hosting control panel
   - This is usually at yoursite.com/cpanel or yoursite.com:8443
   - Use the username and password provided by your hosting company

2. Find the File Manager
   - Look for an icon called "File Manager" or "Files"
   - Click on it to open

3. Navigate to the right folder
   - Look for a folder called "public_html" or "www" or "htdocs"
   - This is where your website files go
   - Double-click to open it
   
   IMPORTANT: You can install in this main folder OR create a subfolder:
   - Main folder: App will be at yoursite.com
   - Subfolder: Create a folder like "app" and install there (yoursite.com/app)
   
   To create a subfolder:
   - Click "New Folder" or "+Folder" button
   - Name it something like "multicasting" or "app"
   - Double-click to open the new folder

4. Upload the ZIP file
   - Click the "Upload" button (usually at the top)
   - Click "Select File" or "Choose File"
   - Find the application ZIP file on your computer
   - Click "Open" to start uploading
   - Wait for the upload to complete (you'll see a progress bar)
   - Close the upload window when it says "Complete"

5. Extract (Unzip) the files
   - Go back to File Manager
   - Find the ZIP file you just uploaded
   - Click on it once to select it
   - Look for an "Extract" or "Uncompress" button
   - Click it
   - Choose "Extract to current directory" or similar
   - Click "Extract" or "OK"
   - Wait for it to finish
   - You can now delete the ZIP file (select it and click Delete)

OPTION B: Using FTP (Alternative Method)
-----------------------------------------

1. Download an FTP program like FileZilla (free)
   - Go to filezilla-project.org
   - Download and install FileZilla Client

2. Connect to your server
   - Open FileZilla
   - Enter your FTP details (provided by your hosting company):
     * Host: ftp.yoursite.com (or your domain)
     * Username: Your FTP username
     * Password: Your FTP password
     * Port: 21 (usually)
   - Click "Quickconnect"

3. Navigate to the right folder
   - On the right side (Remote Site), find public_html or www or htdocs
   - Double-click to open it
   - Optional: Create a subfolder (right-click, select Create Directory)

4. Upload files
   - On your computer (left side), find the unzipped application files
   - Select all files and folders
   - Drag them to the right side (Remote Site)
   - Wait for all files to upload (this may take a few minutes)

================================================================================
STEP 2: CREATE THE DATABASE
================================================================================

1. Go back to your control panel main page

2. Find MySQL Databases
   - Look for "MySQL Databases" or "Databases" section
   - Click on it

3. Create a new database
   - Find the "Create New Database" section
   - Enter a database name (e.g., "multicasting_db")
   - Remember this name - you'll need it later!
   - Click "Create Database"
   - You should see a success message

4. Create a database user
   - Scroll down to "MySQL Users" section
   - Enter a username (e.g., "multi_user")
   - Enter a strong password (or use the password generator)
   - IMPORTANT: Write down this password - you'll need it later!
   - Click "Create User"

5. Add user to database
   - Scroll to "Add User To Database" section
   - Select your database from the first dropdown
   - Select your user from the second dropdown
   - Click "Add"
   - On the next screen, check "ALL PRIVILEGES"
   - Click "Make Changes"

6. Write down your information:
   - Database Name: _______________________
   - Database Username: ___________________
   - Database Password: ___________________
   - Database Host: localhost (almost always this)

================================================================================
STEP 3: IMPORT THE DATABASE TABLES
================================================================================

1. Find phpMyAdmin in your control panel
   - Look for an icon called "phpMyAdmin"
   - Click on it to open

2. Select your database
   - On the left side, you'll see a list of databases
   - Click on the database you created (e.g., multicasting_db)

3. Import the database file
   - Click the "Import" tab at the top
   - Click "Choose File" or "Browse"
   - Navigate to where you uploaded the files
   - Find and select "database.sql"
   - Click "Open"
   - Scroll down and click "Go" button at the bottom
   - Wait a moment

4. Verify tables were created
   - Click on your database name on the left again
   - You should now see a list of tables:
     * users
     * sales
     * platform_searches
     * script_generations
     * margin_calculations
     * vetter_checklists
   - If you see these tables, success! Move to next step.
   - If not, try the import again or contact your hosting support.

================================================================================
STEP 4: CONFIGURE THE APPLICATION
================================================================================

1. Go back to File Manager in your control panel

2. Navigate to where you uploaded the files
   - Go to public_html (or wherever you uploaded)
   - Go into the subfolder if you created one

3. Find and edit config.php
   - Find the file called "config.php"
   - Right-click on it
   - Select "Edit" or "Code Edit" or "HTML Edit"
   - A text editor will open

4. Update the database settings
   Find these lines near the top:
   
   define('USER_DB_HOST', 'localhost');
   define('USER_DB_NAME', 'your_app_db');
   define('USER_DB_CHARSET', 'utf8mb4');
   define('USER_DB_USER', 'db_user');
   define('USER_DB_PASSWORD', 'db_password');
   
   Change them to YOUR information:
   - USER_DB_HOST: Keep as 'localhost' (don't change this)
   - USER_DB_NAME: Put your database name in quotes
   - USER_DB_USER: Put your database username in quotes
   - USER_DB_PASSWORD: Put your database password in quotes
   
   Example:
   define('USER_DB_NAME', 'multicasting_db');
   define('USER_DB_USER', 'multi_user');
   define('USER_DB_PASSWORD', 'myP@ssw0rd123');

5. Save the file
   - Click "Save" or "Save Changes"
   - Close the editor

YOU'RE ALMOST DONE!

================================================================================
STEP 5: TEST THE INSTALLATION
================================================================================

1. Open your website
   - If you installed in main folder: http://yoursite.com
   - If you installed in subfolder: http://yoursite.com/subfolder-name
   - Example: http://yoursite.com/multicasting

2. You should be redirected to a login page
   - This is normal and correct!
   - The login and registration pages are provided separately
   - If you see a login page, your installation is working!

3. What you should see:
   ✓ A login page asking for username and password
   
4. What you should NOT see:
   ✗ "Database connection failed" - Check your config.php settings
   ✗ Blank white page - Check the files uploaded correctly
   ✗ "500 Internal Server Error" - Contact your hosting support
   ✗ List of files - You may need to add an index.php redirect

================================================================================
STEP 6: GET YOUR OPENAI API KEY
================================================================================

Before you can use the AI features, you need an OpenAI API key:

1. Go to https://platform.openai.com/signup
   - Create a free account if you don't have one
   - Verify your email address

2. Go to https://platform.openai.com/api-keys
   - Log in if needed
   - Click "Create new secret key"
   - Give it a name like "Multicasting App"
   - Click "Create"
   - COPY THE KEY - it starts with "sk-"
   - IMPORTANT: Save this key somewhere safe!
   - You won't be able to see it again!

3. Add billing information (if required)
   - Go to https://platform.openai.com/account/billing
   - Add a payment method
   - Set a usage limit (like $10/month) to control costs
   - The app uses very little API credits (pennies per use)

4. After logging into the app:
   - Go to "API Settings" in the menu
   - Paste your API key
   - Click "Save API Key"

================================================================================
IMPORTANT NOTES
================================================================================

FILES ALREADY PROVIDED:
The following files are already included in your application:
- protect.php (security)
- user-lib.php (user management)
- login.php (login page)
- logout.php (logout functionality)
- register.php (registration page)

You don't need to find or add these files - they're already there!

SECURITY:
- Always use HTTPS (https://yoursite.com) instead of HTTP
- Choose a strong database password
- Keep your OpenAI API key private
- Never share your database credentials

COSTS:
- The application itself is free
- Your web hosting has its own cost
- OpenAI API usage is very cheap (typically $0.01-0.03 per use)
- You can set spending limits in your OpenAI account

SUBFOLDERS:
The application can be installed in:
- Main directory: yoursite.com
- Subfolder: yoursite.com/app
- Any subdirectory you create

All links in the app use relative paths, so it works in any location!

================================================================================
TROUBLESHOOTING FOR BEGINNERS
================================================================================

PROBLEM: "Database connection failed"
SOLUTION:
1. Go back to File Manager
2. Edit config.php
3. Double-check your database name, username, and password
4. Make sure they exactly match what you created
5. Keep the quotes around the values
6. Save and try again

PROBLEM: Blank white page
SOLUTION:
1. Check if all files uploaded correctly
2. Try refreshing your browser
3. Clear your browser cache (Ctrl+F5 or Cmd+Shift+R)
4. Make sure database.sql was imported successfully

PROBLEM: "Page not found" or 404 error
SOLUTION:
1. Check the URL - include the subfolder name if you created one
2. Make sure files are in public_html (or www, or htdocs)
3. Check that index.php exists in your installation folder

PROBLEM: Can't edit config.php
SOLUTION:
1. Download the file using File Manager
2. Edit it on your computer with Notepad (Windows) or TextEdit (Mac)
3. Upload the edited file back, replacing the old one

PROBLEM: phpMyAdmin won't open
SOLUTION:
1. Try clicking it again from control panel
2. Make sure you're logged into control panel
3. Contact your hosting support if it still doesn't work

PROBLEM: Import database.sql failed
SOLUTION:
1. Make sure you selected the right file
2. Check you selected your database on the left first
3. Try uploading database.sql through File Manager first
4. Then import it from there in phpMyAdmin

PROBLEM: Still stuck?
SOLUTION:
1. Contact your web hosting support - they can help with:
   - Creating databases
   - File permissions
   - Server issues
2. Take screenshots of any error messages
3. Tell them you're installing a PHP/MySQL application

================================================================================
WHAT'S NEXT?
================================================================================

After successful installation:

1. Register for an account at the login page

2. Log in with your new account

3. Go to API Settings and add your OpenAI API key

4. Try each tool:
   - Start with Margin Calculator (works without API key)
   - Then try Platform Selector
   - Then Script Generator
   - Finally, Vetter Checklist

5. Read the User Guide (USERGUIDE.txt) to learn how to use each feature

6. Start using the tools for your business!

================================================================================
GETTING HELP
================================================================================

If you need help:

1. Re-read this guide carefully
2. Check the troubleshooting section above
3. Read the USERGUIDE.txt for using the features
4. Read the README.txt for technical details
5. Contact your web hosting support for:
   - Database issues
   - File upload problems
   - Control panel questions
   - Server configuration

================================================================================
CHECKLIST
================================================================================

Before you start:
□ Web hosting account with control panel access
□ Application ZIP file downloaded
□ 15-30 minutes available

Installation steps:
□ Files uploaded to server
□ ZIP file extracted
□ Database created
□ Database user created and added to database
□ Database information written down
□ database.sql imported successfully
□ Tables visible in phpMyAdmin
□ config.php edited with correct database info
□ config.php saved

Testing:
□ Website loads without errors
□ Login page appears
□ Can register a new account
□ Can log in successfully
□ Can see the dashboard
□ OpenAI API key obtained
□ API key added in API Settings

Ready to use:
□ Read the USERGUIDE.txt
□ Try the Margin Calculator first
□ Add your OpenAI API key
□ Try other tools
□ Start using for your business!

================================================================================
CONGRATULATIONS!
================================================================================

If you've completed all the steps, your Multicasting Deal Finder & Broadcaster
is now installed and ready to use!

Enjoy using your new business tool!

================================================================================
END OF SIMPLE INSTALLATION GUIDE
================================================================================