1.8 KiB
1.8 KiB
Architecture Overview — Legacy PHP Product Module
Context
This repo holds one legacy PHP module copied from production. The module helps product staff create products and generate SEO text. The module also runs one batch worker that updates OpenCart product descriptions.
Current raw source path was project/new.
Target stable path is project/web/index/new.
SQL dump target path is project/sql/db-25052026.sql.
Main flows
- User opens product form.
- Form reads OpenCart data from MariaDB.
- User can open AI helper page for one product text.
- Bulk page writes product ids into
oc_product_queue. - CLI worker reads queue, calls OpenAI, updates
oc_product_description.
Constraints
- Keep legacy behavior unchanged in layout and config features.
- Preserve file contents during move unless config externalization requires value lookup changes.
- Keep evidence in repo for each design change.
- Do not redesign auth or deploy in these features.
System view
graph TD
U[Backoffice user] --> F[Legacy PHP web module]
F --> DB[(MariaDB / OpenCart)]
F --> Q[oc_product_queue]
W[worker_bulk.php CLI worker] --> Q
W --> AI[OpenAI API]
W --> DB
Files and responsibilities
bootstrap.php: shared local config loader and DB helperconfig/local.example.php: versioned config shapeconfig/local.php: ignored local values fileindex.php: manual product create formdescribe.php: one-shot AI description helperproductos_bulk_update.php: queue intake and worker log viewerproductos_modificados.php: review processed itemsworker_bulk.php: batch generator and DB updaterinc/*: shared layout, prompts, AJAX helpersdb/conn.php: shared DB connection for web pageslogs/*: runtime debug output from worker and AI calls