# search.com — repo context

> Curated overview for code_search. Source: `bitbucket_server:AD/search.com` (Bitbucket, project AD). CodeIgniter 4 / PHP. Default branch `master`.

## Purpose
The consumer-facing **search.com** web app: an AI-assistant portal (a suite of "GPT" products) plus a cashback/deals program, a publisher program, and productivity integrations. Server-rendered CodeIgniter 4. Heavy integration/API work is proxied to the sibling **api.search.com** service (`bitbucket_server:AD/api.search.com`) — this repo is mostly UI + thin proxy controllers.

## Structure
- `html/` — the CodeIgniter 4 app (web root is `html/public/`).
  - `app/Controllers/` — feature controllers (map below).
  - `app/Models/` — `AdModel`, `ApiTokenModel`, `LibraryModel`, `PublisherModel`.
  - `app/Config/Routes.php` — routing. **Auto-route is ON**, so a URL can map to a `Controller::method` with no explicit line here; explicit routes/groups also exist.
  - `app/Views/`, `app/Libraries/`, `app/Helpers/`, `app/Filters/`, `app/Database/`, `app/Language/`.
  - `system/` — the CI4 **framework** itself (vendored; ignore when reasoning about app logic).
- `mygptdev/` — standalone `assets/`, `includes/`, `code.php`, `preview.php` for the "My GPT Developer" code-gen / preview feature.

## Feature map (controller → area)
- **Auth / onboarding / account** — `Auth`, `Onboarding`, `User`: sign-in/up, social + phone/OTP, extension login, pricing/plan select, billing & subscription, chat history.
- **Core chat** — `Auth::index` serves `/` and `/chat`; also `explore_gpt`, `style_gpt`, `face_gpt`.
- **AI "GPT" verticals** (each its own controller + route group): `Astrogpt` (`/astro-gpt`), `Designgpt` (`/designgpt` — interior/exterior/garden), `Imaginegpt` (`/imagine_gpt`, video), `Imagegpt` (`/improve-image-gpt`), `Drmdgpt` (`/dr-gpt-md`), `Musicgpt` (`/gpt-music-dj`), `Financegpt` (`/finance` — crypto/earnings/predictions/screeners/watchlist), `Mygptdev` (`/my-gpt-developer` — project generation + workspace), `StockController` (`/stocks`, `/stock`).
- **Cashback / deals** — `Cashback`: `/deals`, store `/search`, payout, withdraw, coins, referrals, perks.
- **Publishers** — `Publishers` + `Api\Publisher`: offerings, sign-up, API reference, `/widget`, `/co-branded`, `/api/generate_content`, API-token generation.
- **Spaces / drive / library** — `Space` (collaborative spaces + sharing), `Searchbox` (`/search-box` — drive, shared-with-me, trash), `Library` (image library / favorites).
- **Productivity integrations** — OAuth install/status/uninstall under `/plugins/*`, UI proxying to api.search.com: `Slack`, `Confluence`, `Jira`, `Figma`, `Bitbucket`, `Gcal`; plus a full `Gmail` mailbox under `/gmail` (inbox, send/reply/forward, drafts, summarize, categories).
- **Other products / marketing** — `Attestpath` (`/attestpath`), `Products` (product-details / lander redirects), `SocialImpact`, `Home` (careers, rewards, blog, news, about, privacy, terms, browser/extension landings), `Sitemap` (XML sitemaps).

## Search notes
- App logic lives under `html/app/`. **Ignore `html/system/`** (CI4 framework) and any `vendor/` — they're not this app's code.
- For real OAuth/token exchange or the underlying integration/data APIs, the substance is usually in **api.search.com**, not here (these controllers mostly render UI and proxy).
- Because auto-routing is enabled, don't assume a feature is absent just because it has no explicit line in `Routes.php`.

## Tech
CodeIgniter 4 · PHP 7.3/8.x · MySQL (mysqlnd). Companion services: `api.search.com` (backend), `publishers.search.com`, `ai_manager.search.com`, `connect.search.com`.
