# Phase 0: Infrastructure & Prerequisites

## Timeline: Weeks 0 (Pre-Development)

## 0.1 Development Environment Setup
**Goal:** Consistent, high-performance local development environment mirroring production.

### Tasks
- [ ] **Docker Configuration:**
    - PHP 8.3 container with XDebug and JIT enabled.
    - MySQL 8.0 container.
    - Redis 7.0 container (Object Cache).
    - Mailhog container (Email testing).
- [ ] **Data Seeding Scripts:**
    - `seed-10k.sh`: Generates 10k posts, 5 languages (Dev baseline).
    - `seed-100k.sh`: Generates 100k posts (Performance baseline).
    - `seed-1m.sh`: Generates 1M posts (Stress test).
- [ ] **Repository Setup:**
    - Initialize Git flow.
    - Setup pre-commit hooks (Husky) for linting (PHPCS, ESLint).
    - Configure GitHub Actions for CI (Run tests on PR).

## 0.2 Licensing System Architecture
**Goal:** Robust commercial licensing system ready for Day 1.

### Architecture
- **Server:** Node.js + Fastify + PostgreSQL (Separate repo).
- **Payment:** Stripe Connect integration.
- **Tiers:**
    1.  **Starter ($299/yr):** 1 Site, Core Features.
    2.  **Professional ($999/yr):** 5 Sites, Workflows, Teams.
    3.  **Enterprise ($4,999/yr):** Unlimited, SLA, Audit Logs.

### Tasks
- [ ] Design License Server Database Schema (`licenses`, `activations`, `customers`).
- [ ] Implement API Endpoints:
    - `POST /v1/activate`: Validate key + domain.
    - `POST /v1/check`: Periodic validation (Daily cron).
    - `POST /v1/deactivate`: Release domain.
- [ ] Implement WordPress Client:
    - `LicenseManager` class in `multilingual-press-zone`.
    - Admin Settings page for License Key input.
    - Local caching of license status (transient, 12h).
    - Grace period handling (if server unreachable).

## 0.3 Support Infrastructure
**Goal:** Enterprise-grade support channels.

### Tasks
- [ ] **Ticketing System:** Set up Freshdesk or Zendesk.
    - Define "Priority" tags based on License Tier.
    - Configure email routing (`support@press.zone`).
- [ ] **Documentation Hub:** Set up GitBook or Docusaurus.
    - Structure: User Guide, Developer API, Hooks Reference.
- [ ] **Status Page:** Set up `status.press.zone` (UptimeRobot or Atlassian Statuspage).

## 0.4 Backend API (Shared)
**Goal:** Shared backend infrastructure for `translate-press-zone` and `multilingual-press-zone`.

### Tasks
- [ ] Refactor existing `translate-press-zone/backend-app` to support MPZ.
- [ ] Add `LanguageService` to backend API.
- [ ] Add `WorkflowService` to backend API.
- [ ] Setup Shared Auth (JWT) between plugin and backend.
