v0.1.0 Cloudflare Workers Generated 2026-03-12
60+
API Endpoints
26
Database Tables
11
Admin Pages
16
MCP Tools
5
Cron Jobs
6
Migrations
System Architecture
Client Layer Embed Widget Vanilla JS Admin Dashboard React 19 + Vite MCP Clients AI Agent Access Webhooks External Events Platform Integrations Discord / Slack / Reddit Cloudflare Edge Worker API Routes + Middleware + Auth MCP Server JSON-RPC 2.0 Durable Objects Plan Collaboration Scheduled Jobs 5 Cron Triggers Queues Async AI Processing Data & AI Layer D1 Database SQLite (26 tables) Workers AI Embeddings + Inference Vectorize Semantic Search Index LiteLLM LLM Gateway External APIs GitHub / Resend / FireCrawl AI Processing Pipeline Classification type + product_area + intent Scoring sentiment + urgency + priority Deduplication vector similarity search Theme Clustering auto-group related feedback
Key Capabilities
W
Embeddable Widget
Self-contained JS widget. Drop one <script> tag on any page to collect feedback. Anonymous users via localStorage.
Vanilla JS Auto-Provision
A
Admin Dashboard
Full React admin with feedback management, analytics charts, implementation plans, tag management, and command palette.
React 19 shadcn/ui TanStack
M
MCP Server
16 tools for AI agents to query feedback, submit items, manage plans, and search semantically via JSON-RPC 2.0.
8 Query Tools 8 Write Tools
I
AI Pipeline
Auto-classification, sentiment scoring, urgency detection, duplicate finding via vector search, and theme clustering.
Workers AI Vectorize LiteLLM
P
Implementation Plans
Full lifecycle from draft to release. Real-time collaborative editing via Durable Objects + WebSocket. GitHub issue sync.
Durable Objects CRDT / Yjs GitHub Sync
S
Multi-Channel Ingest
Import from Discord, Slack, Reddit. Brand monitoring via FireCrawl. Webhook receivers. Batch CSV/JSON import.
Discord Slack Reddit FireCrawl
GET
POST
PATCH
DELETE
:param (dynamic)
Public Widget & Feedback
GET/healthHealth check
GET/widget.jsEmbeddable widget script
GET/api/v1/:workspace/:board/feedbackList feedback (public)
POST/api/v1/:workspace/:board/feedbackSubmit feedback
POST/api/v1/:workspace/:board/feedback/:id/votesVote on feedback
POST/api/v1/:workspace/:board/feedback/:id/commentsAdd comment
Auth Authentication & OAuth
POST/api/v1/auth/signupRegister account
POST/api/v1/auth/loginLogin
POST/api/v1/auth/verify-email/:tokenVerify email
POST/api/v1/auth/forgot-passwordRequest password reset
POST/api/v1/auth/reset-password/:tokenReset password
POST/api/v1/auth/refresh-tokenRefresh JWT
GET/api/v1/oauth/authorize/:providerOAuth initiation
GET/api/v1/oauth/callback/:providerOAuth callback
Admin Feedback Management
GET/api/v1/admin/workspaces/:ws/feedbackList (filtered/sorted/paged)
GET/api/v1/admin/workspaces/:ws/feedback/:idGet detail
PATCH/api/v1/admin/workspaces/:ws/feedback/:idUpdate status/moderation
POST/api/v1/admin/workspaces/:ws/feedback/bulkBulk update
GET/api/v1/admin/workspaces/:ws/statsDashboard stats
GET/api/v1/admin/workspaces/:ws/feedback/recentRecent activity
Admin Tags
POST/api/v1/admin/workspaces/:ws/tagsCreate tag
GET/api/v1/admin/workspaces/:ws/tagsList tags
PATCH/api/v1/admin/workspaces/:ws/tags/:idUpdate tag
DELETE/api/v1/admin/workspaces/:ws/tags/:idDelete tag
AI Analysis & Processing
POST/api/v1/admin/workspaces/:ws/ai/processTrigger AI processing
GET/api/v1/admin/workspaces/:ws/ai/duplicatesDuplicate suggestions
POST/api/v1/admin/workspaces/:ws/ai/duplicates/:id/mergeMerge duplicates
GET/api/v1/admin/workspaces/:ws/ai/themesTheme clusters
GET/api/v1/admin/workspaces/:ws/ai/usageAI usage stats
Plans Implementation Plans
GET/api/v1/admin/workspaces/:ws/plansList plans
POST/api/v1/admin/workspaces/:ws/plansCreate plan
PATCH/api/v1/admin/workspaces/:ws/plans/:idUpdate plan
POST/api/v1/admin/workspaces/:ws/plans/:id/elevate-to-proposalMove to review
POST/api/v1/admin/workspaces/:ws/plans/:id/confirmConfirm plan
POST/api/v1/admin/workspaces/:ws/plans/:id/checkoutCheckout for dev
POST/api/v1/admin/workspaces/:ws/plans/:id/releaseMark released
POST/api/v1/admin/workspaces/:ws/plans/:id/sync-githubSync to GitHub
Ingest Team, Import, Analytics
GET/api/v1/workspaces/:ws/teamList team members
POST/api/v1/workspaces/:ws/inviteInvite user
POST/api/v1/admin/workspaces/:ws/importImport data
POST/api/v1/admin/workspaces/:ws/sourcesAdd external source
GET/api/v1/admin/workspaces/:ws/analyticsAnalytics data
POST/api/v1/admin/workspaces/:ws/reports/generateGenerate PDF report
MCP Model Context Protocol
GET/mcp/.well-known/mcp.jsonMCP discovery
POST/mcp/messageJSON-RPC handler (16 tools)
Widget User Flow (Anonymous)
1. Script Loads
Widget reads data-workspace and data-board from <script> tag. Falls back to script origin for API base.
2. Identity Resolution
Checks localStorage for cv_uid. If absent, generates anon_<random> and stores it.
3. Auto-Provision
First request auto-creates workspace and board via getOrCreateWorkspaceAndBoard().
4. Load Feed
GET feedback list. Shows approved + visible items with aggregated vote counts via LEFT JOIN.
5. Submit / Vote
POST creates feedback (auto-approved). Votes deduplicated by UNIQUE constraint on (feedback_id, user_id).
Widget Embed Code
<script
  src="https://your-worker.dev/widget.js"
  data-workspace="my-product"
  data-board="feedback"
