================================================================================
    INFINITY MEDICAL - PROFESSIONAL INSTALLATION GUIDE
================================================================================

Thank you for choosing Infinity Medical! This guide will help you install
and configure your medical equipment website.

================================================================================
    SYSTEM REQUIREMENTS
================================================================================

- PHP 7.4 or higher
- MySQL 5.7 or higher (or MariaDB 10.2+)
- Apache web server with mod_rewrite enabled
- PDO MySQL extension enabled
- GD Library for image processing
- At least 50MB free disk space

================================================================================
    QUICK INSTALLATION (RECOMMENDED)
================================================================================

1. Upload all files to your web server (via FTP, cPanel File Manager, etc.)

2. Open your browser and navigate to:
   http://your-domain.com/install.php

3. Follow the installation wizard:
   - Step 1: Welcome screen
   - Step 2: Enter your MySQL database credentials
   - Step 3: Set up admin account and email configuration
   - Step 4: Complete installation

4. Once installation is complete, visit your website:
   http://your-domain.com/index.html

5. Access admin panel using the credentials you created during installation

================================================================================
    MANUAL INSTALLATION
================================================================================

If you prefer to install manually:

1. DATABASE SETUP:
   - Create a MySQL database in your cPanel or hosting control panel
   - Note down: database name, username, password, and host

2. CONFIGURATION:
   - Edit: api/config/env.php
   - Update the following values:
     * DB_HOST - Your MySQL host (usually 'localhost')
     * DB_NAME - Your database name
     * DB_USER - Your database username
     * DB_PASS - Your database password
     * ADMIN_USERNAME - Your admin login username
     * ADMIN_PASSWORD - Your admin login password
     * SMTP settings - Your email server configuration

3. DATABASE TABLES:
   - Import the SQL file: install/database.sql
   - Or use phpMyAdmin to import the file
   - The database tables will be created automatically

4. FILE PERMISSIONS:
   - Ensure api/uploads/ directory is writable (chmod 755 or 777)
   - Ensure api/config/ directory is writable (chmod 755)

5. TEST INSTALLATION:
   - Visit: http://your-domain.com/api/setup.php
   - This will test your database connection and configuration

================================================================================
    DIRECTORY STRUCTURE
================================================================================

Infinity-Global/
├── api/                    # PHP Backend API
│   ├── config/            # Configuration files
│   ├── controllers/       # API controllers
│   ├── utils/            # Utility classes
│   └── uploads/          # Uploaded images (must be writable)
├── client/                # React frontend (if using)
├── install/               # Installation files
├── images/                # Static images
├── index.html            # Main website
└── install.php           # Installation wizard

================================================================================
    DATABASE TABLES
================================================================================

The system creates the following tables:

1. services    - Detailed contact forms
2. ser         - Simple contact forms
3. rental      - Rental service forms
4. parts       - Product parts catalog

All tables are created automatically during installation.

================================================================================
    API ENDPOINTS
================================================================================

GET  /api/              - Get all parts
GET  /api/parts?modality=X - Get parts by modality
POST /api/form          - Submit detailed contact form
POST /api/forms         - Submit simple contact form
POST /api/rental        - Submit rental service form
POST /api/add           - Add new part (admin, requires auth)
PUT  /api/{id}          - Update part (admin, requires auth)
DELETE /api/{id}        - Delete part (admin, requires auth)
POST /api/login         - Admin login
GET  /api/dashboard     - Admin dashboard (requires auth)

================================================================================
    ADMIN PANEL
================================================================================

1. Login at: http://your-domain.com/admin (or your admin route)
2. Use the credentials you set during installation
3. Manage parts, view forms, and configure settings

================================================================================
    SECURITY RECOMMENDATIONS
================================================================================

1. Change default admin credentials immediately after installation
2. Use strong passwords for database and admin account
3. Keep PHP and MySQL updated
4. Regularly backup your database
5. Don't share your admin credentials
6. Update JWT_SECRET in env.php to a random string

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

PROBLEM: Database connection failed
SOLUTION: 
- Verify database credentials in api/config/env.php
- Ensure database exists and user has proper permissions
- Check if MySQL service is running

PROBLEM: Images not uploading
SOLUTION:
- Check api/uploads/ directory permissions (should be 755 or 777)
- Verify PHP upload_max_filesize and post_max_size settings
- Check file size limits in api/config/env.php

PROBLEM: 500 Internal Server Error
SOLUTION:
- Check PHP error logs
- Verify file permissions
- Ensure all required PHP extensions are installed
- Check .htaccess file exists

PROBLEM: Forms not sending emails
SOLUTION:
- Verify SMTP settings in api/config/env.php
- Test SMTP credentials
- Check if your hosting allows SMTP connections
- Verify email server port (usually 587 or 465)

================================================================================
    SUPPORT
================================================================================

For technical support or questions:
- Email: support@infinitymedical.co
- Website: https://infinitymedical.co

================================================================================
    LICENSE & COPYRIGHT
================================================================================

Copyright (c) 2024 Infinity Medical / Promed Solutions
All rights reserved.

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

Thank you for using Infinity Medical!
