185 Commits

Author SHA1 Message Date
cawcenter
701ac12d57 Migrate Engines to God Mode and add Directus Shim 2025-12-14 18:51:56 -05:00
cawcenter
e2953a37c4 🔱 VALHALLA: Enforce strict usage of DATABASE_URL 2025-12-14 18:15:59 -05:00
cawcenter
c6a7ff286d 🔱 VALHALLA: Added standalone God Mode app (independent container) 2025-12-14 17:55:01 -05:00
cawcenter
c51dbc716e 🛡️ SAFETY: Limit container restarts to 5 attempts + use npm install
- Changed restart: always → on-failure:5 for all services
- Prevents infinite restart loops that crash Coolify
- Changed npm ci → npm install --legacy-peer-deps for reliable builds
2025-12-14 17:35:10 -05:00
cawcenter
b13c05aabd 🔧 FIX: Use npm install instead of npm ci for more reliable builds 2025-12-14 17:29:35 -05:00
cawcenter
486fe3c1be 🔧 FIX: Regenerate package-lock.json for npm ci 2025-12-14 17:21:08 -05:00
cawcenter
c8592597f8 🛡️ SAFETY: Make SQL schema non-fatal with timeout
- Added 2-minute timeout to psql execution
- Schema failures no longer crash Directus startup
- Directus can start with empty schema if needed
- Prevents infinite hangs on large SQL files
2025-12-14 15:24:50 -05:00
cawcenter
3cd7073ecc 🔱 GOD PANEL: Visual diagnostics dashboard
Features:
- Completely standalone (no Directus, no middleware, no redirects)
- Live service status for all 4 containers
- SQL Console for direct database queries
- Quick Actions (check sites, count articles, etc.)
- Table browser with row counts
- Memory & performance metrics
- Auto-refresh option (5s interval)
- Raw health data viewer

Tech:
- Pure React via ESM CDN imports
- Tailwind CDN (no build dependency)
- Dark theme with gold accents
- Works even when everything else is broken

URL: /god
2025-12-14 15:17:14 -05:00
cawcenter
acc4d2fe1b 🔱 Enhanced backdoor with Redis + Directus checks 2025-12-14 15:13:38 -05:00
cawcenter
c8c0ced446 🔱 BACKDOOR: Direct PostgreSQL access when Directus is down
New endpoint: /api/god/[action]
- GET /api/god/health     - Full system health (DB, pool, tables)
- GET /api/god/db-status  - Database connection test
- GET /api/god/tables     - List all tables with row counts
- GET /api/god/logs       - Recent work_log entries
- POST /api/god/sql       - Execute raw SQL

Features:
- Bypasses Directus entirely, connects directly to PostgreSQL
- Works even when Directus is crashed/frozen
- Validates X-God-Token header
- Added pg package for direct DB access
2025-12-14 15:09:53 -05:00
cawcenter
6465c3d1f8 🔧 FIX: Prevent 'role root does not exist' PostgreSQL error
start.sh:
- Added fallback defaults for DB_USER, DB_HOST, DB_DATABASE, DB_PASSWORD
- Ensures psql always uses 'postgres' user even if env vars missing
- Added debug logging to show which credentials are being used

complete_schema.sql:
- Permissions Protocol now checks if directus_policies table exists first
- Silently skips on first boot (before Directus creates its tables)
- Prevents SQL errors during fresh install
2025-12-14 15:05:35 -05:00
cawcenter
212e951b78 🔱 GOD MODE: Auto-uses GOD_MODE_TOKEN for ALL requests
- GOD_MODE_TOKEN is now primary auth (no admin token needed)
- Sends both X-God-Token header AND Authorization Bearer
- Falls back to ADMIN_TOKEN only if no God token set
2025-12-14 14:57:46 -05:00
cawcenter
bc6839919c 🔱 GOD MODE CLI: Persistent API access with no connection limits
Features:
- Keep-alive connections (no random disconnects)
- Zero timeout (never cuts off)
- Auto-retry with exponential backoff (5 attempts)
- Works as CLI and Node.js module

Commands:
- health: Check API status
- collections: List all collections
- schema: Export full schema
- read <coll>: Query collection
- count <coll>: Count items
- insert <coll>: Create item from stdin

No yaml edits - pure JS utility
2025-12-14 14:54:09 -05:00
cawcenter
0a20519bf4 🔐 PERMISSIONS GRANT PROTOCOL v1.0: Auto-unlock new collections
SCHEMA UPDATE:
- Added Permissions Grant Protocol to complete_schema.sql
- Auto-grants Admin role CRUD access to all 13 new collections
- Runs automatically during fresh install
- Uses ON CONFLICT DO NOTHING for safe re-runs

CTO DOCS UPDATE:
- Added Section 9A: Stability Patch & Permissions Protocol
- Documents the Foundation Gap resolution
- Includes manual patch instructions for existing DBs
- Verification checklist after patching
2025-12-14 14:38:42 -05:00
cawcenter
bbf2127f5d 🚀 STABILITY PATCH v1.0: Added 13 missing tables to Golden Schema
ANALYTICS ENGINE (4 tables):
- site_analytics: GA/Ads/Pixel tracking config
- events: Custom event tracking
- pageviews: Page view analytics
- conversions: Conversion tracking with lead linking