></script>
Authentication Flow
1. Signup
POST /auth/signup with email + password. Password hashed with bcryptjs. Verification email sent via Resend.
2. Verify Email
Click link in email. POST /auth/verify-email/:token. Token is single-use, 24h expiry.
3. Login
POST /auth/login. Returns JWT access token (bearer). Session tracked in sessions table.
4. Access Dashboard
JWT sent as Authorization: Bearer header. Middleware validates token, resolves user + workspace role.
OAuth Alternative
GET /oauth/authorize/:provider redirects to Google/GitHub. Callback creates oauth_accounts link and issues JWT.
Password Reset
POST /forgot-password sends reset email. POST /reset-password/:token with new password. Token single-use.
API Keys
Programmatic access via cv_ prefixed keys. Scoped to workspace. Stored hashed. Used by MCP clients.
Implementation Plan Lifecycle
Draft
Proposal in Review
Confirmed
Checked Out
In Development
Staging
Released
Collaborative Editing
Plans support real-time collaborative editing via Durable Objects + WebSocket connections. Document state persisted as CRDT (Yjs binary). Cursor tracking and user presence. 5-second debounced persistence to D1.
GitHub Integration
Plans can sync to GitHub issues. Fields: github_issue_number, github_repo, release_url. Bidirectional sync on status changes. Community edit suggestions map to PR-style workflow.
Admin Dashboard Pages
D
Dashboard
Real-time overview with stats cards, activity feed, analytics charts, and priority queue.
DashboardWidgets ActivityFeed AnalyticsCharts PriorityQueue
F
Feedback
Sortable/filterable table with bulk actions, detail modals, and moderation controls.
FeedbackTable FeedbackDetail FeedbackFilters BulkActionBar ModerationActions
P
Plans
Implementation plan management with status workflow and collaborative editing.
StatusEditor SavedViews
L
Landing Page
Marketing page with hero, features, comparison, pricing, and widget demo.
Hero Features Comparison HowItWorks WidgetDemo Pricing FAQ
Shared UI Components (shadcn/ui)
Button Card Dialog Form Input Select Tabs Toast Accordion Avatar Badge Checkbox DropdownMenu Label Separator Skeleton Table
Backend Modules (src/)
lib/auth/
password.ts, tokens.ts, jwt.ts, oauth.ts, validation.ts
lib/ai/
queue.ts, embeddings.ts, vectors.ts, llm.ts, pipeline.ts, taxonomy.ts, priority-scorer.ts, plan-generator.ts
lib/platforms/
reddit.ts, discord.ts, slack.ts
lib/email/
service.ts, templates.ts (via Resend)
lib/github/
client.ts, sync.ts
mcp/tools/
8 query + 8 write tools. JSON-RPC 2.0 dispatch.
Database Schema (D1 / SQLite)
State Management (Frontend)
React Query (TanStack)
All API data fetching uses React Query for automatic caching, background refetching, and mutation invalidation. 30s refetch intervals on dashboard.
WorkspaceContext
React Context stores selected workspace + board in localStorage. All API calls scoped to active workspace. Persists across sessions.
Runtime & Infrastructure
LayerTechnologyVersionPurpose
RuntimeCloudflare Workers-Serverless edge compute
DatabaseCloudflare D1-SQLite at edge (26 tables)
AIWorkers AI-Embeddings + inference
SearchCloudflare Vectorize-Semantic vector search
QueuesCloudflare Queues-Async AI job processing
Real-timeDurable Objects-WebSocket + state persistence
DeployWrangler CLI3.99+Build & deploy pipeline
LLMLiteLLM-LLM gateway proxy
Backend Dependencies
PackageVersionPurpose
typescript5.7+Type safety (ES2022 target, strict)
zod3.24+Request validation schemas
bcryptjs3.0+Password hashing
pdf-lib1.17+PDF report generation
vitest3.2+Test framework
@cloudflare/vitest-pool-workers0.11+Workers test environment
miniflare4.xLocal D1/Workers simulation
Frontend Dependencies (admin/)
PackageVersionPurpose
react19UI framework
react-router7Client-side routing
@tanstack/react-querylatestData fetching & caching
@tanstack/react-tablelatestTable component
tailwindcsslatestUtility-first CSS
@radix-ui/*latestAccessible primitives (shadcn/ui)
react-hook-formlatestForm management
rechartslatestData visualization
lucide-reactlatestIcon library
date-fnslatestDate formatting
vitelatestBuild tool + HMR
Environment Configuration
DEV
Development
Local D1 with --local --persist
ALLOWED_ORIGINS: *
Hot reload via wrangler dev
Mocked AI bindings
STAGING
Staging
Separate D1 database
ALLOWED_ORIGINS: staging domain
Real AI bindings
npm run deploy:staging
PRODUCTION
Production
Production D1 database
ALLOWED_ORIGINS: production domains
All secrets configured
npm run deploy:production
Scheduled Jobs (Cron)
ScheduleJobDescription
0 * * * *AI ProcessingProcess pending feedback through AI pipeline
0 */6 * * *Brand MonitorCrawl web for brand mentions via FireCrawl
0 9 * * *Daily ReportsGenerate daily summary reports
0 9 * * 1Weekly ReportsGenerate weekly trend reports
0 3 * * *CleanupPurge expired tokens, stale sessions
CI/CD
SonarQube CI/CD
Dual-project setup (prod + dev). GitHub Actions workflow on push/PR to main. Self-hosted runner with [self-hosted, sonarqube] labels. Secrets: SONAR_TOKEN, SONAR_HOST_URL auto-configured.
Automated Releases
release-please for conventional commit-based releases. GitHub Actions on push to main: opens a Release PR (auto-bump + CHANGELOG); merging it tags the release. Current version: v0.1.0.
Required Secrets
ADMIN_API_TOKEN CLAUDE_API_KEY RESEND_API_KEY GOOGLE_CLIENT_ID GOOGLE_CLIENT_SECRET GITHUB_CLIENT_ID GITHUB_CLIENT_SECRET LITELLM_API_KEY FIRECRAWL_API_KEY DISCORD_BOT_TOKEN SLACK_CLIENT_SECRET REDDIT_CLIENT_SECRET
Git Workflow
feature/*
→ PR →
dev
→ PR →
main
v0.x.x tag
Standard tier: main + dev branches. Conventional commits enforce version bumps. Release PR via release-please on push to main. SonarQube gates on PR.