Skip to content
Shell
11.9 KB
Raw Blame

Pip-Boy Social Media Dashboard - Build Plan

Overview

Build a Fallout Pip-Boy styled web dashboard for the id8Labs Social Media Agent. Full command center for composing, scheduling, and managing social media posts with retro terminal aesthetics.

User Decisions

  • Repo Structure: Monorepo (dashboard inside existing id8Labs-social-media-agent)
  • Database: Supabase PostgreSQL from day one
  • V1 Features: ALL - Compose, Schedule, Queue Management, AI Optimization

Architecture

Monorepo Structure

id8Labs-social-media-agent/
├── apps/
│   └── dashboard/                    # Next.js 14 App Router
│       ├── app/
│       │   ├── (auth)/login/
│       │   ├── (dashboard)/
│       │   │   ├── page.tsx          # STAT - Overview
│       │   │   ├── data/page.tsx     # DATA - Queue
│       │   │   ├── inv/page.tsx      # INV - Compose
│       │   │   ├── map/page.tsx      # MAP - Calendar
│       │   │   └── radio/page.tsx    # RADIO - AI Optimize
│       │   └── api/
│       │       ├── posts/
│       │       ├── optimize/
│       │       └── platforms/
│       ├── components/
│       │   ├── pip-boy/              # UI Component Library
│       │   └── screens/              # Screen Components
│       └── lib/
│           ├── supabase/
│           └── hooks/
├── packages/
│   └── shared/                       # Shared types between CLI & dashboard
├── src/                              # Existing CLI agent (unchanged)
├── supabase/
│   └── migrations/
├── turbo.json
└── pnpm-workspace.yaml

Pip-Boy Visual Design

Color Palette

--pip-green: #14fe17;        /* Primary glow */
--pip-amber: #ffb000;        /* Alt theme */
--pip-bg: #0a0a0a;           /* Near black */
--pip-surface: #1a1a1a;      /* Cards */

Key Effects

  • CRT scanline overlay (CSS animation)
  • Green/amber glow text-shadow
  • VT323 monospace font (Google Fonts)
  • Tab-based navigation (STAT/DATA/INV/MAP/RADIO)
  • Retro gauges and progress bars

Dashboard Screens

Screen Route Purpose
STAT / Overview, platform health, queue stats
DATA /data Queue table, filter/edit/delete posts
INV /inv Compose form, platform select, schedule
MAP /map Calendar view, visual scheduling
RADIO /radio AI content optimization, viral scoring

Supabase Schema

-- Posts table
CREATE TABLE posts (
  id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
  content JSONB NOT NULL,          -- { text, media?, link? }
  platforms TEXT[] NOT NULL,
  status TEXT NOT NULL DEFAULT 'pending',
  scheduled_for TIMESTAMPTZ,
  created_at TIMESTAMPTZ DEFAULT NOW(),
  updated_at TIMESTAMPTZ DEFAULT NOW(),
  results JSONB DEFAULT '[]'
);

-- Platform status (display only)
CREATE TABLE platform_status (
  platform TEXT PRIMARY KEY,
  is_configured BOOLEAN,
  username TEXT,
  last_verified_at TIMESTAMPTZ
);

-- Real-time enabled
ALTER PUBLICATION supabase_realtime ADD TABLE posts;

API Routes

Endpoint Method Purpose
/api/posts GET List posts (with filters)
/api/posts POST Create post (immediate or scheduled)
/api/posts/[id] PATCH Update post
/api/posts/[id] DELETE Delete post
/api/optimize POST AI content optimization
/api/platforms GET Platform connection status

Integration with CLI Agent

The dashboard will bridge to existing agent code:

  1. Direct import - Share types via packages/shared
  2. Agent bridge - Spawn CLI commands for posting
  3. Supabase sync - Real-time updates on post status
// Agent bridge pattern
async function postViaAgent(content: string, platforms: string[]) {
  const proc = spawn('tsx', ['src/index.ts', 'post', content, '--platforms', platforms.join(',')]);
  // ... handle result
}

Authentication

Simple password-based auth via NextAuth.js:

  • Single user/team access
  • Environment variable for password hash
  • JWT session strategy

Tech Stack

Layer Technology
Framework Next.js 14 (App Router)
Database Supabase PostgreSQL
Styling Tailwind CSS + custom Pip-Boy theme
Forms React Hook Form + Zod
Data Fetching React Query
Real-time Supabase Realtime
Auth NextAuth.js (credentials)

Implementation Phases

Phase 1: Foundation (Day 1-2)

  • Set up pnpm monorepo with Turborepo
  • Initialize Next.js 14 app in apps/dashboard
  • Create Supabase project + apply migrations
  • Configure Tailwind with Pip-Boy theme variables
  • Implement CRT effects (scanlines, glow)
  • Set up NextAuth password auth

Phase 2: Component Library (Day 3)

  • PipBoyFrame - Main layout with header/footer
  • PipBoyTabs - STAT/DATA/INV/MAP/RADIO navigation
  • PipBoyButton - Styled button with glow
  • PipBoyInput - Terminal-style input
  • PipBoyGauge - Progress/status gauge
  • PipBoyList - Selectable list component
  • ScanlineOverlay - CRT effect layer

Phase 3: Screens (Day 4-5)

  • STAT screen - Overview with gauges
  • DATA screen - Queue table with filters
  • INV screen - Compose form with validation
  • MAP screen - Calendar scheduling
  • RADIO screen - AI optimization interface

Phase 4: API & Integration (Day 6)

  • Posts CRUD API routes
  • Optimize API route (Claude integration)
  • Agent bridge module
  • Supabase real-time subscriptions
  • Sync existing agent state to Supabase

