PROJECT FILE · 2026 · ADS PHP

Ads PlatformMulti-Platform Ad Management

Eight arms, one console for 28 ad platforms

A management system for multi-platform advertising that connects 15 domestic and 13…

AboutAds Platform

WHO IT'S FOR

Ad operations teamsAdvertising agenciesCross-border advertisersMulti-tenant operators
PHP 8.4+webman 2MySQL 8.0Redis 7Redis QueueVue 3TypeScriptFlutterHarmonyOS ArkTS

A management system for multi-platform advertising that connects 15 domestic and 13 international ad platforms, covering account authorization, campaign and ad group management, plus creative list and detail, cross-platform reporting, automated bidding, budget alerts and notifications, so media teams can run every channel from one console.

The backend runs on webman 2 and PHP 8.4, split into 8 business plugins with 91 API routes and 33 tables for cross-platform metrics. A Vue 3 admin console, Flutter app and HarmonyOS app share the same API, backed by three-tier caching, platform circuit breakers and 22 security controls.

A typical day starts with platform account authorization, then campaigns, creatives and budgets are set up. The system dispatches an asynchronous sync queue every 10 minutes and rolls data into reports, warns before budgets hit thresholds, and pushes exceptions to chat channels, leaving operators to handle only what needs human judgment.

The engineering choice is a plugin-based monolith rather than microservices: 8 plugins share one webman process and data layer, keeping deployment cheap and transaction boundaries clear. A single adapter contract means new channels touch one place, while three-tier caching and circuit breakers keep external platform instability out of the business layer.

28Ad Platforms
91API Routes
8Business Plugins
12Scheduled Jobs
22Security Controls
733Automated Tests

Open Source vs Full, feature by feature

Open Source v4.1.0 and Full v3.8.0 share the 28 platform adapters and the core security baseline. Counts come from the current code, routes and install script.

Left: Open Source / Right: Full

5 / 8business plugins
10 / 26controllers
28 / 91API routes
8 / 33database tables
6 / 26admin pages
28 / 28platform adapters
CapabilityOpen Source v4.1.0Full v3.8.0

Engineering scale

Business pluginsOSS5Full8
ControllersOSS10Full26
API routesOSS28Full91
Database tablesOSS8Full33
Admin pagesOSS6Full26
Scheduled tasksOSS3Full12
Platform adaptersOSS28Full28
Service PHP linesOSS14.1kFull18.8k
Test casesOSS175Full733
DocsOSS15Full78

Accounts and delivery

OAuth authorizationOSSYesFullYes
Data sync (every 10 min)OSSYesFullYes
DashboardOSS8 KPIFull8 KPI + report views
CampaignsOSSRead-only listFullCRUD + pause/enable + batch
Ad groupsOSSNo management APIFullCRUD + pause/enable
CreativesOSSNo management APIFullList + detail
Asset libraryOSSUpload + galleryFullUpload + gallery + presign
Asset storageOSSLocal diskFullLocal + OSS/COS/S3
CDN providersOSSNoneFullMulti-provider + purge

Reporting and attribution

Metric rollupsOSSYesFullYes
Custom reportsOSSNoneFullMulti-dimensional + filters
ExportOSSNoneFullCSV/Excel/PDF + dashboard PDF + streaming download
Scheduled reportsOSSNoneFullFrequency + email/webhook
Report rollupsOSSNoneFullRollup + retention policy
CSV importOSSNoneFullFallback for platforms without an API
AttributionOSSNoneFull5 models + 30-day lookback
Budget alertsOSSNoneFull50/80/100% stages
Delivery calendarOSSNoneFullGantt calendar

Automation and operations

Alert rulesOSSNoneFullRules + logs
Notification centerOSSNoneFullIn-app + email + webhook
Automated biddingOSSNoneFullRules + execution logs
Targeting templatesOSSNoneFullCRUD
Conversion APIOSSNoneFullWrite + query
Multi-tenantOSSSingle tenantFullTenant CRUD + isolation + status + rate limit
Tenant quotaOSSNoneFullQuota check + block
Global searchOSSNoneFullMySQL FULLTEXT + LIKE fallback
ObservabilityOSSNoneFullPrometheus /metrics
Backup & restoreOSSNoneFullbackup/restore scripts
API docs pageOSSNoneFull/docs

Clients and security

Admin consoleOSSVue 3FullVue 3
Flutter clientOSSNoneFull12 pages
HarmonyOS clientOSSNoneFull6 pages
Admin accountsOSSSingle admin .envFullRBAC + user management
Audit logOSSNoneFullOperation audit
Two-factor authOSSNoneFullTOTP + recovery codes
SecurityOSS22 controlsFull22 controls + tenant isolation / RBAC / audit

