# Mi-Insite implementation plan

## Delivery principles

- Deliver a complete signal-to-outcome vertical slice before adding breadth.
- Use synthetic data until source contracts, platform approvals and security controls exist.
- Keep the UI independent of provider-specific capabilities.
- Treat tenant isolation, audit, rights and retention as foundation work.
- Require passing format, lint, type, test, build and secret checks for every merge.

## Phase A: repository and local foundation

Deliverables:

- TypeScript monorepo with web, API, worker and scheduler processes.
- Strict compiler, ESLint, Prettier, Vitest and integration test harness.
- Validated configuration and mock-data mode.
- Structured redacted logging and health/readiness endpoint.
- PostgreSQL schema, forward migrations and synthetic seed framework.
- Architecture, requirements, data model and decision records.

Exit criteria:

- Clean installation from the lockfile.
- Local migration and seed complete without external credentials.
- API and web start, and health reports a reachable database.
- All required checks pass.

## Phase 0: discovery and access — 3 to 5 weeks

- Validate Presidency, Gauteng Tourism Authority and Gauteng Gambling Board workflows.
- Inventory actual Facebook, Instagram, X and TikTok accounts and requested actions.
- Register developer applications and begin platform reviews.
- Produce a curated source/RSS matrix and source-rights register.
- Confirm South African production hosting and AI processing contracts.
- Define the KPI dictionary, tenant business calendars and approval variations.
- Complete threat model, POPIA impact assessment and retention schedule.
- Agree production budget, support model, RPO/RTO and incident process.

Gate: no live connector or client data enters Mi-Insite before security, rights and processing
approvals.

## Phase 1: operational MVP — 14 to 18 weeks

### Foundation

- Identity, TOTP MFA, tenants, workspaces, roles and immutable audit.
- Database row-level security and automated cross-tenant tests.
- Connector contract, capability registry, credential references and job framework.
- Object storage, evidence hashes and source-rights enforcement.

### Monitor and triage

- Curated RSS/direct ingestion and manual import.
- Meta owned-account ingestion.
- Search, saved monitors, classification, alerting and evidence drawer.
- Case state machine, assignment, notes, templates and default SLA clocks.

### Approve and publish

- Calendar, master content and Meta variants.
- Default approval policies and separation of duties.
- Idempotent publishing, retries, reconciliation and manual fallback.
- X publishing under a tenant/platform spending limit.
- TikTok integration behind app-review and capability flags.

### Archive, KPI and reports

- Automatic snapshots for approved content and cases.
- Retention, legal hold, tombstone and evidence bundle foundation.
- Governed KPI definitions and operational dashboard.
- White-labelled read-only client portal.
- Approved PDF and CSV report templates.

### AI assistance

- Policy-enforced provider gateway.
- Synthetic-data evaluation for Gemini, OpenAI and Claude.
- Evidence-grounded summaries and drafts.
- Claim/citation checks and mandatory human approval.
- Live provider enablement only after South African processing approval.

### Hardening and pilot

- WCAG 2.2 AA tests for critical flows.
- Connector failure and job replay exercises.
- Load, backup restoration and cross-tenant penetration tests.
- Pilot onboarding, runbooks and acceptance sign-off.

## Phase 2: intelligence expansion — 10 to 14 weeks

- Narrative clustering and analyst governance.
- Campaign workspace and competitive comparison.
- Crisis room and incident reporting.
- South African language and code-switching evaluation.
- Additional direct sources and collaboration integrations.
- Custom portal domains where commercially justified.

## Phase 3: enterprise and PR

- Licensed broadcast, print and podcast connectors.
- Media CRM and permitted outreach.
- Enterprise OIDC/SSO and dedicated tenant options.
- BI/API feeds and advanced client administration.
- Larger-scale search and analytics stores when measured volume requires them.

## Default delivery controls

- Branch protection and reviewed pull requests.
- Conventional, focused commits linked to a requirement or decision.
- CI uses `npm ci` and `npm run check`.
- Migrations run once per release before traffic.
- Feature flags protect incomplete connectors and risky workflows.
- Production AI, export and publishing permissions default off.
- Releases are immutable and identified by commit SHA.

## Recovery targets

Development defaults to RPO 24 hours and RTO 8 hours. Production design targets database RPO
15 minutes and application RTO 4 hours, with point-in-time recovery, 35 daily backups, 12 monthly
backups and quarterly restoration tests.

## Budget guardrail

The approved USD 100 monthly amount is a development ceiling. Suggested caps are USD 30 for
database/storage/backups, USD 20 for X API use, USD 20 for synthetic AI evaluation, USD 10 for
email/monitoring and USD 20 contingency.

This is not a viable production budget for 20 tenants. Production capacity, availability, media
data and AI contracts require a separate approved budget before live onboarding.
