# Ghana–US Investment Initiative Deployment

## Requirements

- PHP 8.3 or newer with the extensions required by Laravel
- MySQL 8+ or compatible MariaDB
- HTTPS for the production domain

The manual-upload archive includes Composer dependencies in `vendor` and built frontend assets in `public/build`; Node.js and Composer are not required on the hosting account unless rebuilding or updating dependencies.

## cPanel manual upload

1. Upload and extract `ghana-investment-deploy.zip` into a directory outside the web document root, such as a directory alongside `public_html`.
2. Set the domain document root to the extracted project's `public` directory.
3. Copy `.env.example` to `.env`.
4. Configure production values in `.env`:
   - `APP_ENV=production`, `APP_DEBUG=false`, `APP_URL=https://YOUR_DOMAIN`, and a unique `APP_KEY`.
   - MySQL connection values for `DB_HOST`, `DB_PORT`, `DB_DATABASE`, `DB_USERNAME`, and `DB_PASSWORD`.
   - Google Analytics: `GOOGLE_ANALYTICS_ID`.
   - Google reCAPTCHA v3: `RECAPTCHA_ENABLED=true`, `RECAPTCHA_SITE_KEY`, `RECAPTCHA_SECRET_KEY`, and `RECAPTCHA_HOSTNAME`.
   - Brevo transactional email: `BREVO_ENABLED=true`, `BREVO_API_KEY`, `BREVO_SENDER_EMAIL` (a verified sender), and `BREVO_NOTIFICATION_EMAIL`.
5. In cPanel Terminal or another secure PHP CLI, run:

   ```sh
   php artisan key:generate
   php artisan migrate --force
   php artisan storage:link
   php artisan optimize
   ```

6. Ensure `storage` and `bootstrap/cache` are writable by PHP, then open the HTTPS site and test the public forms.

The archive intentionally excludes `.env`, local SQLite databases, logs, cached views, `node_modules`, and development tests. Production must use its own database and secrets. Never publish `.env` or put it under the public document root.

## Administrator

Create or update an administrator using Laravel Tinker from the project directory:

```sh
php artisan tinker --execute="App\Models\User::updateOrCreate(['email'=>'YOUR_EMAIL'], ['name'=>'Administrator','password'=>Illuminate\Support\Facades\Hash::make('YOUR_PASSWORD'),'role'=>'Super Administrator']);"
```

Sign in at `/admin/login` and use a strong unique password.

## Integrations

- Google Analytics loads when `GOOGLE_ANALYTICS_ID` is set.
- Google reCAPTCHA v3 tokens are verified server-side for the forms when enabled.
- Brevo notifications use the Brevo transactional email API (`/v3/smtp/email`), authenticated with `BREVO_API_KEY`; this is not a direct SMTP relay connection.

Keep all production credentials in the hosting account's `.env`, not in source files or chat.
