# Namecheap cPanel deployment: no SSH / no Terminal

## Important status
This ZIP is an application source overlay, not a complete runnable Laravel installation. Laravel's framework and `vendor/` dependencies are mandatory. They must be installed on a development computer by Composer and included in the deployment ZIP. Do not upload this overlay by itself and expect the website to run.

## What can be done in cPanel
- File Manager: upload/extract the finished application package.
- MySQL Database Wizard: create a database and database user; grant all privileges.
- phpMyAdmin: import `database/cpanel-install.sql` into a NEW empty database.
- Cron Jobs: run a PHP cleanup script or Laravel scheduler only after the corresponding command is implemented and tested.
- MultiPHP Manager: select a PHP version supported by both your Laravel release and your hosting account.

## Safe deployment layout
Preferred layout:

```
/home/CPANELUSER/pdf-toolkit/       # entire Laravel project, including vendor/
/home/CPANELUSER/pdf-private/       # uploaded and generated files; not public
/home/CPANELUSER/public_html/       # contents of Laravel public/ only
```

The domain document root should point to `/home/CPANELUSER/pdf-toolkit/public` if the account allows changing it. If it does not, put only the contents of Laravel's `public/` into `public_html` and carefully update `index.php` paths to the private project directory. Never expose `.env`, `vendor/`, `storage/`, `bootstrap/` or uploaded documents.

## Database import
1. Create a new MySQL database and database user in cPanel.
2. Grant all privileges to that user for the database.
3. Open phpMyAdmin and select the new, empty database.
4. Import `database/cpanel-install.sql`.
5. Update the production `.env` DB settings to match the exact cPanel database name, username and password. cPanel commonly prefixes database names and usernames.
6. Set `APP_ENV=production`, `APP_DEBUG=false`, `APP_URL=https://your-domain`, a unique `APP_KEY`, and secure session settings.

The SQL file creates the application tables and starter catalogue. It is for a NEW empty database and should not be imported over an existing production database.

## Before launch
- Build a complete Laravel project locally with the matching Laravel version and PHP version.
- Merge this overlay into that project; retain Laravel's default migrations and framework files.
- Install dependencies locally with Composer and include the resulting `vendor/` directory.
- Test login, registration, admin permissions, tool CRUD, database connection, uploads and downloads locally.
- Confirm the hosting account's PHP version and extensions from cPanel. Do not assume all command-line binaries are present.
- Confirm the account's actual document-root configuration with Namecheap.
- Set writable permissions only on `storage/` and `bootstrap/cache/` as needed; do not use 0777.
- Enable HTTPS and create database + file backups.

## Cron Jobs
A cron entry is not a substitute for a queue worker unless the app has a bounded scheduled job processor. Namecheap shared plans can impose minimum cron intervals and process limits. Only configure cleanup after the cleanup command/script exists. Never create a public cleanup URL without a strong secret and access control.

## Feature compatibility
PHP-native libraries can run on shared hosting if their PHP extensions and memory limits are available. Tools requiring Ghostscript, Poppler, LibreOffice, Tesseract, ImageMagick delegates, or long-running workers may be unavailable or restricted. Keep such tools disabled until the exact server capability has been verified.

## Admin account
Do not use a publicly exposed installer to create an administrator. The admin account should be created locally using Laravel's seeder or through a protected one-time setup procedure, then that procedure must be removed. Public registration must always create `role=user`.