GEO-INTELLIGENCE (3 tables):
- locations_states: 50 US states with codes
- locations_counties: 3,143 counties
- locations_cities: Cities with lat/long, zip codes

LEAD CAPTURE (2 tables):
- forms: Dynamic form builder
- form_submissions: Form data storage

SITE BUILDER (3 tables):
- navigation: Self-referential menu system
- globals: Site-wide settings (singleton per site)
- hub_pages: Hierarchical content hubs

SYSTEM (1 table):
- work_log: Activity logging

Also added Directus UI configs for all new FK fields.

Schema now has 28 tables matching TypeScript types.
2025-12-14 14:32:23 -05:00
cawcenter
846b07e080 🔍 QC Update: Added P0 items for Auto-SEO and Kanban verification
NEW CRITICAL ISSUES:
- Issue 0: Auto-SEO not generating for pages/posts (only generated_articles)
- Issue 0.1: SEO status indicators missing from dashboards
- Issue 0.2: Kanban exists but needs data verification

KANBAN ANALYSIS:
- KanbanBoard.tsx exists (180 lines, @dnd-kit)
- Connected to Directus via React Query
- Needs: status field in generated_articles, test data
2025-12-14 14:23:54 -05:00
cawcenter
9eb8744a5c 🔍 QC Audit: Identified gaps between documented and implemented features
CRITICAL (P0):
- 13 SQL tables missing from complete_schema.sql (globals, navigation, work_log, forms, analytics tables, location tables)
- TypeScript references 28 collections, SQL only has 15

HIGH PRIORITY (P1):
- Analytics module endpoints will 500 (tables missing)
- Location data APIs empty (tables missing)
- Forms/Navigation features broken

MEDIUM (P2):
- Block component file naming inconsistency (docs vs actual)
- Some UI components documented but not found

Includes prioritized remediation checklist
2025-12-14 14:14:19 -05:00
cawcenter
4c632b6229 📚 Comprehensive Documentation Suite (Mil-Spec/IBM Redbook Style)
INVESTOR DOCUMENTATION:
- INVESTOR_BRIEF.md: Executive summary, capacity metrics, architecture overview
- PLATFORM_CAPABILITIES.md: 5 modules, 27 subcomponents catalog
- TECHNICAL_ARCHITECTURE.md: Mermaid diagrams, data flows, extension points

CTO/SENIOR DEV ONBOARDING:
- CTO_ONBOARDING.md: System overview, security model, operational runbook
- DEVELOPER_GUIDE.md: Clone→Run→Deploy workflow, debugging
- API_REFERENCE.md: 30+ endpoints with request/response specs
- DATABASE_SCHEMA.md: 30+ tables in Harris Matrix order
- COMPONENT_LIBRARY.md: 182 React components catalog

REFERENCE:
- GLOSSARY.md: 70+ platform terms defined
- ADMIN_PAGES_GUIDE.md: 66 admin pages by module

