# AGRIVALE PHP/MySQL Setup

This project now uses plain PHP endpoints with MySQL, so it can run in Laragon and on shared cPanel hosting.

## Local Laragon

1. Start Apache and MySQL in Laragon.
2. Open Laragon Terminal or use the bundled MySQL client.
3. Import `database/schema.sql`.
4. Import `seed-news.sql` if you want the starter news posts.
5. Check `app/config.php`; the default local database is `agrivale`, user `root`, and empty password.
6. Visit the site through Laragon/Apache, not by opening the HTML file directly, because the forms call PHP endpoints.

Temporary admin login after importing the schema:

- Email: `admin@agrivale.com.ng`
- Password: `ChangeMe123!`

Change this password before production by replacing the `admin_users.password_hash` value.

## cPanel

1. Create a MySQL database and user in cPanel.
2. Import `database/schema.sql` into that database.
3. Import `seed-news.sql` if needed.
4. Upload the project files to `public_html`.
5. Update `app/config.php` with the cPanel database name, username, and password.
6. Confirm `app/.htaccess` is uploaded so the config/helper files are not publicly accessible.
