#14 — Structured logging
- app/core/logging_config.py: configure_logging() sets stdout handler
with timestamped format; called at import time in main.py
- Global FastAPI exception_handler logs 500s with full traceback
- opportunities.py: logger added; create/approve/mark-posted/dismiss
each emit an info line so failures are traceable
#15 — Frontend error handling
- frontend/src/composables/useToast.ts: shared toast composable
(error/success/info, auto-dismiss, module-level singleton)
- frontend/src/components/ToastList.vue: fixed-position overlay,
theme-aware, accessible (role=alert, aria-live=polite)
- OpportunitiesView: all 6 async actions have catch + toast.error()
- CampaignDetail: onMounted + all 6 mutation functions wrapped
#16 — Aggregate stats
- app/api/endpoints/stats.py: GET /api/v1/stats — single DB pass
via GROUP BY; returns posts totals, 7-day count, top communities,
platform breakdown, and opportunity queue counts
- frontend/src/components/StatsBar.vue: slim header bar above
router-view; chips for posts ok/failed/week, queue pending/approved/
posted, top community; hides gracefully on API error
- app/services/directus.py: Directus CMS client using docker run
curlimages/curl on website_cf-internal network; supports static admin
token with fresh JWT login fallback; get/publish/update blog_posts
- app/api/endpoints/blog.py: POST /api/v1/blog (publish), GET /slug,
PATCH /id endpoints
- app/api/routes.py: register blog router
- app/core/config.py: add directus_url/token/email/password/network settings
- mcp/server.js: add publish_blog_post and get_blog_post MCP tools
Key gotcha: Directus filter[field][_eq] brackets must be percent-encoded
when passed as a curl CLI URL arg — raw brackets cause curl to exit
non-zero with empty stderr.
FastAPI backend (SQLite + APScheduler), Vue 3 frontend, MCP server for
Claude integration, and Docker Compose stack. Includes campaign data model
(campaigns → variants → subs), post history, sub rules, and Playwright-based
Reddit posting layer migrated from claude-bridge/reddit-poster.
Also seeds legacy campaigns (6) and sub rules (14) from reddit-poster history.
Closes#1 (scaffold), resolves migration from claude-bridge.