# Media Recording App Review and Recommendations

## Current Operational Strengths

- One database remains the source of truth for web, PWA, future API, and future mobile app work.
- Resource status is centralized through `updateResourceStatuses()` and checks both scheduled recordings and daily recording instances.
- Superadmin has recovery controls for wrongly started, completed, cancelled, archived, or deleted operational records.
- Linked-room recording support exists for hybrid rooms through `recording_room_links`.
- Cameraman portal supports assigned recordings, attendance, unscheduled requests when enabled, mobile navigation, and helper visibility.
- Reports, calendar, resource lookup, free/busy slots, alerts, notifications, activity timeline, backup tools, and CSV tools are linked from the dashboard.
- PWA assets and service worker support installable phone usage without duplicating business logic.

## Changes Added in Step 26

- In-app messages for superadmin, admins, and cameramen.
- Broadcast messaging to all admins or all cameramen.
- Per-user message read receipts so one user does not mark a broadcast message read for everyone.
- Recording reminders with configurable timing before start and after end time.
- Reminder dispatch into app messages and notifications.
- Browser push subscription storage for future Web Push delivery.
- Superadmin helper assignments so a helper cameraman can view selected same-day recordings.
- Step 26 migration and migration order documentation.

## Recommended Next Improvements

- Add a server cron job every 1-5 minutes to run reminder dispatch automatically instead of relying on dashboard/page visits.
- Add a Web Push sender using VAPID keys and a PHP web-push library, then send pending push reminders from the same reminder queue.
- Add role-permission documentation for superadmin, admin, viewer, and cameraman so new staff understand access boundaries.
- Add a daily operations SOP: morning schedule review, attendance check, live resource status check, conflict check, end-of-day incomplete recording review.
- Add automated smoke tests for login, schedule creation, start/complete/cancel, resource release, helper assignment, messages, and reminders.
- Add database backup restore drills before every major migration.
- Add message retention settings so old chat records can be archived without deleting audit history.
- For future Flutter work, keep the PHP helper/business logic as the reference source and expose API endpoints that call equivalent server-side rules.

## Push Notification Readiness

The app now stores browser push subscriptions, but real push delivery needs:

- HTTPS on the production domain.
- `enable_push_notifications = 1`.
- A VAPID public/private key pair.
- The public key saved in Settings as `push_vapid_public_key`.
- A server-side sender that reads `push_subscriptions` and sends Web Push payloads.

Until the sender is installed, reminders still arrive through in-app messages and normal app notifications.
