feat(content): implement Content Engine MVP (v1.0) with GTM integration

This commit is contained in:
2026-01-20 12:45:59 +00:00
parent 401ad7e6e8
commit 41e60c72bc
17 changed files with 1169 additions and 30 deletions

View File

@@ -1,11 +1,12 @@
# Content Engine (v1.0 - MVP)
**Status:** Planning / Initial Setup
**Status:** Live / MVP Implemented
**Date:** Jan 20, 2026
**URL:** `/content/`
## 1. Vision & Purpose
The **Content Engine** acts as the execution arm ("The Mouth") for the strategies developed in the GTM Architect ("The Brain").
It is a **Content Generation Dashboard** designed to produce high-quality, SEO-optimized, and sales-ready marketing assets.
It is a **Content Generation Dashboard** designed to produce high-quality, SEO-optimized, and sales-ready marketing assets based on the strategic foundation of the GTM Architect.
**Core Philosophy:**
* **SEO First:** Keywords guide the structure, not just metadata.
@@ -17,43 +18,49 @@ It is a **Content Generation Dashboard** designed to produce high-quality, SEO-o
### Data Layer
* **Persistence:** A dedicated SQLite database (`content_engine.db`) stores all content projects, SEO strategies, and drafts.
* **Integration:** Read-only access to `gtm_projects.db` to import strategy baselines.
* **Integration:** Read-only access to `gtm_projects.db` via Docker volume mounts to import strategy baselines.
### The Stack
* **Frontend:** React (Vite + TypeScript) - Focus on "Writer UI" (Split Screen: Config vs. Editor).
* **Backend:** Python (Flask/Process-based Orchestrator) - Utilizing `helpers.py` for AI interaction.
* **Container:** Dockerized service, integrated into the existing Marketing Hub network.
* **Frontend:** React (Vite + TypeScript + Tailwind CSS).
* **Backend:** Node.js Bridge (`server.cjs`, Express) communicating with a Python Orchestrator (`content_orchestrator.py`).
* **Container:** Dockerized service (`content-app`), integrated into the central Nginx Gateway.
## 3. Workflow (MVP Scope: Website & SEO)
## 3. Implemented Features (MVP)
### Phase 1: Project Setup & Import
1. Select a source project from GTM Architect (e.g., "PUMA M20").
2. Import core data: Product Category, Hybrid Logic, Pain Points per ICP.
3. **Competitor Scan:** Optional input of competitor URLs to analyze their tone and position against it.
* [x] **GTM Bridge:** Lists and imports strategies directly from GTM Architect.
* [x] **Context Loading:** Automatically extracts Product Category, ICPs, and Core Value Propositions.
### Phase 2: SEO Strategy
1. **Seed Generation:** AI suggests seed keywords based on GTM data.
2. **Expansion & Validation:** Use Google Search/Suggest (via Gemini Tools) to find real-world query patterns.
3. **Selection:** User selects Primary and Secondary Keywords.
* [x] **AI Brainstorming:** Generates 15 strategic Seed Keywords (Short & Long Tail) based on the imported strategy.
* [x] **Persistence:** Saves the chosen SEO strategy to the database.
### Phase 3: Structure & Copy Generation
1. **Sitemap:** AI proposes a site structure (Home, Use Case Pages, Tech Specs).
2. **Section Generation:**
* **Hero:** Headline (Keyword-focused) + Subline.
* **Value Prop:** "Pain vs. Solution" (from GTM Phase 4).
* **Features:** "Feature-to-Value" (from GTM Phase 9).
* **Proof:** FAQ & Objections (from GTM Phase 6 - Battlecards).
3. **Refinement:** "Re-Roll" buttons for specific sections (e.g., "Make it punchier", "More focus on Compliance").
### Phase 3: Website Copy Generator
* [x] **Section Generator:** Generates structured copy for:
* **Hero Section** (Headline, Subline, CTA)
* **Challenger Story** (Problem/Agitation)
* **Value Proposition** (Hybrid Solution Logic)
* **Feature-to-Value** (Tech Deep Dive)
* [x] **Editor UI:** Integrated Markdown editor for manual refinement.
* [x] **Copy-to-Clipboard:** Quick export for deployment.
### Phase 4: Export
* Copy to Clipboard (Markdown/HTML).
* PDF Export.
## 4. Lessons Learned (Development Log)
## 4. Future Modules (Post-MVP)
### Docker & Networking
* **Volume Mounts:** Never mount a local folder over a container folder that contains build artifacts (like `node_modules` or `dist`). *Solution:* Build frontend inside Docker and serve via Node/Express static files, or be extremely precise with volume mounts.
* **Nginx Routing:** Frontend fetch calls must use **relative paths** (e.g., `api/import` instead of `/api/import`) to respect the reverse proxy path (`/content/`). Absolute paths lead to 404/502 errors because Nginx tries to route them to the root.
* **502 Bad Gateway:** Often caused by the Node server crashing immediately on startup. *Common cause:* Missing backend dependencies (like `express`) in the Docker image because `package.json` wasn't copied/installed for the backend context.
### Frontend (Vite/React)
* **TypeScript Configuration:** `tsc` requires a valid `tsconfig.json`. Without it, `npm run build` fails silently or with obscure errors.
* **Linting vs. Prototyping:** Strict linting (`noUnusedLocals: true`) is good for production but blocks rapid prototyping. *Solution:* Relax rules in `tsconfig.json` during MVP phase.
* **ES Modules vs. CommonJS:** When `package.json` has `"type": "module"`, configuration files like `postcss.config.js` MUST be renamed to `.cjs` if they use `module.exports`.
### Python & Backend
* **Standard Libs:** Do NOT include standard libraries like `sqlite3` in `requirements.txt`. Pip will fail.
* **Strings in Prompts:** ALWAYS use `r"""..."""` (Raw Strings) for prompts to avoid syntax errors with curly braces in JSON templates.
## 5. Roadmap
* **LinkedIn Matrix:** Generate posts for (Persona x Content Type).
* **Outbound Email:** Cold outreach sequences.
* **Press Kit:** Automated PR generation.
## 5. Quick Actions ("Türen öffnen")
A dashboard feature to bypass the full project flow:
* *"Write a LinkedIn post about [Feature] for [Role]."*
* **Press Kit:** Automated PR generation.