Style: BLUF format, zero marketing fluff, high-density tables
2025-12-14 13:58:28 -05:00
cawcenter
260baa2f4b �� Add deployment workflow documentation for Coolify 2025-12-14 13:31:20 -05:00
cawcenter
9c49d6f26a 🔧 TypeScript Schema Fixes: Complete type safety for Directus SDK
- Fixed DirectusSchema to use array types (Sites[], Posts[], etc.) as required by Directus SDK v11+
- Added missing fields to Pages interface: permalink, blocks, seo_title, seo_description, seo_image
- Added missing fields to Posts interface: excerpt, featured_image, published_at, category, author
- Added missing fields to Navigation interface: target
- Added missing fields to GeneratedArticles: is_published, date_updated
- Added missing fields to LocationsCities: county
- Cleaned up 'as unknown' type casts in fetchers.ts
- All TypeScript compilation errors resolved
2025-12-14 13:30:43 -05:00
cawcenter
25c934489c 🚀 Deployment Fix: Add TypeScript env types and SSR-safe URL detection
- Created vite-env.d.ts with proper ImportMetaEnv interface
- Fixed client.ts to use internal Docker URL (http://directus:8055) for SSR
- Removed @ts-ignore directives
- Frontend now compiles cleanly
2025-12-14 13:28:25 -05:00
cawcenter
a74a4e946d Refactor Directus types: rename to schemas.ts, fix imports, and resolve type errors 2025-12-14 12:48:08 -05:00
cawcenter
99f406e998 schema: implement Golden Schema with Harris Matrix ordering + Directus UI config
- Batch 1 (Foundation): sites, campaign_masters, 5 independent tables
- Batch 2 (Walls): 7 first-level children
- Batch 3 (Roof): link_targets
- Directus UI: Auto-configure dropdowns for all foreign keys
- Fix template bug: campaign_name → name
- Proper dependency ordering prevents constraint failures
2025-12-14 12:21:17 -05:00
cawcenter
29337e8f42 fix: add missing parent tables and correct field names in schema
CRITICAL FIXES:
- Added 'sites' table (SUPER PARENT) - referenced by 10+ tables
- Added 'campaign_masters' table - referenced by 3 tables
- Fixed field names: campaign → campaign_id, site → site_id
- Organized schema into dependency batches (Batch 1→2→3)

This fixes the root cause of foreign key constraint failures.
2025-12-14 12:15:06 -05:00
cawcenter
1340a98663 docs: add comprehensive Harris matrix and schema dependency analysis
- GOD_MODE_HARRIS_MATRIX.md: Complete dependency execution plan with 3 batches
- SCHEMA_FILE_DEPENDENCY_MATRIX.md: Cross-file relationship mapping
- Identified critical issues: missing parent tables, template errors, interface issues
2025-12-14 12:14:06 -05:00
cawcenter
658d18f1c8 fix(directus): resolve critical deployment issues
- Remove duplicate directus-extensions volume mount (conflict)
- Fix FORCE_FRESH_INSTALL boolean check (handle 'True' from Coolify)
- Optimize healthcheck (10 retries, 60s start period)
- Remove unused named volume definition

All syntax validated:
 docker-compose.yaml valid
 start.sh syntax OK
 Extensions structure correct
 SQL schema present
2025-12-14 11:45:09 -05:00
cawcenter
ce3089da41 fix: start.sh PostgreSQL user and proper env var quoting 2025-12-14 11:37:04 -05:00
cawcenter
52393ea2dd fix: add TypeScript types to godMode client library 2025-12-14 11:28:22 -05:00
cawcenter
d26643b5fe feat: god-mode expansion with schema management, site provisioning, and schema-as-code
- Added frontend godMode client library for all admin pages
- Created schema management endpoints (create/edit collections, fields, relations)
- Built automated site provisioning (creates site + homepage + navigation + forms)
- Implemented schema-as-code with start.sh auto-migration script
- Added FORCE_FRESH_INSTALL mode for database wipes
- Integrated work log, error log, and queue management via god-mode
- All admin pages can now use god-mode for seamless operations
2025-12-14 11:26:32 -05:00
cawcenter
f9947e81af feat: add god-mode API and auto-permissions - SECURE TOKEN IN COOLIFY ENV ONLY 2025-12-14 11:13:34 -05:00
cawcenter
6d9209553e feat: simplify domain architecture - consolidate to spark.jumpstartscaling.com 2025-12-14 11:00:17 -05:00
cawcenter
060ff6420b docs: add Coolify terminal deployment guide with automation options 2025-12-14 10:51:12 -05:00
cawcenter
dda640fd85 docs: add fresh deployment guide and automated setup script 2025-12-14 10:49:03 -05:00
cawcenter
273fc0ee37 docs: add domain configuration fix documentation 2025-12-14 10:43:18 -05:00
cawcenter
3ffd081ccd fix: correct domain configuration - frontend connects to spark.jumpstartscaling.com for API 2025-12-14 10:43:05 -05:00
cawcenter
8a85a3d94a docs: add preview links implementation guide 2025-12-14 10:38:03 -05:00
cawcenter
df8dd18a43 feat: add preview button to sites and create site preview page 2025-12-14 10:37:18 -05:00
cawcenter
6a4de68319 docs: add final deployment verification report 2025-12-14 10:34:41 -05:00
cawcenter
7fbe2d7ae9 docs: add complete frontend debugging summary with dev tools usage 2025-12-14 10:31:16 -05:00
cawcenter
21a923de29 fix: add CoreProvider to AdminLayout to fix QueryClient error on all admin pages 2025-12-14 10:30:27 -05:00
cawcenter
005b0fcd9e docs: add frontend database connection troubleshooting guide 2025-12-14 10:24:09 -05:00
cawcenter
ab8511ffcd fix: update frontend PUBLIC_DIRECTUS_URL to launch.jumpstartscaling.com 2025-12-14 10:23:24 -05:00
cawcenter
c7e6dcb18b fix: update Directus PUBLIC_URL to launch.jumpstartscaling.com for frontend compatibility 2025-12-14 10:22:30 -05:00
cawcenter
517a7281e4 docs: add live alpha deployment confirmation and AI agent onboarding guide 2025-12-14 10:18:47 -05:00
cawcenter
7b95b7251d feat: complete database schema with all 39 tables and foreign key relationships 2025-12-14 10:16:01 -05:00
cawcenter
40e6b6465b feat: add final 3 collections (article_templates, avatars, campaigns) - complete frontend-backend alignment 2025-12-14 09:37:05 -05:00
cawcenter
15c547d21d feat: add all missing collections (locations, forms, content_modules, offer_blocks_universal) 2025-12-14 09:36:42 -05:00
cawcenter
6b1000c136 fix: Intelligence Library schema - add slug, tech_stack, identity fields and geo_clusters/geo_locations collections 2025-12-14 09:34:52 -05:00
cawcenter
65ea0971aa feat: update schema to match frontend types - add globals, navigation, and missing fields 2025-12-14 09:32:13 -05:00
cawcenter
4842ddfe29 fix: rename postgres volume to postgres-data-fresh to force new database creation 2025-12-14 09:18:21 -05:00