LAUNDRYHUB FULL ERP - CPANEL NODE.JS + MYSQL
============================================
This is a full-stack application package (server API + database schema + blue/white browser UI). It is a deployable starting system and must be configured and tested in your hosting before use with live customer data.

INCLUDED
- Secure password hashing (bcrypt), login/logout, session cookies, owner/manager/staff roles
- Owner first-run setup (only while users table is empty)
- Dashboard KPIs: daily orders/collections, ready and processing orders, outstanding balances, month sales/expenses
- Customers, service/pricing catalog, orders with line items and due dates
- Order status workflow and status history
- Payment entries with balance calculations and overpayment validation
- Printable order receipts
- WhatsApp click-to-chat message drafts when status changes to Ready for Pickup, Out for Delivery, or Delivered; includes outstanding balance
- Staff accounts and activation/deactivation
- Inventory and reorder alerts, expenses, reports, business settings, order CSV export
- MySQL schema and cPanel configuration notes

IMPORTANT LIMITATIONS / PRODUCTION CHECKLIST
1. This package has not been deployed or tested on your specific cPanel account. Verify install and logs there.
2. WhatsApp messages are prepared for staff to review/send through WhatsApp. Automatic outbound messaging requires official WhatsApp Business Platform setup, customer opt-in, approved templates where applicable, valid phone-number ID/token, and server-side integration. This package intentionally does not claim automated sending.
3. Set a strong SESSION_SECRET and database credentials in cPanel Environment Variables. Never put secrets in public files or send them in chat.
4. Use HTTPS. Set NODE_ENV=production. Restrict the application root outside public_html if your host permits, and make sure only the public folder is web-accessible through Express.
5. Configure database backups and test restoration before production. Add rate limiting, CSRF protections, account recovery, audit/retention policy, and provider-specific hardening before broad commercial use.
6. Review applicable Ghana data protection and tax obligations; this software does not provide legal or tax advice.

CPANEL SETUP
A. Create a MySQL database and a dedicated database user in cPanel. Grant that user privileges on this database. Keep the prefixed full database name/user.
B. In phpMyAdmin, select the database and Import sql/schema.sql.
C. In cPanel Setup Node.js App, create/select Node 22.x. Set application root to a private folder such as laundryhub_app (not directly inside a publicly browsable folder if avoidable). Startup file: app.js. App URL: your chosen subdomain.
D. Upload/extract this package into the application root so app.js and package.json are at its top level. public/index.html should be under public/.
E. Set cPanel application Environment Variables:
   DB_HOST=localhost (ask hosting support if different)
   DB_PORT=3306
   DB_NAME=FULL_CPANEL_PREFIX_DATABASE
   DB_USER=FULL_CPANEL_PREFIX_DBUSER
   DB_PASSWORD=your strong database password
   SESSION_SECRET=long random secret (at least 32 random characters)
   NODE_ENV=production
   APP_URL=https://your-erp-domain
   PORT is normally supplied by cPanel; if not, use the port cPanel documents.
F. Click Run NPM Install. Restart the application.
G. Visit https://your-erp-domain. First run will offer owner setup if no users exist. Create a unique owner account with a long password.
H. Test with fictional data first. Verify /api/health shows database connected (do not publish this endpoint if your host requires stricter access control).

WHATSAPP AUTOMATION
For actual automatic send, implement the WhatsApp Cloud API server-side using approved Meta business assets and opt-in. Never put the token in index.html. Use template messages as required by Meta's current policy and persist send results in a notification log table. This package currently offers WhatsApp click-to-chat after a status change, not unattended delivery.

No default login is included. The first owner account is created through the first-run setup screen.
