feat(feedback): Add content improvement feedback system

Frontend (frontend/app.js):

- Add textarea for improvement feedback

- Add submit button with loading state

- Handle API response and display improved content

Backend (backend/copywriter.py):

- Add improve_copy() method using Cohere API

- Integrate retry mechanism for API calls

Backend (backend/main.py):

- Add /improve-content POST endpoint

- Implement error handling and return improved content with metadata

Testing:

- Verified feedback submission flow

- Confirmed improved content generation

- Tested error scenarios and loading states
This commit is contained in:
Michael Ikehi
2025-04-18 04:42:26 +01:00
parent af8f99dea3
commit cc2b230f62
12 changed files with 178 additions and 2 deletions
-2
View File
@@ -34,9 +34,7 @@ ENV/
*.swo
# Local data
data/past_campaigns/*
data/user_queries/*
!data/past_campaigns/.gitkeep
!data/user_queries/.gitkeep
backend/data/vector_store/*
!backend/data/vector_store/.gitkeep
+17
View File
@@ -0,0 +1,17 @@
{
"content": "Headline: Transform Your Business in 90 Days\n\nAd Text: Ready for breakthrough results? The Business Evolution Program gives you the exact framework for sustainable success. 15 spots only. Includes private mentoring + proven systems.\n\nButton: Get Your Strategy Plan\n\nHeadline 2: Stop Playing Small. Start Leading.\n\nAd Text 2: Join successful entrepreneurs who've transformed their businesses. Our proven framework creates predictable growth. Limited spots for Q1 2024.\n\nButton 2: Book Your Call Now",
"content_type": "ad_copy",
"metadata": {
"campaign_name": "Q1 2024 Program Ads",
"performance_metrics": {
"click_through_rate": 0.085,
"cost_per_click": 4.25,
"conversion_rate": 0.06
},
"platform": "Meta Ads",
"added_at": "2024-01-01T00:00:00Z",
"training_data": true
},
"document_id": 6,
"timestamp": "2024-01-01T00:00:00Z"
}
@@ -0,0 +1,16 @@
{
"content": "From Overwhelmed to Outstanding: How Sarah Thompson Transformed Her Consulting Business\n\nThe Challenge:\nSarah Thompson built a successful consulting business but hit a plateau. Working 60+ hours weekly, she struggled with:\n• Inconsistent revenue\n• No scalable systems\n• Constant decision fatigue\n\nThe Solution:\nThrough the Business Evolution Program, Sarah implemented:\n1. Strategic Decision Framework\n2. Revenue Optimization System\n3. Team Empowerment Protocol\n4. Client Acquisition Blueprint\n\nThe Results:\n• Revenue increased 127% in 90 days\n• Work hours reduced to 35/week\n• Client satisfaction up 45%\n• Team efficiency improved 85%\n\nIn Sarah's Words:\n\"The framework transformed not just my business, but how I think about success. I now have clear systems, confident decision-making, and sustainable growth.\"\n\nYour Turn:\nReady to write your success story? Book your strategy session now.",
"content_type": "case_study",
"metadata": {
"campaign_name": "Client Success Stories",
"performance_metrics": {
"read_completion_rate": 0.72,
"lead_generation_rate": 0.18,
"sharing_rate": 0.25
},
"added_at": "2024-01-01T00:00:00Z",
"training_data": true
},
"document_id": 8,
"timestamp": "2024-01-01T00:00:00Z"
}
+16
View File
@@ -0,0 +1,16 @@
{
"content": "Subject: Ready to Transform Your Business? Take Action Now\n\nYou've been thinking about this moment.\n\nThe moment when you finally step into your full business potential.\n\nRight now, you're standing at a crossroads. One path leads to more of the same. The other leads to breakthrough results.\n\nThe Business Mastery Program opens next week. Inside, you'll discover:\n\n• Proven strategies that eliminate second-guessing\n• Clear systems for consistent growth\n• Powerful techniques to overcome any business challenge\n• Direct access to transformational tools\n\nMake the decision that your future self will thank you for.\n\nClick here to secure your spot → [CTA Button]\n\nP.S. Early registration closes in 48 hours. Claim your bonus strategy session now.",
"content_type": "email",
"metadata": {
"campaign_name": "Business Mastery Launch",
"performance_metrics": {
"open_rate": 0.42,
"click_rate": 0.15,
"conversion_rate": 0.08
},
"added_at": "2024-01-01T00:00:00Z",
"training_data": true
},
"document_id": 2,
"timestamp": "2024-01-01T00:00:00Z"
}
@@ -0,0 +1,16 @@
{
"content": "[Hero Section]\nTransform Your Business in 90 Days\nGet the proven framework for sustainable success\n\n[Social Proof Bar]\n127% Average Revenue Growth • 250+ Transformed Businesses • 92% Client Success Rate\n\n[Problem Section]\nFeeling Stuck Despite Your Success?\n• Working harder but not seeing proportional results\n• Lacking clear systems for sustainable growth\n• Making decisions without complete confidence\n• Missing the next level of business success\n\n[Solution Section]\nIntroducing the Business Evolution Program\n✓ Strategic Clarity Blueprint\n✓ Implementation Support System\n✓ Growth Tools Suite\n✓ Elite Network Access\n\n[Testimonial Section]\n\"The framework transformed my business. Revenue up 127% in 90 days while working less.\" - Sarah T., Consulting\n\n[Offer Section]\nQ1 2024 Enrollment Open\n• Only 15 spots available\n• Early Decision Bonus: VIP Strategy Day ($2,000 value)\n• 100% Satisfaction Guarantee\n\n[CTA Section]\nBook Your Strategy Session Now\nIncludes Custom Business Analysis ($500 value)\n\n[Urgency Bar]\nEarly Decision Bonus Expires in: [Countdown Timer]",
"content_type": "landing_page",
"metadata": {
"campaign_name": "Q1 Program Launch",
"performance_metrics": {
"conversion_rate": 0.12,
"bounce_rate": 0.25,
"average_time_on_page": 185
},
"added_at": "2024-01-01T00:00:00Z",
"training_data": true
},
"document_id": 10,
"timestamp": "2024-01-01T00:00:00Z"
}
@@ -0,0 +1,16 @@
{
"content": "Subject: [Time-Sensitive] Transform Your Business in Q1 2024\n\nDear [Name],\n\nI hope this finds you ready for transformation.\n\nHere's what I know about successful entrepreneurs like you: You've already achieved what many consider 'success.' But you know there's another level waiting.\n\nThat's why I'm reaching out.\n\nThe Business Evolution Program opens for Q1 2024 next week. Only 15 spots available.\n\nWhat's New This Quarter:\n\n1. Enhanced Strategic Clarity Blueprint\n - Deeper business assessment\n - More precise action steps\n\n2. Expanded Implementation Support\n - Additional mentoring sessions\n - New implementation workshops\n\n3. Updated Growth Tools Suite\n - Latest revenue optimization systems\n - Advanced team protocols\n\nEarly Decision Bonus (48 Hours Only):\nVIP Strategy Day ($2,000 value)\n\nWhat Past Participants Say:\n\"Revenue up 127% in 90 days while working less.\" - Sarah T.\n\"Finally have clear systems and confident decision-making.\" - Michael R.\n\nReady to transform?\nBook your strategy session here → [Link]\n\nTo your success,\n[Name]\n\nP.S. Early Decision Bonus expires in 48 hours. Don't miss out.",
"content_type": "newsletter",
"metadata": {
"campaign_name": "Q1 Program Newsletter",
"performance_metrics": {
"open_rate": 0.45,
"click_rate": 0.18,
"conversion_rate": 0.08
},
"added_at": "2024-01-01T00:00:00Z",
"training_data": true
},
"document_id": 12,
"timestamp": "2024-01-01T00:00:00Z"
}
@@ -0,0 +1,16 @@
{
"content": "For Immediate Release\n\nBusiness Evolution Program Launches New Cohort, Helping Entrepreneurs Scale Their Impact\n\n[City, State] - The Business Evolution Program, a leading business transformation initiative, announces the launch of its Q1 2024 cohort, continuing its mission to help established entrepreneurs scale their impact and success.\n\nThe program, known for its comprehensive approach to business transformation, has helped over 250 businesses achieve an average revenue growth of 127% within 90 days while reducing operational complexity.\n\n\"We're seeing a significant shift in how entrepreneurs approach business growth,\" says [Founder Name], creator of the Business Evolution Program. \"Our framework addresses the growing need for sustainable, systematic business success.\"\n\nThe Q1 2024 cohort will feature:\n• Enhanced Strategic Clarity Blueprint\n• Expanded Implementation Support\n• New Growth Tools Suite\n• Exclusive Network Access\n\nLimited to 15 participants, the program maintains its commitment to personalized attention and proven results.\n\nFor more information, visit [website] or contact:\n[Contact Information]\n\n###",
"content_type": "press_release",
"metadata": {
"campaign_name": "Q1 Launch PR",
"performance_metrics": {
"media_pickups": 12,
"reach": 50000,
"engagement_rate": 0.08
},
"added_at": "2024-01-01T00:00:00Z",
"training_data": true
},
"document_id": 11,
"timestamp": "2024-01-01T00:00:00Z"
}
@@ -0,0 +1,16 @@
{
"content": "Business Evolution Program\n\nTransform your business with our signature 90-day intensive program.\n\nWhat's Included:\n\n1. Strategic Clarity Blueprint\n• Custom business assessment\n• 90-day action roadmap\n• Decision-making framework\n\n2. Implementation Support\n• Weekly strategic mentoring\n• Implementation workshops\n• Priority email access\n\n3. Growth Tools Suite\n• Revenue optimization system\n• Team empowerment protocol\n• Client acquisition blueprint\n\n4. Community & Network\n• Private client network\n• Monthly masterminds\n• Resource library access\n\nBonus: VIP Strategy Day ($2,000 value)\n\nInvestment Options:\n• Full Payment: $5,997\n• Payment Plan: 3 x $2,197\n\nGuarantee: 100% satisfaction or full refund within 14 days\n\nLimited to 15 participants per quarter for personalized attention.",
"content_type": "product_description",
"metadata": {
"campaign_name": "Program Details Page",
"performance_metrics": {
"conversion_rate": 0.15,
"average_time_on_page": 245,
"inquiry_rate": 0.28
},
"added_at": "2024-01-01T00:00:00Z",
"training_data": true
},
"document_id": 9,
"timestamp": "2024-01-01T00:00:00Z"
}
@@ -0,0 +1,16 @@
{
"content": "Introducing the Business Evolution Program\n\nTransform your business in 90 days.\n\nYou've built a business. Now it's time to build your legacy.\n\nThe Business Evolution Program gives you:\n\n✓ Proven 7-figure business framework\n✓ Weekly strategic mentoring sessions\n✓ Custom growth roadmap\n✓ High-performance tools suite\n✓ Private client network access\n\nInvestment: $5,997\nEarly Decision Bonus: VIP Strategy Day ($2,000 value)\n\nOnly 15 spots available for Q1 2024.\n\nSchedule your private consultation now and receive your custom business analysis ($500 value) - no cost, no obligation.\n\nTake action now → [Book Consultation]\n\nYour future self will thank you for making this decision today.",
"content_type": "sales_copy",
"metadata": {
"campaign_name": "Q1 Program Launch",
"performance_metrics": {
"conversion_rate": 0.12,
"average_order_value": 5997,
"consultation_booking_rate": 0.35
},
"added_at": "2024-01-01T00:00:00Z",
"training_data": true
},
"document_id": 5,
"timestamp": "2024-01-01T00:00:00Z"
}
@@ -0,0 +1,16 @@
{
"content": "Stop waiting for permission to succeed.\n\nYour business breakthrough isn't about luck it's about strategy.\n\nIn just 60 minutes, discover:\n→ The exact framework for consistent growth\n→ How to eliminate decision paralysis\n→ Your unique success blueprint\n\nJoin the free masterclass: [Link in bio]\n\nTag a business owner who needs to hear this 👇\n\n#BusinessSuccess #Leadership #BusinessStrategy #Growth",
"content_type": "social_media",
"metadata": {
"campaign_name": "Masterclass Promotion",
"performance_metrics": {
"engagement_rate": 0.35,
"reach": 15000,
"saves": 245
},
"added_at": "2024-01-01T00:00:00Z",
"training_data": true
},
"document_id": 3,
"timestamp": "2024-01-01T00:00:00Z"
}
@@ -0,0 +1,17 @@
{
"content": "[Opening Scene: Dynamic business environment]\nVoice-over: \"You're standing at a pivotal moment in your business journey.\"\n\n[Cut to success metrics]\nVO: \"You've achieved success. But you know there's another level waiting.\"\n\n[Show transformation process]\nVO: \"The Business Evolution Program transforms how you:\n- Make strategic decisions\n- Create sustainable growth\n- Build powerful systems\n- Lead with confidence\"\n\n[Client testimonial shots]\nVO: \"Join entrepreneurs who've transformed their businesses using our proven framework.\"\n\n[Call to Action sequence]\nVO: \"Your next level is waiting. Take action now.\n\nBook your strategy session at [website].\"\n\n[End card]\nText: \"Transform Your Business in 90 Days\"\nCTA Button: \"Book Your Strategy Session\"",
"content_type": "video_script",
"metadata": {
"campaign_name": "Program Launch Video",
"performance_metrics": {
"view_completion_rate": 0.68,
"click_through_rate": 0.15,
"engagement_rate": 0.22
},
"video_length": "90 seconds",
"added_at": "2024-01-01T00:00:00Z",
"training_data": true
},
"document_id": 7,
"timestamp": "2024-01-01T00:00:00Z"
}
@@ -0,0 +1,16 @@
{
"content": "Transform Your Business Reality\n\nYou already have everything you need to create extraordinary success. This proven business transformation program gives you the exact framework to unlock your full potential.\n\nWhat you'll master:\n• Make confident, strategic decisions that drive growth\n• Break through limiting patterns that hold you back\n• Create systems that generate consistent results\n• Lead with unshakeable confidence\n\nStop waiting for the perfect moment. Your time is now. Take the first step toward transformational change - schedule your strategy session today.",
"content_type": "website_copy",
"metadata": {
"campaign_name": "Business Transformation Program",
"performance_metrics": {
"conversion_rate": 0.18,
"bounce_rate": 0.25,
"avg_time_on_page": 185
},
"added_at": "2024-01-01T00:00:00Z",
"training_data": true
},
"document_id": 1,
"timestamp": "2024-01-01T00:00:00Z"
}