-- Titles (movies/TV) CREATE TABLE titles ( id BIGINT PRIMARY KEY, title VARCHAR(255) NOT NULL, year INT, runtime_min INT, genre VARCHAR(100), director VARCHAR(255), rating DECIMAL(2,1), license_expires DATE, ... );
– All site visitors (guest users) and registered members (free or premium).
-- Recommendation feedback CREATE TABLE rec_feedback ( user_id BIGINT, title_id BIGINT, feedback ENUM('like','dislike','not_interested') NOT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (user_id, title_id) ); Guest lists are stored client‑side; on login, the front‑end merges the local list into user_watch_later (deduping by title_id ). | Method | Endpoint | Auth | Description | |--------|----------|------|-------------| | POST | /api/watchlater | JWT (optional) | Body titleId → add. If no token → store in cookie/localStorage. | | DELETE | /api/watchlater/:titleId | JWT (optional) | Remove entry. | | GET | /api/watchlater | JWT (optional) | Return list (merged server + client for guests). | | GET | /api/recommendations?limit=10 | JWT (optional) | Return personalized titles. | | POST | /api/rec/feedback | JWT | Body titleId, feedback – record user reaction. | | POST | /api/notifications/subscribe | JWT | Register Web Push subscription. | | GET | /admin/analytics/watchlater | Admin token | JSON stats. |