# cake.admedia.com — repo context

> Curated overview for code_search. Source: CodeIgniter 4 controllers + Views.

## Purpose
**Advertiser & affiliate reporting portal** built on **CodeIgniter 4** (PHP).
Server-rendered pages for dashboards, affiliate/advertiser stats, and postback
tooling. Login-gated (see `Users::auth`).

## Controllers (top-level features)
- **Home** — dashboards & reports (the main working area)
- **Advertiser** — advertiser-facing views/reports
- **Affiliate** — affiliate stats & reports
- **Users** — login / authentication (`auth()`, `UserModel`, login tracking)

## Left-panel menu ("Affiliate Reporting" sidebar, from `app/Views/layouts/main.php`)
Each item is access-gated via `Access(...)`:
- **Affiliate Dashboard**
- **AM & BD Earning Performance**
- **Advertiser Dashboard**
- **CPA Publisher Metrics**
- **Rdr2 Traffic**
- **Amzn-Ad Traffic**
- **Rdr3 Traffic (deeplink)**
- **Datafeed Traffic**
- **Postback Report**
- **Click Stats**
- **Pub Ref Report**
- **Zero Traffic**
- **Postback Link Testing**
- **Logout**

## Backing views (`app/Views`)
- Dashboards: `home/dashboard`, `home/advertiser_dashboard`, `home/am_bd_earning_dashboard`
- Affiliate stats: `aff_stats`, `date_ranged_aff_stats`, `aff_click_stats`, `detailed_data`
- Postback: `aff_postback_report`, `postback_link_testing`
- Traffic: `datafeed_traffic`, `rdr2_traffic`, `rdr3_traffic`, `zero_traffic`
- Other: `cpa_pub` (CPA publisher), `ad_copy`, `amzn_ad`

## Key files
- `html/app/Controllers/Users.php` — `auth()` login flow
- `html/app/Models/UserModel.php` — `portal_users`, `getAuthUser`
- `html/app/Controllers/{Advertiser,Affiliate,Home}.php` — feature controllers
- `html/app/Config/` — CSP, constants, framework config

## Tech
CodeIgniter 4 (PHP), MySQL, server-rendered views. First-party code lives under
`html/app/` (the large `html/vendor/` tree is third-party — excluded from indexing).
