Skip to content

Add social media scheduler with templates and analytics#964

Open
kevmodrome wants to merge 6 commits intostagingfrom
kevmodrome/social-scheduler
Open

Add social media scheduler with templates and analytics#964
kevmodrome wants to merge 6 commits intostagingfrom
kevmodrome/social-scheduler

Conversation

@kevmodrome
Copy link
Member

Summary

Complete social media scheduler with templates, auto-posting rules, scheduling, and analytics dashboard for Twitter/X, Bluesky, and LinkedIn.

Key Features

  • Post Management: Create, edit, schedule, and publish social media posts across multiple platforms
  • Templates: Reusable templates with variable substitution ({{title}}, {{url}}, etc.)
  • Auto-Posting Rules: Trigger-based automatic post creation from content events
  • Scheduling: Calendar-based scheduling with optimal posting times
  • Analytics: Dashboard with summary statistics, platform breakdown, and activity charts
  • Queue Management: Global posting queue with platform-specific settings

Test Coverage

26 E2E tests covering posts, calendars, settings, rules, templates, and analytics (100% passing).

Commits

  • Phase 1: Core Infrastructure
  • Phase 2: Scheduling and Calendar UI
  • Phase 3: Auto-posting Rules and Event Triggers
  • Phase 4: Templates System and Analytics Dashboard

kevmodrome and others added 4 commits January 17, 2026 12:56
Phase 1 implements the foundation for the social media scheduling system:

Database & Services:
- Migration 020: social_posts, social_post_platforms, social_auto_rules,
  social_templates, social_queue_settings, social_credentials tables
- SocialPostService: CRUD operations for posts and platforms
- SocialTemplateService: Template management
- SocialCredentialService: Encrypted credential storage (AES-256-GCM)
- Type definitions for platforms (Twitter, Bluesky, LinkedIn)

Admin UI:
- /admin/social - List page with filters (status, type, platform)
- /admin/social/new - Create post with multi-platform support
- /admin/social/[id] - Edit post with scheduling options
- Navigation link added to admin sidebar

E2E Tests (8 tests, all passing):
- Create, edit, delete social posts
- Multi-platform post creation
- Access control for non-admin users

Key fixes during implementation:
- Fixed SvelteKit redirect handling (redirect() outside try/catch)
- Fixed HTML checkbox form parsing (Zod transform for "on" values)
- Fixed Svelte hydration timing in E2E tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
## Calendar Page (/admin/social/calendar)
- Month and week view toggles
- Navigate between months with prev/next buttons
- Today button to jump to current date
- Color-coded posts by status (draft, scheduled, published, failed)
- Click posts to edit them

## Queue Settings Page (/admin/social/settings)
- Global queue settings (posting times, days, timezone, min gap)
- Platform-specific overrides for Twitter, Bluesky, LinkedIn
- Pause/resume queue controls per platform
- Edit forms with validation for time and day formats

## Edit Page Scheduling
- Schedule posts with date and time picker
- Unschedule posts to return to draft status
- Status card shows current post state

## Backend
- SocialQueueService for queue configuration management
- Remote functions for settings CRUD operations
- Queue pause/resume functionality

## E2E Tests
- Calendar navigation and view switching
- Settings page access and display
- Scheduling and unscheduling posts
- All 15 social posts tests passing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…(Phase 3)

- Add SocialAutoRuleService for CRUD operations on auto-posting rules
- Add SocialEventHandler service to trigger social posts on content/job publish and sponsor activation
- Wire up event triggers in content.remote.ts (updateContent, updateJob, approveJob)
- Wire up sponsor activation trigger in sponsors/data.remote.ts
- Add rules management UI pages (/admin/social/rules, /new, /[id])
- Fix hidden checkbox inputs sending empty strings (validation error)
- Add 4 E2E tests for auto-posting rules (create, edit, delete, toggle)
- All 20 social posts E2E tests passing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…er (Phase 4)

- Template management: create, edit, delete templates for different content types
- Templates support variables like {{title}}, {{description}}, {{url}}, {{tags}}
- Platform-specific templates for Twitter, Bluesky, and LinkedIn
- Analytics dashboard with summary cards, platform breakdown, and activity charts
- Added 6 new E2E tests for template CRUD and analytics (26 total tests passing)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

✅ Unit Test Results

Status: All Tests Passed

Test Summary

  • ✅ Passed: 152
  • ❌ Failed: 0
  • 📊 Total: 152

Coverage

  • 🔧 Functions: 86.56%
  • 📝 Lines: 85.61%

View detailed results

@github-actions
Copy link
Contributor

❌ Playwright Test Results

Status: Tests Failed

  • ✅ Passed: 0
  • ❌ Failed: 0
  • 📊 Total: 0

View detailed HTML report

The import path used 'Textarea.svelte' (lowercase 'a') but the actual
file is 'TextArea.svelte' (uppercase 'A'). This worked on macOS but
failed on Linux CI due to case-sensitive filesystem.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

✅ Unit Test Results

Status: All Tests Passed

Test Summary

  • ✅ Passed: 152
  • ❌ Failed: 0
  • 📊 Total: 152

Coverage

  • 🔧 Functions: 86.56%
  • 📝 Lines: 85.61%

View detailed results

@github-actions
Copy link
Contributor

✅ Playwright Test Results

Status: All Tests Passed

  • ✅ Passed: 314
  • ❌ Failed: 0
  • 📊 Total: 314

View detailed HTML report

- Add credentials management page at /admin/social/credentials
- Support storing encrypted credentials for Twitter, Bluesky, LinkedIn
- Add remote functions for CRUD operations on credentials
- Add E2E tests for credentials page (13 tests)
- Fix button size variant: change size="small" to size="sm"
- Add test encryption key to .env.test

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

✅ Unit Test Results

Status: All Tests Passed

Test Summary

  • ✅ Passed: 152
  • ❌ Failed: 0
  • 📊 Total: 152

Coverage

  • 🔧 Functions: 86.56%
  • 📝 Lines: 85.61%

View detailed results

@github-actions
Copy link
Contributor

✅ Playwright Test Results

Status: All Tests Passed

  • ✅ Passed: 328
  • ❌ Failed: 0
  • 📊 Total: 328

View detailed HTML report

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