This application gives the editorial team a single-page operations console for harvesting outside sources, enriching them with keywords, preventing duplicates, and mirroring select content from WordPress. The stack is intentionally minimal: plain PHP 8 for every server concern and a vanilla JavaScript frontend served from index.html.
Config::getAdminLogin() protect every API request via includes/init.php; the SPA stores credentials in localStorage and attaches them to each /api call. Public Slack endpoints opt out via IS_PUBLIC_API./api/*.php endpoints boot through init.php, which wires configuration, database access, and feature toggles (for example the ONLINE constant that can gate requests).includes/model.php boots a MySQL schema at runtime using the DB_SCHEMA SQL string so developers do not run migrations manually.WordPressConfig in includes/config-schema.php knows how to backfill posts from the remote WP site while tagging authors, categories, tags, and derived keywords.| Path | Description |
| — | — |
| index.html | Serves the SPA shell (styles.css, main.js). |
| main.js | Implements the entire frontend (routing, UI state, API calls, WordPress helpers). |
| styles.css | Default styling for the dashboard (Flexbox layout, panels, chips, etc.). |
| includes/ | Configuration schema + defaults, bootstrap (init.php), ORM-like Model, WordPress helpers, and cron utilities. |
| api/ | Thin endpoint scripts that validate inputs and dispatch to Model methods. |
| docs/ | Documentation set (this file plus backend, frontend, and operations guides). |
index.html.main.js), pulling /api/users.php to hydrate appState.users, reading the cached author id and Basic Auth credentials from localStorage, and mounting hash-based routes./api/crawl.php./api/detect-keywords.php, stores suggested keywords/title, and forces /api/sources.php duplicate checks./api/sources.php creates the record, kicks the Slack webhook, and enforces rate limits (WORKING_SOURCES_LIMIT)./api/sources.php, /api/search-sources.php, /api/keywords.php, /api/keyword-counts.php, etc./api/cron.php or CLI backfill scripts that call WordPressConfig::back_fill(), persist posts, and detect keywords per post. New WordPress posts can also trigger background fact/editorial checks./api/wp-post.php+/api/search-keywords.php and displays titles via the decoding helper introduced in main.js (resolveWordPressTitle).docs/backend.md — Database, server bootstrap, Model, and endpoint specifics.docs/frontend.md — SPA architecture, routes, and UI behaviors.docs/operations.md — Setup, configuration, cron/backfill jobs, and external service notes.