# Implementation and validation

Implemented locally on 17 November 2026, Asia/Dhaka.

## Stack and separation

- Laravel 13, PHP, React 19, Vite 7, existing Tailwind 3/Radix-style UI.
- MySQL 8 at 127.0.0.1:3306; application database `house_project_clone`.
- Independent MySQL test database `house_project_clone_test`.
- Admin UI :2100, tenant UI :3100, API :8000, Reverb :8080.
- Original source applications and their MongoDB database remain separate.

## Completed modules

Admin/tenant session login, Remember me, signup/OTP, password reset/change, profiles and photos; houses and attachments; tenant approval/house/rent/deposit assignment; monthly ledgers and due reports; proof submission and approval/rejection; rewards; complaints; jobs; expenses/categories; dashboards; notifications/preferences/custom notifications; SMTP/SMS/rent/branding settings; to-do calendar/reminders; conversation history, unread state, private-channel realtime messaging, typing and online presence; database queue and scheduler.

All 115 original router endpoints have corresponding role-scoped Laravel routes. Additional routes handle private assets, realtime authorization/events and user access to the former shared chat service. The tests retain the original route contract list in `tests/Fixtures/legacy-api-routes.json`.

## Findings addressed

- Tenant-owned records and chat operations enforce account ownership.
- Profile edits preserve an accepted tenant's approval status.
- Reward discounts are included when updating an existing ledger.
- Approval/ledger/reward updates run in a MySQL transaction with row locks and unique constraints; repeat approval cannot credit twice.
- Approved payments cannot be rejected/deleted by the pending-payment actions.
- Expense amount changes persist.
- Ledger generation uses the configured due day, clamped for short months.
- Signup challenges are consumed and reset permission is session-bound with expiry.
- Password/OTP endpoints have throttles; OTP attempts are limited.
- Sidebar DOM warnings and null/undefined form/dashboard values were corrected.
- Original submenu nested anchors were removed through Radix `asChild` composition.
- Remember me is connected to Laravel session authentication.
- The twelve-month activity chart now uses a rolling past twelve-month window.
- Empty sort strings sent by the original list UI are accepted without validation/retry failures.
- Payment proofs are private and verified for embedding from the local React origins.

## Verification evidence

- MySQL migrations completed successfully, including foreign keys, decimal amounts, unique ledgers, pending-payment and reward-earning constraints.
- Expanded suite: 36 passing tests and 244 assertions against isolated MySQL.
- Every original GET API tested with the UI's pagination/empty-search/empty-sort parameters.
- HTTP smoke test: actual session cookies, CSRF headers, twelve admin reads and multipart tenant proof submission.
- Browser: admin and tenant login, session persistence, desktop layouts, mobile sidebar, 43 module/detail/settings routes; route evidence is in `ui-review.json`.
- Browser: tenant message appeared in admin chat, and admin reply appeared in tenant chat through Reverb.
- Browser: demo payment approved; tenant dashboard showed £590 spent, £0 due, reward points reduced from 10 to 0 and next due date moved to the next month.
- Protected proof image successfully loaded in admin payment details.
- No failed queue jobs at the last check; scheduler commands returned idempotent results.
- Both React production builds passed. Pages and the realtime adapter load on demand; large shared bundles remain a performance consideration. PHP and both frontend dependency audits report zero known advisories after compatible updates and removal of unused legacy packages.

## Screenshot evidence

- [User chat](screenshots/user-chat.jpg)
- [Approved demo payment](screenshots/payment-approved.jpg)
- [Tenant dashboard after approval](screenshots/user-dashboard.jpg)
- [Admin dashboard](screenshots/admin-dashboard.jpg)

## Verification limits

The browser file-picker automation disconnected before selecting the proof. The file-upload implementation was instead verified with the real HTTP multipart smoke test and feature tests; browser proof rendering and admin approval were verified separately. No native file-picker end-to-end pass is claimed.

Live SMTP, Voodoo SMS and production hosting are not verified. Local previews were used. The original UI contains chat menu placeholders (Mute/Block) without a backend feature; those remain unavailable. Every possible combination of screen state, validation and responsive size has not been compared pixel-by-pixel. Main lists/due reports now paginate in SQL and dashboard totals use aggregates. Target-server load testing, delivery validation and importing historical MongoDB data remain deployment work.

## Production hardening verification

- Reissued OTP invalidates a previously verified reset grant; password reset revokes an authenticated session.
- Tenant password-change endpoint is correctly mapped, authenticated and functional.
- Queued OTP/message data is encrypted in the jobs table. Provider rejection is not marked as a successful SMS delivery; delivery-log errors redact credentials.
- Payment, notification queue records and audit records are transactional. A notification-recording failure rolls back the financial change.
- Two separate PHP processes start payment approval together against the isolated MySQL test database; only one credits the ledger/redeems points.
- Chat storage/unread state is transactional; encrypted broadcast jobs retry independently of HTTP delivery. SQL joins/pagination bound search/history reads.
- Production frontend build supports `/admin/` and `/tenant/` and configurable WSS. Locally built previews use HTTP/WebSocket explicitly; these are not live HTTPS deployments.
- `php artisan optimize` compiled configuration/routes/events/views successfully; caches were cleared afterwards to preserve local development settings.
- Backup script exported the local clone database/private files to a private temporary directory. Both checksums verified. A new disposable MySQL database restored the dump successfully; tenant/payment/audit counts and the approved payment total matched. The scratch database was removed. No production/offsite restore is claimed.
- All original ports 2000/2001/3000/3001 and clone HTTP ports 2100/3100/8000 returned 200 after the changes; `/health` confirmed MySQL 3306. HTTP session/CSRF smoke checks passed for twelve admin reads.
- `house:production-check` intentionally fails on the local demo environment: HTTP/debug/demo accounts/root MySQL/local delivery/no live SMTP remain local settings. Production templates and Nginx/Supervisor/cron configuration are supplied but have not been installed on a target server.

- Refreshed built SPA deep links now return their correct HTML; missing JS assets still return 404. PHP development-server base-path inference is corrected when it sees a nested SPA index.html. The real HTTP smoke covers both application deep links and rejects a login without CSRF (419).

- Browser verification caught and corrected the paginated chat presence cache shape. Admin chat presence now updates in infinite-query pages and refreshes stale online state. Failed/disconnected sends keep the draft; concurrent send clicks are suppressed while a request is pending. API clients have finite timeouts and return revoked sessions to sign-in.

- Private-file backup restore also passed: eight archived files were extracted to a temporary directory and their hashes matched source files still present.
- The test bootstrap validates the resolved MySQL connection before migrations, including URL overrides, and refuses any database other than local `house_project_clone_test`. A negative check used an intentionally nonexistent disposable database and was refused before migrations. The application database was not used for the negative test.

- Final built UI browser check: the tenant message arrived in admin chat, the admin reply appeared in tenant chat, and the admin presence label showed Online. No console errors were captured in either final view. Screenshot: [built tenant chat](screenshots/production-chat.jpg).
