Skip to content

feat(manager): wire dashboard to Strapi CMS data exclusively#515

Open
tataihono wants to merge 2 commits intomainfrom
feat/manager-strapi-cms-integration
Open

feat(manager): wire dashboard to Strapi CMS data exclusively#515
tataihono wants to merge 2 commits intomainfrom
feat/manager-strapi-cms-integration

Conversation

@tataihono
Copy link
Contributor

Summary

  • EnrichmentJob content type in Strapi replaces file-based job state — jobs survive deploys
  • Coverage page loads real video catalog from CMS, grouped by parent/child hierarchy, with per-language coverage status (verified/AI/none) based on aiGenerated flags
  • Proxy API routes (/api/languages, /api/videos, /api/enrich) with JWT auth and stale-while-revalidate caching for geo data
  • Video schema gains children/parents self-relation (replaces childGatewayIds JSON), aiMetadata boolean; gateway sync updated with post-pass to link relations
  • Dashboard layout with persistent nav (Report/Queue/Sign out) that survives page transitions
  • Auth hardened: JWT decoded server-side, role checked via API token (bypasses Strapi content API sanitization); apiFetch wrapper auto-signs out on 401
  • Login page restyled to match dashboard design language
  • Select mode on coverage page: checkboxes in detail view, select-all per collection, "Enrich Now" button creates jobs via /api/enrich

Test plan

  • Start Strapi (pnpm dev in apps/cms), verify EnrichmentJob type registered in admin
  • Re-run gateway sync to populate children relations on videos
  • Login to manager at localhost:3002 with Manager role user
  • Coverage page: select language, verify video collections load with correct coverage status
  • Switch to Translate mode, select videos, click "Enrich Now" — verify jobs created
  • Jobs page: verify enrichment jobs listed with language labels
  • Sign out: verify redirect to login page
  • Session expiry: verify 401 triggers auto-sign-out with "session expired" message

🤖 Generated with Claude Code

Replace file-based job state with Strapi EnrichmentJob content type for
durable storage. Coverage page now loads real video data from CMS with
per-language coverage status. Language/country/continent geo data served
via authenticated proxy API routes.

Key changes:
- New EnrichmentJob content type + enrichment.job-step component in CMS
- Video schema: add children/parents self-relation, aiMetadata boolean
- VideoVariant/VideoSubtitle schemas: add aiGenerated boolean
- Gateway sync: post-pass links parent→children relations after import
- Job state (lib/state.ts) backed by Strapi GraphQL mutations
- Proxy API routes: /api/languages (with SWR cache), /api/videos, /api/enrich
- Coverage page: skeleton loading, video collections from CMS, select mode
- Dashboard layout: persistent nav with Report/Queue/Sign out
- Auth: JWT decoded + role checked via API token (bypasses /api/users/me)
- Session expiry: apiFetch wrapper auto-signs out on 401
- Login page restyled to match dashboard design language
- CLAUDE.md: corrected GraphQL operations convention

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@railway-app
Copy link

railway-app bot commented Mar 23, 2026

🚅 Deployed to the forge-pr-515 environment in forge

Service Status Web Updated (UTC)
@forge/cms ⏭️ Skipped (View Logs) Web Mar 24, 2026 at 1:06 am
@forge/manager ❌ Build Failed (View Logs) Mar 24, 2026 at 1:06 am
@forge/web ⏭️ Skipped (View Logs) Web Mar 23, 2026 at 8:38 pm

P1 Critical:
- JWT signature now verified via Strapi /api/users/me (403 = valid JWT)
- Video API returns all 3 coverage statuses per video (no refetch on tab switch)
- All GraphQL operations converted from untyped gql to typed graphql()

P2 Important:
- Gateway sync post-pass skips manager-owned videos
- Extracted shared strapi-pagination helper (fetchAllPages, PageInfo)
- Error messages no longer leak internal details to clients
- updateStepStatus serialized per-job via Promise mutex
- Languages cache uses Promise-based lock (no concurrent refresh race)

P3 Nice-to-have:
- Apollo Client default fetchPolicy set to no-cache
- aiGenerated/aiMetadata fields now required (not nullable)
- Removed dead types (JobCreatePayload, JobErrorDetails, RawVariant/RawSubtitle merged)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant