KMC Work Management & Attendance — Hosting & MySQL Setup Guide

Summary 
This document contains clear, step-by-step instructions to deploy the KMC Work Management & Attendance prototype to cPanel hosting and configure the MySQL database and SMTP settings.
Domain / Subdomain 
Domain: http://workflow.management.dingoresult.com/
Document root (web root) must point to the contents of the project's public/

MySQL Credentials (fill password on server) 
- Database name: dingores_workmanagement
- Username: dingores_admin
- Password: (FILL IN PASSWORD ON SERVER)
- Host: localhost

One-time installer (recommended) 
A web installer exists at: https://workflow.management.dingoresult.com/web-installer.php
This installer is protected by the token stored in the file installer.key in the project root.
Installer token (project-generated): 6f2d9a4c8c5e0b7a9f1d2e3c4b5a6d7e
Instructions: create installer.keycontaining the token, then visit the installer URL with the token as query string: ?token=THE_TOKEN. After successful run, DELETE web-installer.phpand installer.keyimmediately.

Step-by-step Deployment 
1. Create the subdomain in cPanel: Domains → Subdomains. Set document root to point to the public/folder (e.g., public_html/workflow.management.dingoresult.com).
2. Create MySQL database: cPanel → MySQL Databases. Create database dingores_workmanagementand assign user dingores_adminwith ALL PRIVILEGES.
3. Upload files: Use File Manager, FTP/SFTP, or Git to upload repository. Place the site so that public/is the web root.
4. Optional (use web-installer): Upload installer.key(with the token) to project root and visit the web-installer URL with token to import schema and write src/config.local.php. Then delete the installer files.
5. Alternatively, import SQL: cPanel → phpMyAdmin → select DB → Import → choose sql/init.sqland run.
6. Configure `src/config.local.php` on the server (preferred) with DB host/name/user/password. Leave this file out of version control. Example (fill DB password):
<?php
return [
  'db' => [
    'driver' => 'mysql',
    'mysql' => [
      'host' => 'localhost',
      'dbname' => 'dingores_workmanagement',
      'user' => 'dingores_admin',
      'pass' => 'PUT_PASSWORD_HERE',
      'charset' => 'utf8mb4',
    ],
  ],
];
?>
7. Install PHP dependencies: If SSH is available, run `composer install --no-dev --optimize-autoloader` in project root. If composer is not available on server, run composer locally and upload `vendor/`.
8. Set file permissions: ensure `uploads/` (and `database/` if using sqlite) is writable by the web server (e.g., 755 or 775 depending on host).
9. Configure SMTP (for email notifications): either set environment variables, or edit `src/config.local.php` SMTP section, or add the following lines to `.htaccess` in `public/`:
SetEnv GMAIL_SMTP_HOST smtp.gmail.com
SetEnv GMAIL_SMTP_PORT 587
SetEnv GMAIL_SMTP_USER your@gmail.com
SetEnv GMAIL_SMTP_PASS your_app_password
SetEnv GMAIL_SMTP_SECURE tls
SetEnv GMAIL_FROM your@gmail.com
SetEnv GMAIL_FROM_NAME "KMC WMS"

10. Enable SSL / AutoSSL in cPanel for the subdomain. Access via HTTPS to avoid browser warnings.

Testing 
- Visit https://workflow.management.dingoresult.com/ and confirm the login page loads.
- Use seeded supervisor account (if installer used) to mark attendance and verify email notifications are received by admin accounts.
- Upload a GPS CSV (format: vehicle_id,lat,lon,ts) via the GPS Upload page and verify entries appear in GPS Reports.

Security reminders 
- Delete `web-installer.php` and `installer.key` after use.
- Do NOT commit `src/config.local.php` or `installer.key` to Git.
- Rotate DB password if it was publicly shared.

Checklist (for hosting team) 
[ ] Create subdomain and set document root to public/
[ ] Create DB `dingores_workmanagement` and assign `dingores_admin`
[ ] Upload code and install composer or upload `vendor/`
[ ] Run web-installer/import SQL file
[ ] Configure `src/config.local.php` and SMTP
[ ] Ensure `uploads/` is writable
[ ] Enable SSL and test site

Notes 
If you want, I can produce a Microsoft Word `.docx` version of this file or a PDF. I intentionally left the DB password blank — tell me if you'd like the password embedded in the delivered document (not recommended) and I can provide a version that includes it for you to download locally.