License and version

LicenseOSSPersonal study / research, commercial needs written permissionFullStandard / Full commercial license
Version lineOSSv4.1.xFullv3.8.x
RepositoryOSSPublicFullPrivate delivery

Routes include installer and health checks; tables include the webman-admin framework tables; tests are PHPUnit test methods (Full: 733 — 575 Unit + 158 Integration); the two version lines are independent.

Report adapter support: 22 of 28 adapters use documented report endpoints with per-row dates; 6 have no public or verifiable report API and are explicitly unsupported.

License

Open Source is public for personal study and research; commercial use needs written permission. Full ships under Standard or Full commercial licenses. Contact erik@erik.xyz.

Features built for real scenarios

Core capabilities of the current release; see the changelog for the full history.

01SmileMulti-Platform Ads

OAuth for 28 ad platforms, plus cross-platform campaign and ad group management; creative list and detail.

02JoyCross-Platform Reports

Metric rollups, CSV import/CSV/Excel/PDF export and 5-model cross-platform attribution.

03CryAutomated Bidding

Rules adjust budgets and pause/enable ads; three-stage alerts at 50/80/100% of daily budget.

04DepressedAlert Rule Engine

Custom threshold rules, multi-channel delivery and a 5-minute inspection cycle.

05TerrifiedDelivery Calendar

Cross-platform Gantt view of monthly and weekly schedules, colored by platform.

06AngryCreative CDN

Image and video library with local/OSS/COS/S3 drivers and CDN acceleration.

07CoquettishResilient Calls

Per-platform circuit breakers, fast-fail fallback and timeout checks keep sync stable.

08CuteMulti-Client Access

Vue 3 admin, Flutter and HarmonyOS clients share one API.

09PleasingAsync Sync Queue

Per-account Redis queue jobs with four consumers and an account lock; manual sync returns 202 with a run record.

10KnockingScheduled Reports

Generate CSV on a schedule and deliver by email or webhook; old metrics roll up under a configurable retention policy.

11FacepalmTenant Governance & 2FA

Tenant CRUD, status enforcement and per-minute rate limits; TOTP two-factor auth with one-time recovery codes.

12TongueObservability & Backup

Prometheus /metrics, global SQL search, database backup/restore scripts and export file cleanup.

← Swipe to explore →

Feature overview
README FigureFeature overview

One system, two perspectives

The admin console runs operations and governance; the client delivers the user experience. Both share the same business and permission boundaries.

ADMIN

Admin Console

  • Dashboard

    Cross-platform KPI overview, trend charts, global search and data export.

  • Account Management

    Platform account binding, OAuth authorization, async sync status and run history.

  • Campaign Management

    Create, pause/enable and bulk-edit campaigns and ad groups; creative list and detail.

  • Report Center

    Custom and scheduled reports, CSV import, attribution analysis and streaming export.

  • Alert Center

    Rule configuration, alert records, acknowledgement and notification center.

  • Assets & CDN

    Creative uploads, gallery previews and object-storage provider settings.

  • System Settings

    Users, roles, audit logs, tenants, 2FA and system configuration.

  • Tenants & Security

    Tenant CRUD/status/rate limits, TOTP 2FA and recovery codes.

CLIENT

Mobile Client

  • Login & Auth

    Account login, token refresh and multi-device session management.

  • Data Overview

    View core metrics and platform delivery summaries on mobile.

  • Campaign Viewer

    Browse campaign, ad group and creative lists with details.

  • Report Browser

    Review reports and trend charts by platform and date.

  • Alert Notifications

    Receive alert pushes and view notification details.

  • Account Sync

    Check platform authorization status and sync results.

From the current release to the next

Delivered, in-progress and planned milestones, based on the real development stages.

Phase 1

Foundation

webman service, admin console and the 33-table data model delivered.

Done
Phase 2

Platform Integration

28 ad platform adapters and OAuth account authorization completed.

Done
Phase 3

Campaigns & Reports

Campaign and ad group management, creative list/detail, plus cross-platform reports and export.

Done
Phase 4

Monitoring & Alerts

Alert rules, budget warnings and 12 scheduled jobs in production.

Done
Phase 5

Multi-Client & Security

Vue 3 admin, Flutter client and 22 security controls delivered.

Done
Phase 6

HarmonyOS Polish

6 HarmonyOS pages and the HTTP client are ready; remaining work continues.

In progress

Structure determines how far it can go

Three-tier architecture: the service exposes 91 /api/v1 routes, admin runs as a separate console, and Vue 3, Flutter and HarmonyOS clients share one API. Business logic is split across 8 webman plugins, connecting external platforms through 28 adapters, a report engine and Redis queues.

