54 lines
2.5 KiB
Markdown
54 lines
2.5 KiB
Markdown
# adsPRO — Codebase Overview
|
|
|
|
**Generated:** 2026-05-06
|
|
|
|
## What it is
|
|
|
|
adsPRO is a PHP web application for managing **Google Ads**, **Facebook Ads**, and **Google Merchant Center** campaigns. It tracks performance (ROAS, budgets, conversions), manages product feeds, and provides AI-powered suggestions (OpenAI / Claude / Gemini) for product titles and descriptions. UI in Polish, timezone `Europe/Warsaw`.
|
|
|
|
## At a glance
|
|
|
|
| Aspect | Value |
|
|
|---|---|
|
|
| Language | PHP (no framework, custom MVC-like) |
|
|
| Database | MySQL via Medoo ORM (`$mdb`) + RedBeanPHP (`\R::`) in legacy paths |
|
|
| Frontend | jQuery 3.6, Bootstrap 5, DataTables 2.1.7, Highcharts, Select2, FontAwesome 6.5.1 |
|
|
| Build | SCSS → CSS (manual); no Composer, no npm |
|
|
| Tests | None (manual `tmp/debug_*.php` scripts) |
|
|
| CI/CD | None |
|
|
|
|
## Entry points
|
|
|
|
- [index.php](index.php) — main router, autoloader, auth, request dispatch
|
|
- [ajax.php](ajax.php) — AJAX endpoints, session+IP binding
|
|
- [api.php](api.php) — external API endpoints (~1350 lines, RedBeanPHP)
|
|
- [cron.php](cron.php) — legacy cron (task reminders, recurring tasks)
|
|
- `/cron/*` routes (via index.php) — modern cron pipelines
|
|
|
|
## Layered structure
|
|
|
|
- **`autoload/controls/`** — Controllers (static methods, read params via `\S::get()`)
|
|
- **`autoload/factory/`** — Data access (static, uses global `$mdb`)
|
|
- **`autoload/services/`** — External API integrations
|
|
- **`autoload/view/`** — Thin view helpers wrapping `\Tpl::view()`
|
|
- **`templates/{module}/`** — PHP templates accessed via `$this->varName`
|
|
- **`migrations/`** — Numbered SQL files, tracked in `schema_migrations` table
|
|
|
|
## Key base classes
|
|
|
|
| Class | File | Purpose |
|
|
|---|---|---|
|
|
| `\S` | [autoload/class.S.php](autoload/class.S.php) | Params (`get`), session, alerts, email, currency formatting |
|
|
| `\Tpl` | [autoload/class.Tpl.php](autoload/class.Tpl.php) | Template engine (looks in `templates_user/` then `templates/`) |
|
|
| `\DbModel` | [autoload/class.DbModel.php](autoload/class.DbModel.php) | Active Record base |
|
|
| `\Cache` | [autoload/class.Cache.php](autoload/class.Cache.php) | File-based cache in `temp/` |
|
|
|
|
## Documents in this map
|
|
|
|
- [tech-stack.md](tech-stack.md) — language, libraries, versions
|
|
- [architecture.md](architecture.md) — entry points, layers, data flow, modules
|
|
- [integrations.md](integrations.md) — external APIs (Google Ads, Facebook, AI providers, SMTP)
|
|
- [conventions.md](conventions.md) — coding style and patterns
|
|
- [testing.md](testing.md) — testing posture (limited)
|
|
- [concerns.md](concerns.md) — risks, security, tech debt
|