Repository navigation
Tags
Tags
WIP: uncommitted local changes saved before syncing with GitHub
wip: local work preserved before fleet resync
Merge origin/main (#158 floor bumps; superseded by PEP 621 manifest) # Conflicts: # apps/api/pyproject.toml # apps/api/requirements.txt
feat(analytics): port performance/SEO/recommendations/dashboard to Ne… …on/asyncpg (#128) * wip(analytics): add Neon migration for performance analytics tables Foundation for porting src/analytics/* from Supabase to Neon/asyncpg (the 3rd and largest module). 5 tables (content_performance, performance_events, performance_snapshots, seo_rankings, content_recommendations) from supabase/015, stripped of RLS/grants/dead functions, org_id reconciled UUID->TEXT. Validated + idempotent on local Postgres 16. Service port (async conversion of the 4 services) still to come; not yet wired into schema_smoke or opened as a PR. * feat(analytics): port performance/SEO/recommendations/dashboard to Neon/asyncpg Third and largest module in the Supabase -> Neon migration (see docs/SCHEMA_AUDIT.md). The four analytics services previously read/wrote a separate Supabase project via supabase-py; on the Neon-only deploy they never persisted. They now use Neon (db/migrations/009). - neon_query.py: a small async asyncpg adapter mirroring the exact Supabase query-builder surface these services use (table/select/insert/update/delete + eq/gte/lte/lt/is_ + order/limit/range, awaitable execute()). A per-connection pg_catalog jsonb codec round-trips jsonb (shares_by_platform/metadata/data) as dict/list and text[] (based_on) as list; ISO date/datetime strings are coerced to date/datetime for asyncpg; on read, datetimes -> ISO strings and Decimal -> float so the services' existing row parsing (which assumed Supabase's JSON shape) is unchanged. - performance_service / recommendation_engine / dashboard_service: _get_supabase now returns the Neon client when DATABASE_URL is set; execute() chains awaited. (These services were already async.) - seo_tracker was synchronous; converted its DB methods + their callers to async and awaited the two call sites in app/routes/performance.py. - removed pre-existing unused imports/vars ruff flagged in the touched files. - schema_smoke asserts the 5 analytics tables; backend-db-tests CI runs the new analytics integration tests. Feature stays gated behind ENABLE_PERFORMANCE_ANALYTICS (default off). Validated on local Postgres 16: event tracking + content_performance accumulation, snapshots, summary, SEO ranking history, dashboard + topic recommendations; full backend suite green (1258 passed); ruff clean. --------- Co-authored-by: Claude <noreply@anthropic.com>
Production-ready release: react-doctor clean, coverage >85, e2e stabl… …e, recurring health checks