L01
Client LayerVue 3 · Flutter · HarmonyOS ArkTS

Admin console, desktop/mobile apps and HarmonyOS share the business API.

L02
Access LayerNginx · CORS · JWT · RateLimit

Path routing, authentication, rate limiting and security headers.

L03
Business Layerwebman 2 · 8 plugins · 91 API routes

Account, campaign, report, alert and job plugins work in parallel.

L04
Adapter Layer28 platform adapters · Circuit breaker · Fallback

Unified access to domestic and global ad platforms with timeout and retry handling.

L05
Data LayerMySQL 8.0 · Redis 7 · SQL Search

33 tables hold business data; three-tier cache, Redis queues and FULLTEXT ngram search (LIKE fallback) serve queries.

Ads Platform system architecture
View full size ↗ · System Architecture
Backend
PHP 8.4+webman 2webman-admin 2
Data
MySQL 8.0Redis 7Redis Queue
Frontend
Vue 3TypeScriptElement PlusECharts
Clients
FlutterDart 3HarmonyOS ArkTS
MODULE MAP
Account AuthorizationPlatform AdaptersCampaign ManagementReports & AttributionAutomated BiddingBudget AlertsDelivery CalendarAssets & CDNAlert NotificationsMulti-TenancyGlobal SearchScheduled ReportsTwo-Factor AuthScheduled JobsSystem Management

Security is not an afterthought

From boundaries and identity to data and failure, every layer is designed around zero trust.

Authentication

24-hour JWT with refresh rotation; tokens bound to IP and user agent; TOTP two-factor auth and recovery codes for admins.

Layered Middleware

14 global middleware layers in service and 10 in admin validate every request; tenant rate limits return 429.

Attack Protection

Pattern detection for XSS, path traversal, header injection and SQL injection.

Login Protection

5 failed attempts lock for 15 minutes; at most 3 concurrent session tokens.

Data Encryption

Transport encryption plus field-level database encryption; logs are redacted.

Audit Trail

Records IP, user agent, client platform and operation details for auditing.

Zero trust · Least privilege · Auditable end to end

Trade-offs before code

From business boundaries to code boundaries, these are the principles this project keeps returning to.

01

Plugin Monolith

Business logic split into 8 webman plugins sharing one process and data layer, avoiding premature microservices.

02

Unified Adapters

28 platforms implement one adapter contract; a new channel only needs an adapter and configuration.

03

Tiered Caching

L1 memory, L2 APCu and L3 Redis are layered by hit cost, keeping hot data out of the database.

04

Async Peak Shaving

webman/redis-queue dispatches per-account sync jobs, with exports and notifications handled asynchronously.

Azhang expression Smile

Azhang

A blue octopus whose eight arms each run a domain, mirroring 8 plugins and 28 platforms collecting in parallel.

Get it running

A condensed path from the README to a minimal working environment.

PHP 8.4+MySQL 8.0Redis 7Composer
01
Install Dependencies

Install Composer dependencies for the service and admin apps.

cd service && composer install && cd ../admin && composer install && cd ..
02
Start Admin

Start the admin instance; it listens on port 8789 by default.

cd admin && php start.php start
03
Open Setup Wizard

Visit /install in a browser and enter the database connection details.

http://localhost:8789/install
04
Run Installation

The wizard creates the database, imports install.sql and seeds data.

05
Sign In

Use the administrator account set during installation to open the console.

Docker Compose single-host deployment

MySQL, Redis, service, admin and nginx run in separate containers; only nginx exposes 80/443, and the database/cache publish no host ports. Redis is also a required dependency for the async sync queue.

./scripts/docker-up.sh

The script generates database/Redis/admin passwords, JWT/encryption keys and a self-signed certificate into the local .secrets/ and .env. Existing values are reused; --regenerate archives them before rotating. Open https://localhost; the admin credentials are printed or available in .env. In production set METRICS_TOKEN to expose /metrics, and use ./scripts/backup.sh / ./scripts/restore.sh --yes for database backup and restore.

Full guide: docs/docker.en.md (secrets, certificates, profile-based deployment, logs/cache, upgrades and troubleshooting).

CI runs manually in GitHub Actions via workflow_dispatch; pushing a v*.*.* tag triggers the release workflow.

