+
+
+
+
Metadata
+
+
+
+ Status
+
+ Queued
+ Generating
+ Review
+ Approved
+ Published
+
+
+
+
+
+
Location
+
+ {article.geo_city && article.geo_state
+ ? `${article.geo_city}, ${article.geo_state}`
+ : 'Not set'}
+
+
+
+
+
+
SEO Score
+
+ {article.seo_score || 0}/100
+
+
+
+
+
+
+
Meta Description
+
+
+ {article.meta_desc?.length || 0}/160
+
+
+
+
+
+
+
+
+
+
+ Visual
+ Code
+
+
+
+ Saved
+
+ Save Draft
+
+
+
+
+
+
+
+
+
+
+
+
Start writing...'} />
+
+
+
+
+
+
+
+
+
SEO Tools
+
+
+
+ Readability
+ Good
+
+
+
+ Keyword Density
+ 2.3%
+
+
+
+ Word Count
+ 1,247
+
+
+
+
+
+
+
Spintax
+
+
+
+ Variations
+ 432
+
+
+
+ Preview Variations
+
+
+
+
+
+
+
Featured Image
+
+ {article.featured_image_url ? (
+
+ ) : (
+
+ No image
+
+ )}
+
+
+ Generate Image
+
+
+
+
+
+
Activity Log
+
+
+
+
2 hours ago
+
Article generated
+
+
+
1 hour ago
+
SEO score calculated
+
+
+
+
+
+
+
+
diff --git a/src/pages/admin/factory/index.astro b/src/pages/admin/factory/index.astro
new file mode 100644
index 0000000..4bf81c7
--- /dev/null
+++ b/src/pages/admin/factory/index.astro
@@ -0,0 +1,63 @@
+/**
+ * Factory Floor - Main Production Page
+ * Kanban/Grid view switcher for articles
+ */
+
+---
+import AdminLayout from '@/layouts/AdminLayout.astro';
+
+const currentPath = Astro.url.pathname;
+const action = Astro.url.searchParams.get('action');
+---
+
+
+
+
+
+
+
Factory Floor
+
Content production workflow
+
+
+
+
+
+
+
+
+
+
Factory view components will load here
+
Kanban Board and Bulk Grid components coming next...
+
+
+
diff --git a/src/pages/admin/factory/jobs.astro b/src/pages/admin/factory/jobs.astro
new file mode 100644
index 0000000..1c32891
--- /dev/null
+++ b/src/pages/admin/factory/jobs.astro
@@ -0,0 +1,19 @@
+---
+import Layout from '@/layouts/AdminLayout.astro';
+import JobsManager from '@/components/admin/jobs/JobsManager';
+---
+
+
+
+
+
+
โ๏ธ Generation Queue
+
+ Monitor background processing jobs. Watch content generation progress in real-time.
+
+
+
+
+
+
+
diff --git a/src/pages/admin/factory/kanban.astro b/src/pages/admin/factory/kanban.astro
new file mode 100644
index 0000000..8b0381c
--- /dev/null
+++ b/src/pages/admin/factory/kanban.astro
@@ -0,0 +1,33 @@
+---
+import Layout from '@/layouts/AdminLayout.astro';
+import KanbanBoard from '@/components/admin/factory/KanbanBoard';
+import { Button } from '@/components/ui/button';
+import { Plus } from 'lucide-react';
+---
+
+
+
+
+
+
+ ๐ญ Content Factory
+ Beta
+
+
+ Drag and drop articles to move them through the production pipeline.
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/admin/index.astro b/src/pages/admin/index.astro
new file mode 100644
index 0000000..69956e9
--- /dev/null
+++ b/src/pages/admin/index.astro
@@ -0,0 +1,15 @@
+---
+import AdminLayout from '../../layouts/AdminLayout.astro';
+import SystemMonitor from '../../components/admin/dashboard/SystemMonitor';
+---
+
+
+
+
+
Command Station
+
System Monitoring, Sub-Station Status, and Content Integrity.
+
+
+
+
+
diff --git a/src/pages/admin/intelligence/avatar-metrics.astro b/src/pages/admin/intelligence/avatar-metrics.astro
new file mode 100644
index 0000000..e69de29
diff --git a/src/pages/admin/intelligence/avatars.astro b/src/pages/admin/intelligence/avatars.astro
new file mode 100644
index 0000000..cbe96e3
--- /dev/null
+++ b/src/pages/admin/intelligence/avatars.astro
@@ -0,0 +1,107 @@
+/**
+ * Avatar Intelligence Management
+ * Full CRUD for avatar_intelligence collection
+ */
+
+---
+import AdminLayout from '@/layouts/AdminLayout.astro';
+import { getDirectusClient } from '@/lib/directus/client';
+import { readItems } from '@directus/sdk';
+
+const client = getDirectusClient();
+
+let avatars = [];
+let error = null;
+
+try {
+ avatars = await client.request(readItems('avatar_intelligence', {
+ fields: ['*'],
+ sort: ['base_name'],
+ }));
+} catch (e) {
+ console.error('Error fetching avatars:', e);
+ error = e instanceof Error ? e.message : 'Unknown error';
+}
+---
+
+
+
+
+
+
+
Avatar Intelligence
+
Manage persona profiles and variants
+
+
+
+
+ {error && (
+
+ Error: {error}
+
+ )}
+
+
+
+
+
Total Avatars
+
{avatars.length}
+
+
+
+
+
+ {avatars.map((avatar: any) => (
+
+
+
{avatar.base_name}
+
+ Edit
+
+
+
+
+
+ Wealth Cluster:
+ {avatar.wealth_cluster || 'Not set'}
+
+
+ {avatar.business_niches && (
+
+
Niches:
+
+ {avatar.business_niches.slice(0, 3).map((niche: string) => (
+
+ {niche}
+
+ ))}
+ {avatar.business_niches.length > 3 && (
+
+ +{avatar.business_niches.length - 3} more
+
+ )}
+
+
+ )}
+
+
+ ))}
+
+ {avatars.length === 0 && !error && (
+
+
No avatars found. Create your first one!
+
+ )}
+
+
+
diff --git a/src/pages/admin/intelligence/geo-targeting.astro b/src/pages/admin/intelligence/geo-targeting.astro
new file mode 100644
index 0000000..54eea45
--- /dev/null
+++ b/src/pages/admin/intelligence/geo-targeting.astro
@@ -0,0 +1,21 @@
+---
+import AdminLayout from '@/layouts/AdminLayout.astro';
+import { GeoMap } from '@/components/intelligence/GeoMap';
+import { MetricsDashboard } from '@/components/analytics/MetricsDashboard';
+---
+
+
+
+
+
Market Dominance Map
+
Visualize your campaign performance across different territories.
+
+
+
+
+
+
Regional Performance
+
+
+
+
diff --git a/src/pages/admin/intelligence/index.astro b/src/pages/admin/intelligence/index.astro
new file mode 100644
index 0000000..6853c49
--- /dev/null
+++ b/src/pages/admin/intelligence/index.astro
@@ -0,0 +1,80 @@
+---
+import AdminLayout from '@/layouts/AdminLayout.astro';
+import PatternAnalyzer from '@/components/intelligence/PatternAnalyzer';
+import GeoTargeting from '@/components/intelligence/GeoTargeting';
+import AvatarMetrics from '@/components/intelligence/AvatarMetrics';
+import { Brain, Globe, Users } from 'lucide-react';
+
+// Server-side data fetching (simulated for Phase 4 or connected to local API logic)
+// In a real scenario, we might call the DB directly here.
+// For now, we'll import the mock data logic or just duplicate the mock data for SSR,
+// to ensure the page renders with data immediately.
+// We can also fetch from our own API if running, but during build, the API might not be up.
+// So we will define the initial data here.
+
+const patterns = [
+ { id: '1', name: 'High-Value Listicle Structure', type: 'structure', confidence: 0.92, occurrences: 145, last_detected: '2023-10-25', tags: ['listicle', 'viral', 'b2b'] },
+ { id: '2', name: 'Emotional Storytelling Hook', type: 'semantic', confidence: 0.88, occurrences: 89, last_detected: '2023-10-26', tags: ['hook', 'emotional', 'intro'] },
+ { id: '3', name: 'Data-Backed CTA', type: 'conversion', confidence: 0.76, occurrences: 230, last_detected: '2023-10-24', tags: ['cta', 'sales', 'closing'] },
+ { id: '4', name: 'Contrarian Viewpoint', type: 'semantic', confidence: 0.65, occurrences: 54, last_detected: '2023-10-22', tags: ['opinion', 'debate'] },
+ { id: '5', name: 'How-To Guide Format', type: 'structure', confidence: 0.95, occurrences: 310, last_detected: '2023-10-27', tags: ['educational', 'long-form'] }
+] as any[];
+
+const geoClusters = [
+ { id: '1', name: 'North America Tech Hubs', location: '37.7749, -122.4194', audience_size: 154000, engagement_rate: 0.45, dominant_topic: 'SaaS Marketing' },
+ { id: '2', name: 'London Finance Sector', location: '51.5074, -0.1278', audience_size: 89000, engagement_rate: 0.38, dominant_topic: 'FinTech' },
+ { id: '3', name: 'Singapore Crypto', location: '1.3521, 103.8198', audience_size: 65000, engagement_rate: 0.52, dominant_topic: 'Web3' },
+ { id: '4', name: 'Berlin Startup Scene', location: '52.5200, 13.4050', audience_size: 42000, engagement_rate: 0.41, dominant_topic: 'Growth Hacking' },
+ { id: '5', name: 'Sydney E-comm', location: '-33.8688, 151.2093', audience_size: 38000, engagement_rate: 0.35, dominant_topic: 'DTC Brands' }
+] as any[];
+
+const avatarMetrics = [
+ { id: '1', avatar_id: 'a1', name: 'Marketing Max', articles_generated: 45, avg_engagement: 0.82, top_niche: 'SaaS Growth' },
+ { id: '2', avatar_id: 'a2', name: 'Finance Fiona', articles_generated: 32, avg_engagement: 0.75, top_niche: 'Personal Finance' },
+ { id: '3', avatar_id: 'a3', name: 'Tech Tyler', articles_generated: 68, avg_engagement: 0.68, top_niche: 'AI Tools' },
+ { id: '4', avatar_id: 'a4', name: 'Wellness Wendy', articles_generated: 24, avg_engagement: 0.89, top_niche: 'Holistic Health' },
+ { id: '5', avatar_id: 'a5', name: 'Crypto Carl', articles_generated: 15, avg_engagement: 0.45, top_niche: 'DeFi' }
+] as any[];
+
+---
+
+
+
+
+
+
+ Intelligence Headquarters
+
+
+ Real-time analysis of content performance, audience demographics, and conversion patterns.
+
+
+
+
+
92%
+
Predictive Acc.
+
+
+
+
+
+
+ {/* Patterns Section - Spans 2 columns */}
+
+
+ {/* Geo Section - Spans 1 column */}
+
+
+
+
+
+
diff --git a/src/pages/admin/intelligence/patterns.astro b/src/pages/admin/intelligence/patterns.astro
new file mode 100644
index 0000000..e69de29
diff --git a/src/pages/admin/intelligence/reports.astro b/src/pages/admin/intelligence/reports.astro
new file mode 100644
index 0000000..d3219d2
--- /dev/null
+++ b/src/pages/admin/intelligence/reports.astro
@@ -0,0 +1,19 @@
+---
+import AdminLayout from '@/layouts/AdminLayout.astro';
+import UnderConstruction from '@/components/ui/UnderConstruction';
+---
+
+
+
+
+
Reports & Analysis
+
Deep dive into content performance metrics.
+
+
+
+
diff --git a/src/pages/admin/leads/[id].astro b/src/pages/admin/leads/[id].astro
new file mode 100644
index 0000000..e69de29
diff --git a/src/pages/admin/leads/index.astro b/src/pages/admin/leads/index.astro
new file mode 100644
index 0000000..b1c833c
--- /dev/null
+++ b/src/pages/admin/leads/index.astro
@@ -0,0 +1,19 @@
+---
+import Layout from '@/layouts/AdminLayout.astro';
+import LeadsManager from '@/components/admin/leads/LeadsManager';
+---
+
+
+
+
+
+
๐ฅ Leads & Prospects
+
+ Manage incoming leads and track their status from "New" to "Converted".
+
+
+
+
+
+
+
diff --git a/src/pages/admin/locations.astro b/src/pages/admin/locations.astro
new file mode 100644
index 0000000..32731a0
--- /dev/null
+++ b/src/pages/admin/locations.astro
@@ -0,0 +1,8 @@
+---
+import AdminLayout from '../../layouts/AdminLayout.astro';
+import LocationBrowser from '../../components/admin/LocationBrowser';
+---
+
+
+
+
diff --git a/src/pages/admin/media/templates.astro b/src/pages/admin/media/templates.astro
new file mode 100644
index 0000000..e35124c
--- /dev/null
+++ b/src/pages/admin/media/templates.astro
@@ -0,0 +1,8 @@
+---
+import AdminLayout from '@/layouts/AdminLayout.astro';
+import ImageTemplateEditor from '../../../components/admin/ImageTemplateEditor';
+---
+
+
+
+
diff --git a/src/pages/admin/pages/[id].astro b/src/pages/admin/pages/[id].astro
new file mode 100644
index 0000000..31c15ff
--- /dev/null
+++ b/src/pages/admin/pages/[id].astro
@@ -0,0 +1,20 @@
+---
+import Layout from '@/layouts/AdminLayout.astro';
+import PageEditor from '@/components/admin/pages/PageEditor';
+
+const { id } = Astro.params;
+---
+
+
+
+
diff --git a/src/pages/admin/pages/index.astro b/src/pages/admin/pages/index.astro
new file mode 100644
index 0000000..85fe4c5
--- /dev/null
+++ b/src/pages/admin/pages/index.astro
@@ -0,0 +1,21 @@
+---
+import Layout from '@/layouts/AdminLayout.astro';
+import PageList from '@/components/admin/pages/PageList';
+---
+
+
+
+
+
+
Pages
+
Manage static pages across your sites.
+
+
+
+ New Page
+
+
+
+
+
+
diff --git a/src/pages/admin/scheduler/index.astro b/src/pages/admin/scheduler/index.astro
new file mode 100644
index 0000000..8e5a507
--- /dev/null
+++ b/src/pages/admin/scheduler/index.astro
@@ -0,0 +1,19 @@
+---
+import Layout from '@/layouts/AdminLayout.astro';
+import SchedulerManager from '@/components/admin/scheduler/SchedulerManager';
+---
+
+
+
+
+
+
๐
Automation Center
+
+ Schedule bulk generation campaigns and automated workflows.
+
+
+
+
+
+
+
diff --git a/src/pages/admin/seo/articles/[id].astro b/src/pages/admin/seo/articles/[id].astro
new file mode 100644
index 0000000..578fe45
--- /dev/null
+++ b/src/pages/admin/seo/articles/[id].astro
@@ -0,0 +1,20 @@
+---
+import Layout from '@/layouts/AdminLayout.astro';
+import ArticleEditor from '@/components/admin/seo/ArticleEditor';
+
+const { id } = Astro.params;
+---
+
+
+
+
diff --git a/src/pages/admin/seo/articles/index.astro b/src/pages/admin/seo/articles/index.astro
new file mode 100644
index 0000000..51b19fc
--- /dev/null
+++ b/src/pages/admin/seo/articles/index.astro
@@ -0,0 +1,22 @@
+---
+import Layout from '@/layouts/AdminLayout.astro';
+import ArticleList from '@/components/admin/seo/ArticleList';
+import { getDirectusClient, readItems } from '@/lib/directus/client';
+
+const directus = getDirectusClient();
+const articles = await directus.request(readItems('generated_articles', {
+ fields: ['*'],
+ limit: 50,
+ sort: ['-date_created']
+})).catch(() => []);
+---
+
+
+
+
+
Generated Articles
+
Review and manage AI-generated SEO content.
+
+
+
+
diff --git a/src/pages/admin/seo/campaigns.astro b/src/pages/admin/seo/campaigns.astro
new file mode 100644
index 0000000..ee58bba
--- /dev/null
+++ b/src/pages/admin/seo/campaigns.astro
@@ -0,0 +1,8 @@
+---
+import AdminLayout from '@/layouts/AdminLayout.astro';
+import CampaignManager from '../../../components/admin/CampaignManager';
+---
+
+
+
+
diff --git a/src/pages/admin/seo/fragments.astro b/src/pages/admin/seo/fragments.astro
new file mode 100644
index 0000000..90a5f5f
--- /dev/null
+++ b/src/pages/admin/seo/fragments.astro
@@ -0,0 +1,14 @@
+---
+import Layout from '@/layouts/AdminLayout.astro';
+---
+
+
+
+
Content Fragments
+
+
+
Reusable Content Blocks
+
Manage global text snippets, CTAs, and bios here.
+
+
+
diff --git a/src/pages/admin/seo/headlines.astro b/src/pages/admin/seo/headlines.astro
new file mode 100644
index 0000000..e23939a
--- /dev/null
+++ b/src/pages/admin/seo/headlines.astro
@@ -0,0 +1,14 @@
+---
+import Layout from '@/layouts/AdminLayout.astro';
+---
+
+
+
+
Headlines & Hooks
+
+
+
Pattern Library
+
Manage your Cartesian Headline generation patterns here.
+
+
+
diff --git a/src/pages/admin/settings.astro b/src/pages/admin/settings.astro
new file mode 100644
index 0000000..5cde7fd
--- /dev/null
+++ b/src/pages/admin/settings.astro
@@ -0,0 +1,9 @@
+---
+import Layout from '@/layouts/AdminLayout.astro';
+import SettingsManager from '@/components/admin/SettingsManager';
+---
+
+
+
+
+
diff --git a/src/pages/admin/system/work-log.astro b/src/pages/admin/system/work-log.astro
new file mode 100644
index 0000000..e69de29
diff --git a/src/pages/admin/testing/content-quality.astro b/src/pages/admin/testing/content-quality.astro
new file mode 100644
index 0000000..e69de29
diff --git a/src/pages/admin/testing/index.astro b/src/pages/admin/testing/index.astro
new file mode 100644
index 0000000..e69de29
diff --git a/src/pages/admin/testing/link-checker.astro b/src/pages/admin/testing/link-checker.astro
new file mode 100644
index 0000000..e69de29
diff --git a/src/pages/admin/testing/seo-validation.astro b/src/pages/admin/testing/seo-validation.astro
new file mode 100644
index 0000000..e69de29
diff --git a/src/pages/admin/testing/suite.astro b/src/pages/admin/testing/suite.astro
new file mode 100644
index 0000000..c5cf507
--- /dev/null
+++ b/src/pages/admin/testing/suite.astro
@@ -0,0 +1,15 @@
+---
+import AdminLayout from '@/layouts/AdminLayout.astro';
+import TestRunner from '@/components/testing/TestRunner';
+---
+
+
+
+
+
Quality Assurance Suite
+
Validate content SEO, readability, and structural integrity.
+
+
+
+
+