Solo founder project. Ask before changing anything. Read Safety Rules first.
- User profile path has an apostrophe:
C:\Users\Ken's BOXX\— breaks shell escaping - Directory junction:
C:\Users\KensBOXX\→C:\Users\Ken's BOXX\ - Always use
C:\Users\KensBOXX\in all CLI commands, file paths, and configs
PlexifySOLO is an AI-powered sales intelligence platform spanning AEC, events, broadcast, and consumer-tech verticals. It combines prospect research, outreach drafting, deal room collaboration, audio briefing generation, and a daily Powerflow pipeline into a multi-tenant sandbox-authenticated workspace.
Production URL: https://plexifybid-production.up.railway.app Custom Domain: solo.plexifyai.com Sandbox Entry: /sandbox?token=pxs_c13a257e1701ca2b148733ac591381cd8a284f9b7bd47084
npm run dev— Start Vite dev server (port 5173)npm run build— Production build (Vite, ~3400 modules, 30s)npm run preview— Preview production build locallynpm test— Run tests (Vitest, when test suite exists)node server/index.mjs— Start production Express serverdocker build -t plexifysolo .— Build Docker imagenpx supabase db push— Apply migrations to Supabase
- React 18 + Vite 5 + TypeScript
- TailwindCSS for styling
- Express 5 middleware (embedded in Vite dev, standalone in production via server/index.mjs)
- Supabase (PostgreSQL + Auth + RLS + Storage)
- Anthropic Claude API (claude-sonnet-4-20250514) for AI features — tool_use pattern
- ElevenLabs API (eleven_turbo_v2) for audio briefings + podcasts
- @react-pdf/renderer for client-side PDF export
- Node 20 LTS, npm (not yarn/pnpm)
- Railway.app + Docker for deployment (auto-deploy from GitHub main)
- Ask Plexi — Claude-powered AI chat with 3 tools (search_prospects, draft_outreach, analyze_pipeline), prospect cards, outreach preview, pipeline charts; system_prompt_override for per-tenant persona
- Deal Room — Document upload (PDF, DOCX, TXT, MD, CSV) → Supabase Storage, RAG chunking + embedding, source-grounded AI chat with citations
- Deal Room Artifacts — Claude generates structured Deal Summary, Competitive Analysis, Meeting Prep from uploaded sources; dark-themed card renderers; PDF export
- Deal Room Audio — ElevenLabs TTS: Bloomberg-style single-voice briefings + two-voice host/analyst podcasts from artifacts; custom HTML5 player with seek, speed, download, script viewer
- PlexiCoS Agents — Agent registry display, orchestration visual, activity feed
- Sandbox Auth — Token-based multi-tenant isolation (6 tenants), Bearer/query/header extraction, usage event logging
- Production Deployment — Railway + Docker, helmet, CORS, rate limiting (30 req/min)
- Multi-Tenant — 6 tenants (SB1-SB6) across AEC, events, broadcast, consumer-tech; vocab skins for render-layer label overrides; system_prompt_override for server-side persona injection
- Powerflow Pipeline — Timezone-aware daily 6-stage pipeline (Bloom-Maslow framework); inverted pyramid UI; auto-triggers from AI actions; manual close stage
├── src/ # React frontend
│ ├── components/ # Reusable UI components (29 files)
│ │ ├── artifacts/ # DealSummaryRenderer, CompetitiveAnalysisRenderer, MeetingPrepRenderer, ArtifactPDFDocument
│ │ └── PowerflowPyramid.tsx # Inverted pyramid daily pipeline UI
│ ├── pages/ # Route-level pages (11 files)
│ │ ├── DealRoomPage.tsx # Two-panel Deal Room workspace
│ │ ├── DealRoomListPage.tsx # Deal Room listing
│ │ ├── PlexiCosAgentsPage.tsx # Agent registry
│ │ ├── SandboxEntry.tsx # /sandbox?token= entry point
│ │ └── AccessRequired.tsx # Auth fallback
│ ├── features/ # Feature modules
│ │ ├── executive/ # ExecutiveFeed (home page)
│ │ ├── mel-demo/ # Original Mel demo (DemoEngine, mock data)
│ │ ├── agent-management/ # Agent registry + session tracker
│ │ └── ecosystem/ # PlaceGraph visualization
│ ├── hooks/ # Custom hooks
│ │ └── useTenantVocab.ts # Render-layer vocab skin translations
│ ├── contexts/ # SandboxContext (auth), RealDocsContext
│ ├── server/ # Vite dev middleware wrappers (17 files)
│ │ ├── askPlexiApi.ts # Ask Plexi dev middleware
│ │ ├── dealRoomsApi.ts # Deal Rooms dev middleware (CRUD, artifacts, audio)
│ │ ├── powerflowApi.ts # Powerflow pipeline dev middleware
│ │ ├── authApi.ts # Auth validation dev middleware
│ │ └── usageEventsApi.ts # Usage events dev middleware
│ ├── types/ # TypeScript types
│ │ └── artifacts.ts # ArtifactEnvelope<T>, output schemas, ARTIFACT_CHIPS
│ └── lib/ # Frontend utilities (Supabase client)
├── server/ # Express backend
│ ├── index.mjs # Production server (helmet, CORS, rate limit, routes)
│ ├── routes/ # API route handlers
│ │ ├── ask-plexi.js # Claude AI chat with tool_use loop + system_prompt_override
│ │ ├── deal-rooms.js # CRUD, file upload, RAG chat, artifacts, audio gen
│ │ ├── powerflow.js # Powerflow pipeline API (today, complete, markStage)
│ │ ├── auth.js # POST /api/auth/validate
│ │ └── usage-events.js # GET /api/usage-events
│ ├── lib/ # Server libraries
│ │ ├── supabase.js # Service-role client, all query helpers, tenant middleware
│ │ ├── claude.js # Claude API client with tool_use loop
│ │ ├── elevenlabs.js # ElevenLabs TTS (briefing + podcast generation)
│ │ └── rag.js # Text chunking, embedding, similarity search
│ ├── middleware/
│ │ └── sandboxAuth.js # Token validation, tenant isolation
│ └── tools/ # Claude tool_use definitions
│ ├── search-prospects.js
│ ├── draft-outreach.js
│ ├── analyze-pipeline.js
│ └── index.js # Tool registry
├── scripts/superpowers/ # CLI tools
│ ├── scaffold.js # Generate boilerplate (agent, route, component, migration, tenant)
│ ├── activate.js # Load domain vocab + persona
│ ├── test.js # STUB — test generation
│ └── ship.js # Handoff doc + deploy checklist generator
├── supabase/ # Database
│ ├── migrations/ # 7 SQL migration files
│ │ ├── 20260212_solo_sales_tables.sql # Core 9 tables
│ │ ├── 20260213_deal_rooms.sql # Deal rooms + sources + messages
│ │ ├── 20260214_deal_room_artifacts.sql # Artifact storage
│ │ ├── 20260218_deal_room_audio.sql # Audio records
│ │ └── 20260221_session12_multi_tenant.sql # Multi-tenant: tenants cols, powerflow_state, 6 tenants
│ ├── seeds/
│ │ └── 20260221_gravity_media_prospects.sql # 30 broadcast prospects for SB4
│ └── seed.sql # Mel Wallace sandbox data (113 records)
├── docs/ # Documentation
│ ├── SPRINT_STATUS.md # Living sprint document
│ ├── DEPLOY_CHECKLIST.md # Railway deployment guide
│ └── specs/ # Feature specs, prompts
├── Dockerfile # Multi-stage Node 20 alpine
├── railway.toml # Railway deployment config
└── CLAUDE.md # This file
GET /api/health— Health check (version, environment)POST /api/auth/validate— Validate sandbox token, return tenant info
POST /api/ask-plexi/chat— Claude AI chat with tool_useGET /api/usage-events— Agent activity feedPOST /api/deal-rooms— Create deal roomGET /api/deal-rooms— List deal roomsGET /api/deal-rooms/:id— Get deal room with sources + messagesPOST /api/deal-rooms/:id/sources— Upload source document (multipart)DELETE /api/deal-rooms/:id/sources/:sourceId— Delete sourcePOST /api/deal-rooms/:id/chat— RAG-grounded chatPOST /api/deal-rooms/:id/artifacts— Generate artifact (Claude)GET /api/deal-rooms/:id/artifacts— List artifactsPOST /api/deal-rooms/:id/audio— Generate audio briefing/podcast (Claude + ElevenLabs)GET /api/deal-rooms/:id/audio— List audio recordsGET /api/deal-rooms/:id/audio/:audioId/stream— Stream audio (Range support)GET /api/powerflow/today— Get today's powerflow state (timezone-aware)POST /api/powerflow/complete— Manually complete a powerflow stage
tenants— Sandbox accounts with token auth, features JSONB, vocab_skin, system_prompt_override, timezone, persona_code, expires_atprospects— 47 NYC AEC projects + 30 broadcast prospects, warmth_score, stage, sourcecontacts— 47 contacts linked to prospectsconnections— 8 connection recordscase_studies— 10 case studies for outreachicp_configs— Ideal customer profile configconversations— Ask Plexi conversation historyoutreach_drafts— Generated outreach emailsusage_events— Auth + activity loggingdeal_rooms— Deal rooms with name, description, statusdeal_room_sources— Uploaded documents (storage_path, chunks JSONB)deal_room_messages— RAG chat messages with citationsdeal_room_artifacts— Generated artifacts (content JSONB, status)deal_room_audio— Audio briefings + podcasts (storage_path, script, status)powerflow_state— Daily pipeline tracking per tenant (local_date, stage_1_at through stage_6_at)
All tables: UUID primary keys, tenant_id FK, RLS enabled, service-role full access.
- API routes:
server/routes/[resource].js→ REST conventions - Vite dev middleware:
src/server/[resource]Api.tswraps server routes for Vite dev - React components: PascalCase files, functional components + hooks only
- Supabase queries: Always filter by
tenant_idfor RLS enforcement - Claude tool_use: Tools defined in
server/tools/, registered in route handler - Lazy client init: Claude, Supabase, ElevenLabs clients initialized on first use (Vite env timing)
- Auth: SandboxContext provides token via
useSandbox()hook; API calls useAuthorization: Bearer ${token} - Error handling: Try/catch in routes, user-friendly messages, log details server-side
- Dark theme:
bg-gray-900 via-blue-900gradients,bg-gray-800/40panels,border-gray-700/40borders - Environment variables:
.env.local(never committed), validated at startup - CSS: TailwindCSS utility classes, no custom CSS files unless unavoidable
- File storage: Supabase Storage
deal-room-filesbucket, blob URL pattern for auth'd playback - Vocab skin:
useTenantVocab()hook for render-layer label overrides, never modifies API/DB queries - System prompt override: Server-side only (
system_prompt_override.contextprepended to default prompt), never returned to client - Powerflow: Timezone-aware daily pipeline,
Intl.DateTimeFormatfor local date, non-blocking triggers
| Variable | Required | Description |
|---|---|---|
SUPABASE_URL |
Yes | Supabase project URL |
SUPABASE_ANON_KEY |
Yes | Supabase anonymous/public key |
SUPABASE_SERVICE_ROLE_KEY |
Yes | Supabase service role key (full access) |
ANTHROPIC_API_KEY |
Yes | Anthropic API key for Claude |
ELEVENLABS_API_KEY |
No | ElevenLabs API key for audio briefings + podcasts |
NODE_ENV |
Yes (prod) | Set to production for Railway |
PORT |
No | Railway sets automatically |
ALLOWED_ORIGINS |
No | Comma-separated CORS origins |
Also requires VITE_ prefixed versions of Supabase vars for frontend build.
@docs/SPRINT_STATUS.md @docs/DEPLOY_CHECKLIST.md @docs/HANDOFF_SESSION12_COMPLETE.md
- State what you intend to change and why
- Wait for my explicit approval
- Never force push, never delete branches
- Feature work:
feature/[description] - Backups before risky ops:
backup/[description]-[date] - PRs required for merging to develop
- Delete functionality without approval
- Modify .env files or commit secrets
- Push directly to develop or main
- Run destructive operations
- Install packages without stating why first
- @ts-nocheck in App.tsx — needs careful migration
- 85+ console.log statements — cleanup later
as anycasts — address incrementally- Backup files in repo (App.tsx.backup, index_backup.css, NavigationSidebar_backup.tsx) — cleanup later
- BID-era scaffolding in src/server/ (ttsService.ts, ttsApi.ts, elevenLabsService.ts, podcastApi.ts) — unused, don't touch
- Large bundle (4.6MB) — code-split when performance becomes a concern
- OpenAI references in some chat routes — migrated to Claude API but traces remain
- PDF upload:
createRequirefix via lazy import of pdf-parse (works but fragile) - Citations show "Chunk 0" on small single-chunk documents
- ElevenLabs free tier character limits — monitor usage
- Supabase Storage bucket must have
audio/mpegin allowed MIME types
Sessions 1-12 complete. 6 tenants provisioned, multi-tenant ready. See @docs/SPRINT_STATUS.md for full breakdown. See @docs/HANDOFF_SESSION12_COMPLETE.md for Session 12 details.
- Be direct, not verbose
- Tables for comparisons
- Never use: delve, leverage, seamless, transformative
- Hit a blocker? Tell me immediately
- Uncertain? Propose 2-3 options, let me choose
- Never claim a feature works based on build/compilation alone
- Every task requires an Acceptance Test with specific browser steps
- Never claim "done" — provide Ken test steps and wait for confirmation
- Ken's browser output is the truth. If he sees failure, it's failure.
- Self-verify before handing to Ken (Lesson 23):
- Run
cd C:\dev\plexifybid && npm run devif server isn't already running - Open the relevant page in browser using the sandbox token
- Perform first-pass visual check against acceptance test criteria
- Report what you SAW (screenshots), not just what you BUILT
- Then hand Ken specific test steps for final confirmation
- "Build passes" = Step 0. Browser self-check = Step 1. Ken's browser = Step 2 (truth).
- Run