Upgrading to v3.6.0 · Breaking changes
  • v3.6.0 migrations: in a maintenance window run, in README order, ads-account/add_last_structure_sync_at.sql, ads-platform/add_search_indexes.sql, ads-report/add_report_indexes.sql, ads-report/create_report_schedules.sql, ads-report/create_report_rollups.sql, ads-task/add_sync_runs.sql, ads-tenant/add_admin_totp.sql and ads-tenant/add_tenant_rate_limit.sql, then ads-account/disable_sogou_accounts.sql.
  • Redis queue: Redis now also backs the async sync queue; make sure SyncQueueProcess starts with the service. Manual sync returns 202; an unavailable queue returns 503.
  • Sogou removed: the Sogou adapter is gone; the upgrade migration disables Sogou accounts and keeps historical reports.
  • v3.5.1 Docker: no new breaking changes; run ./scripts/docker-secrets.sh before upgrading. Existing values are preserved and only missing secrets, certificates and the admin seed SQL are added.
  • Sign in again: JWT audiences are split and a shared cross-plane blacklist is enabled, so all existing tokens are invalid.
  • OAuth redirects: OAUTH_ALLOWED_REDIRECTS is default-deny; configure the allow-list in service/.env.
  • Multi-container: set a unique SNOWFLAKE_WORKER_ID (0–1023) per instance to avoid primary-key collisions.
  • Run migrations first: in a maintenance window, run service/plugin/ads-task/migration/fix_report_metrics_natural_key.sql and service/plugin/ads-report/migration/fix_attribution_results_unique_key.sql before deploying; they deduplicate and rebuild natural/unique keys.

From first login to a full run

A minimal operating path covering admin setup, client usage and key APIs.

01Sign In

Open the admin URL and sign in with the account created during installation.

02Authorize Accounts

Add an ad platform in Account Management and complete OAuth.

03Create a Campaign

Pick a platform and account, then create a campaign, ad group and attach creatives.

04View Reports

Filter metrics by date and platform, create scheduled reports, then export CSV/Excel/PDF.

05Configure Alerts

Set metric thresholds and delivery channels; the system checks every 5 minutes.

06API Docs

Start the service and open hg/apidoc to explore the API.

http://127.0.0.1:8788/apidoc
07Schedule Reports

Set frequency, timezone and recipients; CSV is delivered by email or webhook.

08Security & Observability

Enable TOTP 2FA in security settings; use /metrics and backup scripts for operations.

Every iteration leaves a trace

Latest v3.8.0; releases keep coming.

v3.8.0

Merged all dependabot branches and deleted historical branches; refreshed ECharts 6.1, vue-echarts 8.3, Element Plus 2.14.7, Pinia 4.1, /node 26.6; docs now Chinese/English only (Portuguese tooling removed); 733 tests.

v3.7.1

Runtime patch: delivery replay lease/exhausted handling, 10s WebSocket auth deadline, full failed-queue scan, rollup CLI packaged in the image; 575 Unit + 158 Integration.

v3.7.0

Durable scheduled report delivery (ads_report_deliveries, ReportDeliveryReaperTask, per-channel idempotency and replay); WebSocket JWT revalidation and auth deadline (revocation takes effect immediately); failed-queue admin fixes (scan past unknown records, scoped clear); FULLTEXT ngram global search (retained); 28 adapters (15 domestic + 13 international, 22 report-capable) and 733 tests (575 Unit + 158 Integration).

v3.6.0

Async sync queue (webman/redis-queue, per-account lock, 202 acceptance); global SQL search, scheduled reports and CSV directory scan; report rollups/retention; tenant CRUD/status/rate limits and admin TOTP 2FA; Prometheus /metrics and backup/restore scripts; 28 adapters (15 domestic + 13 international, Sogou removed, Spotify report-capable) and 659 tests (508 Unit + 151 Integration).

v3.5.1

Docker Compose deployment: generated/rotated secrets, accounts and certificates; Redis auth, HTTPS, log rotation, read-only roots and multi-stage images (service 216 MB / admin 156 MB); new docs/docker.en.md.

v3.5.0

Security hardening: split JWT audiences with a shared cross-plane blacklist and default-deny OAuth redirects; report date contract and pagination fixes; Flutter/admin client fixes; Docker and installer fixes; 531 tests.

v3.4.3

Docs trimmed to Chinese and English; site copy, SEO and 404 polish.

v3.4.2

Added AGENTS.md.

v3.4.1

API documentation refresh: refresh tokens and HTML dashboard export.

v3.4.0

Security audit fixes, tenant isolation, release pipeline and dependency refresh.

v3.3.0

CI fully green, minimum PHP raised to 8.4 and install.sql columns added.

v3.2.0

Project mascot changed to the octopus Azhang.

v3.1.0

Project mascot owl added, 13-language docs synced and project tree corrected.

v3.0.0

API version moved into the /api/v1 route path instead of a header.

v2.2.0

All money math migrated to bcmath; report ratios computed in PHP.