TRUESHIELD DOCUMENT MAKER SYSTEM - MYSQL SECURE VERSION v10

UPLOAD TARGET
/public_html/trueshield/

OPEN URL
https://test.skillydonsolutions.co.ke/trueshield/

IMPORTANT: Make sure SSL is active on the subdomain before testing. The .htaccess forces HTTPS for security.

FILES
- index.html: main system UI
- login.php: login page
- css/styles.css: system styling
- js/app.js: frontend logic
- api/auth.php: login/logout/password API
- api/documents.php: document database API
- api/bootstrap.php: security/session/database bootstrap
- config/database.php: cPanel MySQL credentials
- database.sql: fresh installation database schema
- upgrade_v9_to_v10.sql: run only if you already imported the earlier v9 schema

DEFAULT LOGIN
Username: admin
Password: TrueShield@2026

CHANGE THIS PASSWORD IMMEDIATELY after first login.

SETUP STEPS
1. In cPanel, create a MySQL database and database user.
2. Assign the user ALL PRIVILEGES to that database.
3. Edit config/database.php with the exact cPanel DB name, DB user, and password.
4. In phpMyAdmin, import database.sql for a fresh database.
   If the earlier v9 database already exists, run upgrade_v9_to_v10.sql instead.
5. Upload all files to public_html/trueshield/.
6. Open https://test.skillydonsolutions.co.ke/trueshield/.
7. Login with the default account, then change the password.

SECURITY NOTES
- The system now requires login before accessing document APIs.
- Document history is saved in MySQL.
- History has pagination and no total record cap.
- Server-side input cleaning is applied.
- Server-side totals are recalculated.
- CSRF protection is enabled for save/delete/password change.
- Internal PHP errors are logged on the server, not shown to users.
- install.php has been removed from this production ZIP.
- Do not upload ZIP files, SQL backups, or credentials into the public folder.

DOCUMENT NUMBERING
- Automatic numbering still works.
- If a manually typed document number already exists for the same document type, the system now rejects it instead of silently changing it.

NEXT RECOMMENDED PHASE
- Password-change page is included at change-password.php.
- Add full user management if more staff will use the system.
- Add backup/export controls.