Phase 5: Polish (Day 7-8)

  • Character counters per platform
  • Form validation with Zod
  • Error handling and loading states
  • Theme toggle (green/amber)
  • Responsive design
  • Testing

Critical Files to Modify

New Files (Dashboard)

  • apps/dashboard/app/(dashboard)/layout.tsx - Pip-Boy frame
  • apps/dashboard/components/pip-boy/*.tsx - Component library
  • apps/dashboard/lib/supabase/client.ts - DB client
  • apps/dashboard/lib/hooks/use-posts.ts - Data hooks

Existing Files to Extend

  • package.json - Add workspaces config
  • src/schemas/types.ts - Move to packages/shared

Environment Variables (Dashboard)

# Supabase
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=

# Auth
DASHBOARD_PASSWORD_HASH=
NEXTAUTH_SECRET=
NEXTAUTH_URL=http://localhost:3001

# Agent
AGENT_ROOT=../../
ANTHROPIC_API_KEY=

Commands

# Development
pnpm dev              # Run all apps
pnpm dev:dashboard    # Dashboard only
pnpm dev:agent        # CLI agent only

# Database
pnpm db:migrate       # Apply Supabase migrations
pnpm db:seed          # Seed test data

# Build
pnpm build            # Build all
pnpm build:dashboard  # Build dashboard

Success Criteria

  1. Compose posts with platform selection and character limits
  2. Schedule posts via calendar picker
  3. Manage queue - view, edit, delete posts
  4. AI optimize content with viral scoring
  5. Real-time updates when posts complete
  6. Retro Pip-Boy aesthetic with CRT effects

Task Delegation & Oversight

Claude (Orchestrator) Responsibilities

I act as watcher and fixer throughout all phases:

  • Monitor subagent outputs for errors
  • Verify each task before marking complete
  • Run typecheck/build after code changes
  • Fix issues immediately before proceeding
  • Validate UI with Playwright screenshots

Phase 1: Foundation - Subagent Assignments

Task Subagent Skill/Plugin Verification
Set up pnpm monorepo fullstack-developer - pnpm install succeeds
Initialize Next.js 14 nextjs-senior-dev /nextjs-scaffold pnpm dev:dashboard runs
Create Supabase project data-engineer /supabase-expert Tables exist in Supabase
Tailwind Pip-Boy theme frontend-developer /ui-builder Visual inspection
CRT scanline effects frontend-developer /ui-builder Playwright screenshot
NextAuth password auth security-auditor /security-audit Login flow works

Phase 2: Component Library - Subagent Assignments

Task Subagent Skill/Plugin Verification
PipBoyFrame layout frontend-developer /ui-builder Screenshot test
PipBoyTabs navigation frontend-developer /ui-builder Tab switching works
PipBoyButton component frontend-developer /ui-builder Hover glow effect
PipBoyInput component frontend-developer /ui-builder Input focus styles
PipBoyGauge component frontend-developer /ui-builder Animation renders
PipBoyList component frontend-developer /ui-builder Selection works
ScanlineOverlay frontend-developer /ui-builder Visible on all screens

Phase 3: Screens - Subagent Assignments

Task Subagent Skill/Plugin Verification
STAT screen frontend-developer /ui-builder Data displays
DATA screen (queue) frontend-developer /ui-builder CRUD operations
INV screen (compose) frontend-developer /ui-builder Form submits
MAP screen (calendar) frontend-developer /ui-builder Date selection
RADIO screen (AI) frontend-developer + ai-engineer /ui-builder Optimization works

Phase 4: API & Integration - Subagent Assignments

Task Subagent Skill/Plugin Verification
Posts CRUD API backend-architect /api-design API returns 200
Optimize API route ai-engineer - Claude responds
Agent bridge module fullstack-developer - CLI posts work
Supabase real-time data-engineer /supabase-expert Events fire
State sync data-engineer /supabase-expert Data consistent

Phase 5: Polish - Subagent Assignments

Task Subagent Skill/Plugin Verification
Character counters frontend-developer /ui-builder Count updates
Zod validation fullstack-developer - Invalid input rejected
Error handling frontend-developer /error-monitoring Errors display
Theme toggle frontend-developer /ui-builder Colors switch
Responsive design frontend-developer /ui-builder Mobile screenshot
E2E tests test-engineer /testing-qa Tests pass

Code Review Agents (Run After Each Phase)

  • code-reviewer - Check for bugs, style issues
  • silent-failure-hunter - Find error handling gaps
  • type-design-analyzer - Validate new types

Verification Protocol (PEV Pattern)

After EVERY task:

  1. Plan - State what was built
  2. Execute - Run verification command
  3. Verify - Check output, take screenshot if UI
# Run after every code change
pnpm typecheck
pnpm build
pnpm test

If verification fails:

  1. Do NOT proceed
  2. Analyze error
  3. Fix immediately
  4. Re-verify until green

MCP Tools for Verification

  • mcp__playwright__browser_navigate - Load dashboard
  • mcp__playwright__browser_snapshot - Check page structure
  • mcp__playwright__browser_take_screenshot - Visual verification
  • mcp__ide__getDiagnostics - Check for type errors

Pre-Implementation Verification Checklist

Before starting Phase 1, verify:

  • Node.js 20+ installed → v20.19.5 ✓
  • pnpm available → NOT INSTALLED - will install with npm install -g pnpm
  • Supabase CLI available or use web console
  • Existing CLI agent works (npm run status) → Working ✓ (@EddieBe authenticated)
  • All current tests pass
  • Git repo is clean (no uncommitted changes) → Clean ✓

First Step After Approval

npm install -g pnpm  # Install pnpm globally