diff --git a/CHATBOT_INTEGRATION_SUMMARY.md b/CHATBOT_INTEGRATION_SUMMARY.md
deleted file mode 100644
index 7612abda..00000000
--- a/CHATBOT_INTEGRATION_SUMMARY.md
+++ /dev/null
@@ -1,248 +0,0 @@
-# Enhanced ALwrity Chatbot - Integration Summary
-
-## 🎉 Integration Complete!
-
-The Enhanced ALwrity Chatbot has been successfully integrated into the ALwrity application, providing a comprehensive conversational interface for all content creation needs.
-
-## 📁 Files Created/Modified
-
-### New Files Created
-1. **`lib/chatbot_custom/enhanced_alwrity_chatbot.py`** - Main chatbot implementation
-2. **`ENHANCED_CHATBOT_README.md`** - Comprehensive documentation
-3. **`CHATBOT_INTEGRATION_SUMMARY.md`** - This integration summary
-
-### Files Modified
-1. **`lib/utils/ui_setup.py`** - Updated navigation to include chatbot
- - Added import for enhanced chatbot
- - Replaced placeholder "Ask Alwrity(TBD)" with "ALwrity Assistant"
- - Integrated chatbot function into navigation
-
-## 🚀 Key Features Implemented
-
-### 🤖 Core Chatbot Functionality
-- **Conversational Interface**: Natural language interaction with AI
-- **Intent Recognition**: Smart understanding of user requests
-- **Context Awareness**: Maintains conversation history and context
-- **Session Management**: Persistent chat sessions with save/load capability
-
-### 🛠️ Tool Integration
-- **All AI Writers**: Direct access to 11+ writing tools
-- **SEO Tools**: Competitor analysis, content gap analysis, keyword research
-- **Content Planning**: Calendar creation, repurposing, strategy development
-- **Social Media**: Multi-platform content creation and optimization
-
-### 📄 Document & URL Analysis
-- **File Upload**: Support for PDF, TXT, DOCX, CSV, XLSX, images
-- **URL Analysis**: Comprehensive website analysis and insights
-- **Content Analysis**: AI-powered content evaluation and recommendations
-- **Real-time Processing**: Instant analysis and feedback
-
-### 🎯 Smart Suggestions
-- **Tool Recommendations**: Context-aware feature suggestions
-- **Template Library**: Pre-built templates for common content types
-- **Quick Actions**: One-click access to popular features
-- **Guided Workflows**: Step-by-step assistance for complex tasks
-
-## 🎨 User Interface Features
-
-### 📱 Modern Chat Interface
-- **Clean Design**: Professional, user-friendly interface
-- **Avatar System**: Visual distinction between user and AI messages
-- **Rich Formatting**: Markdown support for formatted responses
-- **Responsive Layout**: Optimized for different screen sizes
-
-### 🔧 Sidebar Navigation
-- **Tool Categories**: Organized access to all features
- - 📝 AI Writers
- - 🔍 SEO Tools
- - 📅 Content Planning
- - 📋 Quick Templates
- - 💬 Chat History
-- **Expandable Sections**: Collapsible tool groups for better organization
-- **Quick Access**: Direct tool launching from sidebar
-
-### ⚡ Quick Actions
-- **📝 Write Blog Post**: Instant blog creation assistance
-- **📱 Social Media Post**: Platform-specific content creation
-- **🔍 SEO Analysis**: Website and content optimization
-- **📊 Content Ideas**: Brainstorm content topics and strategies
-
-## 🔗 Integration Points
-
-### 🎯 AI Writers Integration
-```python
-# Direct access to all AI writers
-self.ai_writers = list_ai_writers()
-self.writer_functions = {
- writer['name']: writer['function'] for writer in self.ai_writers
-}
-```
-
-### 🔍 SEO Tools Integration
-```python
-# Content gap analysis integration
-from ..ai_seo_tools.content_gap_analysis.main import ContentGapAnalysis
-analyzer = ContentGapAnalysis()
-analysis = analyzer.website_analyzer.analyze_website(url)
-```
-
-### 📊 Content Planning Integration
-```python
-# Content repurposing integration
-from ..ai_seo_tools.content_calendar.ui.components.content_repurposing_ui import ContentRepurposingUI
-```
-
-## 🧠 AI Capabilities
-
-### 🎯 Intent Recognition System
-```python
-intent_keywords = {
- "write": ["write", "create", "generate", "compose", "draft"],
- "analyze": ["analyze", "review", "check", "examine", "evaluate"],
- "seo": ["seo", "optimize", "rank", "keyword", "search"],
- "social": ["social", "facebook", "twitter", "linkedin", "instagram"],
- "blog": ["blog", "article", "post", "content"],
- "help": ["help", "how", "what", "explain", "guide"],
- "research": ["research", "competitor", "market", "trend"],
- "plan": ["plan", "strategy", "calendar", "schedule"]
-}
-```
-
-### 🤖 Contextual Response Generation
-- **System Prompts**: Tailored prompts based on user intent
-- **Context Building**: Conversation history integration
-- **Smart Suggestions**: Relevant tool recommendations
-- **Error Handling**: Graceful error management and recovery
-
-## 📈 Usage Examples
-
-### Content Creation Workflow
-```
-User: "I need to write a blog post about sustainable marketing"
-Assistant: Provides guidance, suggests AI Blog Writer, offers templates
-User: "Create it for business owners, 1000 words"
-Assistant: Generates comprehensive blog post with SEO optimization
-```
-
-### SEO Analysis Workflow
-```
-User: "Analyze my website for SEO opportunities"
-Assistant: Requests URL, performs comprehensive analysis
-User: Provides website URL
-Assistant: Returns detailed SEO audit with actionable recommendations
-```
-
-### Content Planning Workflow
-```
-User: "Help me plan a content calendar for next month"
-Assistant: Guides through calendar creation process
-User: Provides business details and goals
-Assistant: Creates strategic content calendar with platform-specific content
-```
-
-## 🎯 Benefits Delivered
-
-### For Content Creators
-- **Unified Interface**: All tools accessible through conversation
-- **Intelligent Guidance**: AI-powered content creation assistance
-- **Time Savings**: Streamlined workflow and automation
-- **Quality Improvement**: Professional-grade content generation
-
-### For Businesses
-- **Scalable Content**: Efficient content production at scale
-- **Brand Consistency**: Maintained voice across all platforms
-- **Strategic Planning**: Data-driven content strategies
-- **Competitive Intelligence**: Advanced competitor analysis
-
-### For SEO Professionals
-- **Comprehensive Toolkit**: All SEO tools in one interface
-- **Automated Analysis**: AI-powered SEO insights
-- **Content Optimization**: Search engine friendly content
-- **Performance Tracking**: Detailed analytics and reporting
-
-## 🔧 Technical Implementation
-
-### Architecture
-- **Modular Design**: Clean separation of concerns
-- **Error Handling**: Robust error management
-- **Session State**: Persistent conversation management
-- **File Processing**: Secure file upload and analysis
-
-### Performance
-- **Efficient Processing**: Optimized AI model interactions
-- **Caching**: Smart caching for improved response times
-- **Background Processing**: Non-blocking operations
-- **Resource Management**: Efficient memory and CPU usage
-
-## 🚀 Access Instructions
-
-### Launch the Chatbot
-1. **Start ALwrity**: Run `streamlit run alwrity.py`
-2. **Navigate**: Click "🤖 ALwrity Assistant" in the sidebar
-3. **Start Chatting**: Begin your content creation journey!
-
-### First Steps
-1. **Welcome Message**: Read the capability overview
-2. **Try Quick Actions**: Use the quick action buttons
-3. **Upload Files**: Test document analysis features
-4. **Explore Tools**: Use sidebar to discover all features
-
-## 🎉 Success Metrics
-
-### Implementation Success
-- ✅ **Complete Integration**: All existing tools accessible
-- ✅ **Seamless Navigation**: Smooth user experience
-- ✅ **Error Handling**: Robust error management
-- ✅ **Documentation**: Comprehensive user guides
-
-### Feature Completeness
-- ✅ **11+ AI Writers**: All writing tools integrated
-- ✅ **SEO Tools**: Complete SEO toolkit access
-- ✅ **Content Planning**: Full planning capabilities
-- ✅ **File Analysis**: Multi-format file support
-- ✅ **URL Analysis**: Website analysis capabilities
-
-### User Experience
-- ✅ **Intuitive Interface**: Easy-to-use chat interface
-- ✅ **Smart Suggestions**: Context-aware recommendations
-- ✅ **Quick Actions**: One-click common tasks
-- ✅ **Help System**: Comprehensive guidance
-
-## 🔮 Future Enhancements
-
-### Planned Features
-- **Voice Interface**: Speech-to-text and text-to-speech
-- **Visual Content**: AI-powered image and video generation
-- **Advanced Analytics**: Deeper performance insights
-- **Team Collaboration**: Shared workspaces and collaboration
-- **API Integration**: External platform connections
-
-### Upcoming Integrations
-- **Social Media APIs**: Direct publishing capabilities
-- **CMS Platforms**: WordPress, Shopify integration
-- **Analytics Tools**: Google Analytics, social insights
-- **Design Software**: Canva, Adobe Creative Suite
-
-## 📞 Support & Resources
-
-### Documentation
-- **`ENHANCED_CHATBOT_README.md`**: Comprehensive user guide
-- **Inline Help**: Contextual assistance within the app
-- **Quick Start**: Step-by-step getting started guide
-
-### Technical Support
-- **Error Handling**: Built-in error management
-- **Logging**: Comprehensive logging for troubleshooting
-- **Recovery**: Automatic error recovery mechanisms
-
-## 🎊 Conclusion
-
-The Enhanced ALwrity Chatbot successfully transforms the ALwrity platform from a collection of individual tools into a unified, intelligent content creation assistant. Users can now access all features through natural conversation, making content creation more intuitive, efficient, and enjoyable.
-
-**Key Achievements:**
-- 🎯 **Unified Experience**: Single interface for all content needs
-- 🤖 **AI Intelligence**: Smart assistance and recommendations
-- 🚀 **Enhanced Productivity**: Streamlined workflows and automation
-- 📈 **Better Results**: Higher quality content and better performance
-
-**Ready to revolutionize your content creation?** The Enhanced ALwrity Chatbot is now live and ready to assist with all your content creation needs!
\ No newline at end of file
diff --git a/INTEGRATION_SUMMARY.md b/INTEGRATION_SUMMARY.md
deleted file mode 100644
index 2d165903..00000000
--- a/INTEGRATION_SUMMARY.md
+++ /dev/null
@@ -1,174 +0,0 @@
-# 🔄 Smart Content Repurposing Engine - Integration Summary
-
-## ✅ Integration Complete!
-
-The **Smart Content Repurposing Engine** has been successfully integrated into your ALwrity application. This powerful AI-driven feature transforms single pieces of content into multiple platform-optimized variations, maximizing your content's reach and impact.
-
-## 🎯 What's Been Integrated
-
-### 1. Core Engine Components
-- **Content Atomizer**: Extracts key content elements (statistics, quotes, tips, examples)
-- **Content Repurposer**: Creates platform-specific content variations
-- **Content Series Repurposer**: Generates cross-platform content series
-- **Smart Repurposing Engine**: Orchestrates the entire repurposing workflow
-
-### 2. User Interface Integration
-- **New Tab in Content Calendar**: "🔄 Smart Repurposing" tab added to the Content Calendar Dashboard
-- **Comprehensive UI**: Four main sections:
- - Single Content Repurposing
- - Content Series Creation
- - Content Analysis
- - Repurposing Dashboard with metrics
-
-### 3. Platform Support
-The engine supports repurposing for:
-- **Twitter**: 280 characters, engaging tone, hashtags
-- **LinkedIn**: 3000 characters, professional tone, business focus
-- **Instagram**: 2200 characters, visual-focused, casual tone
-- **Facebook**: Unlimited characters, conversational tone
-- **Website**: Long-form, comprehensive content
-
-## 🚀 How to Access the Feature
-
-1. **Start ALwrity**: Run `streamlit run alwrity.py`
-2. **Navigate to Content Planning**: Click "📅 Content Planning" in the sidebar
-3. **Access Smart Repurposing**: Click the "🔄 Smart Repurposing" tab in the Content Calendar Dashboard
-
-## 🔧 Key Features Available
-
-### Single Content Repurposing
-- Input content manually, upload files, or select from calendar
-- Choose target platforms (Twitter, LinkedIn, Instagram, etc.)
-- Select repurposing strategies (Adaptive, Atomic, Series-based)
-- Generate platform-optimized content instantly
-
-### Content Series Creation
-- Create progressive disclosure series across platforms
-- Generate platform-native content series
-- Timeline preview and scheduling
-- Cross-platform content coordination
-
-### Content Analysis
-- AI-powered content atomization
-- Repurposing potential assessment
-- Platform recommendations
-- Content richness analysis
-
-### Repurposing Dashboard
-- Performance metrics and insights
-- Content multiplication statistics
-- Time savings calculations
-- Platform distribution analytics
-
-## 📁 File Structure
-
-```
-lib/ai_seo_tools/content_calendar/
-├── core/
-│ ├── content_generator.py # Enhanced with repurposing integration
-│ └── content_repurposer.py # Main repurposing engine
-├── ui/
-│ ├── dashboard.py # Updated with Smart Repurposing tab
-│ └── components/
-│ └── content_repurposing_ui.py # Complete UI component
-└── ...
-```
-
-## 🎮 Demo and Testing
-
-### Run the Demo
-```bash
-python demo_smart_repurposing.py
-```
-
-This demonstrates:
-- Content atomization and analysis
-- Platform-specific repurposing
-- Cross-platform series creation
-- AI-powered recommendations
-- Comprehensive workflow
-
-### Test Results
-✅ Content atomization working
-✅ Platform-specific repurposing working
-✅ Content series creation working
-✅ UI integration successful
-✅ Error handling implemented
-
-## 🔧 Technical Implementation
-
-### AI Integration
-- Uses existing `llm_text_gen` function for consistency
-- Structured JSON responses for content atomization
-- Platform-specific prompts for optimal content generation
-- Error handling and fallback mechanisms
-
-### Database Integration
-- Seamless integration with existing `ContentItem` model
-- Automatic tagging and metadata management
-- Content relationship tracking
-- Status and scheduling management
-
-### Error Handling
-- Graceful degradation when AI services are unavailable
-- Fallback content extraction methods
-- User-friendly error messages
-- Comprehensive logging
-
-## 🎯 Benefits Delivered
-
-### Content Multiplication
-- **10x Content Output**: Transform 1 piece into 10+ variations
-- **Platform Optimization**: Each piece tailored for specific platforms
-- **Time Savings**: 20+ hours saved per content piece
-- **Consistency**: Maintain brand voice across platforms
-
-### Workflow Enhancement
-- **Integrated Experience**: Works within existing Content Calendar
-- **AI-Powered Intelligence**: Smart recommendations and analysis
-- **Batch Processing**: Handle multiple pieces simultaneously
-- **Performance Tracking**: Monitor repurposing effectiveness
-
-## 🔮 Future Enhancements
-
-### Planned Features
-- **Visual Content Generation**: AI-powered image and video creation
-- **Advanced Analytics**: Detailed performance tracking
-- **Content Templates**: Pre-built repurposing templates
-- **Automation Rules**: Automatic repurposing based on triggers
-- **Multi-language Support**: Content translation and localization
-
-### Integration Opportunities
-- **Social Media APIs**: Direct publishing to platforms
-- **Content Management Systems**: CMS integration
-- **Analytics Platforms**: Performance data integration
-- **Team Collaboration**: Multi-user workflow support
-
-## 📚 Documentation
-
-- **Main Documentation**: `SMART_REPURPOSING_README.md`
-- **Demo Script**: `demo_smart_repurposing.py`
-- **Integration Summary**: This file
-- **Code Comments**: Comprehensive inline documentation
-
-## 🎉 Success Metrics
-
-The integration has successfully delivered:
-
-1. **✅ Seamless Integration**: No disruption to existing workflows
-2. **✅ Enhanced Functionality**: Powerful new content capabilities
-3. **✅ User-Friendly Interface**: Intuitive and accessible UI
-4. **✅ Robust Performance**: Reliable operation with error handling
-5. **✅ Scalable Architecture**: Ready for future enhancements
-
-## 🚀 Ready to Use!
-
-Your Smart Content Repurposing Engine is now live and ready to transform your content creation process. Start by:
-
-1. Creating or selecting content in the Content Calendar
-2. Navigating to the Smart Repurposing tab
-3. Experimenting with different repurposing strategies
-4. Analyzing the generated content variations
-5. Publishing across multiple platforms
-
-**Happy Content Creating! 🎯**
\ No newline at end of file
diff --git a/calendar_data.json b/calendar_data.json
deleted file mode 100644
index ed7e46ac..00000000
--- a/calendar_data.json
+++ /dev/null
@@ -1,221 +0,0 @@
-{
- "name": null,
- "description": null,
- "start_date": "2025-05-22T08:00:48.925689",
- "duration": "monthly",
- "platforms": [
- "website",
- "instagram",
- "twitter",
- "linkedin",
- "facebook"
- ],
- "schedule": {
- "2025-05-22": [
- {
- "title": "AI writer",
- "description": "",
- "content_type": "blog_post",
- "platforms": [
- "website"
- ],
- "publish_date": "2025-05-22T00:00:00",
- "seo_data": {
- "title": "AI writer",
- "meta_description": "",
- "keywords": [],
- "structured_data": {},
- "canonical_url": null,
- "og_tags": null,
- "twitter_cards": null
- },
- "status": "Draft",
- "author": null,
- "tags": [],
- "notes": null
- },
- {
- "title": "alwrity.",
- "description": "",
- "content_type": "blog_post",
- "platforms": [
- "linkedin"
- ],
- "publish_date": "2025-05-22T00:00:00",
- "seo_data": {
- "title": "alwrity.",
- "meta_description": "",
- "keywords": [],
- "structured_data": {},
- "canonical_url": null,
- "og_tags": null,
- "twitter_cards": null
- },
- "status": "Draft",
- "author": null,
- "tags": [],
- "notes": null
- }
- ],
- "2025-05-31": [
- {
- "title": "ai content generation",
- "description": "",
- "content_type": "blog_post",
- "platforms": [
- "website"
- ],
- "publish_date": "2025-05-31T00:00:00",
- "seo_data": {
- "title": "ai content generation",
- "meta_description": "",
- "keywords": [],
- "structured_data": {},
- "canonical_url": null,
- "og_tags": null,
- "twitter_cards": null
- },
- "status": "Draft",
- "author": null,
- "tags": [],
- "notes": null
- },
- {
- "title": "Alwrity content generation with AI powered",
- "description": "",
- "content_type": "blog_post",
- "platforms": [
- "website"
- ],
- "publish_date": "2025-05-31T00:00:00",
- "seo_data": {
- "title": "Alwrity content generation with AI powered",
- "meta_description": "",
- "keywords": [],
- "structured_data": {},
- "canonical_url": null,
- "og_tags": null,
- "twitter_cards": null
- },
- "status": "Draft",
- "author": null,
- "tags": [],
- "notes": null
- }
- ],
- "2025-05-30": [
- {
- "title": "AI content",
- "description": "",
- "content_type": "blog_post",
- "platforms": [
- "website"
- ],
- "publish_date": "2025-05-30T00:00:00",
- "seo_data": {
- "title": "AI content",
- "meta_description": "",
- "keywords": [],
- "structured_data": {},
- "canonical_url": null,
- "og_tags": null,
- "twitter_cards": null
- },
- "status": "Draft",
- "author": null,
- "tags": [],
- "notes": null
- },
- {
- "title": "Content scheduling",
- "description": "",
- "content_type": "blog_post",
- "platforms": [
- "website"
- ],
- "publish_date": "2025-05-30T00:00:00",
- "seo_data": {
- "title": "Content scheduling",
- "meta_description": "",
- "keywords": [],
- "structured_data": {},
- "canonical_url": null,
- "og_tags": null,
- "twitter_cards": null
- },
- "status": "Draft",
- "author": null,
- "tags": [],
- "notes": null
- },
- {
- "title": "Ai content generation",
- "description": "",
- "content_type": "blog_post",
- "platforms": [
- "website"
- ],
- "publish_date": "2025-05-30T00:00:00",
- "seo_data": {
- "title": "Ai content generation",
- "meta_description": "",
- "keywords": [],
- "structured_data": {},
- "canonical_url": null,
- "og_tags": null,
- "twitter_cards": null
- },
- "status": "Draft",
- "author": null,
- "tags": [],
- "notes": null
- },
- {
- "title": "https://alwrity.com",
- "description": "",
- "content_type": "blog_post",
- "platforms": [
- "website"
- ],
- "publish_date": "2025-05-30T00:00:00",
- "seo_data": {
- "title": "https://alwrity.com",
- "meta_description": "",
- "keywords": [],
- "structured_data": {},
- "canonical_url": null,
- "og_tags": null,
- "twitter_cards": null
- },
- "status": "Draft",
- "author": null,
- "tags": [],
- "notes": null
- }
- ],
- "2025-06-27": [
- {
- "title": "AI title generation",
- "description": "",
- "content_type": "blog_post",
- "platforms": [
- "website"
- ],
- "publish_date": "2025-06-27T00:00:00",
- "seo_data": {
- "title": "AI title generation",
- "meta_description": "",
- "keywords": [],
- "structured_data": {},
- "canonical_url": null,
- "og_tags": null,
- "twitter_cards": null
- },
- "status": "Draft",
- "author": null,
- "tags": [],
- "notes": null
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/demo_smart_repurposing.py b/demo_smart_repurposing.py
index da2de723..fc6682f4 100644
--- a/demo_smart_repurposing.py
+++ b/demo_smart_repurposing.py
@@ -344,4 +344,4 @@ def main():
print("your content creation process!")
if __name__ == "__main__":
- main()
\ No newline at end of file
+ main()
\ No newline at end of file
diff --git a/lib/ai_writers/ai_writer_dashboard.py b/lib/ai_writers/ai_writer_dashboard.py
index 36357c19..3cbc5a2d 100644
--- a/lib/ai_writers/ai_writer_dashboard.py
+++ b/lib/ai_writers/ai_writer_dashboard.py
@@ -9,6 +9,7 @@ from lib.ai_writers.blog_rewriter_updater.ai_blog_rewriter import write_blog_rew
from lib.ai_writers.ai_blog_faqs_writer.faqs_ui import main as faqs_generator
from lib.ai_writers.ai_blog_writer.ai_blog_generator import ai_blog_writer_page
from lib.ai_writers.ai_outline_writer.outline_ui import main as outline_generator
+from lib.alwrity_ui.dashboard_styles import apply_dashboard_style, render_dashboard_header, render_category_header, render_card
from loguru import logger
def list_ai_writers():
@@ -105,195 +106,58 @@ def list_ai_writers():
]
def get_ai_writers():
- """Render the AI Writers dashboard UI with a professional, clickable card layout."""
- logger.info("Initializing AI Writers Dashboard")
+ """Main function to display AI writers dashboard with premium glassmorphic design."""
+ logger.info("Starting AI Writers Dashboard")
+
+ # Apply common dashboard styling
+ apply_dashboard_style()
+
+ # Render dashboard header
+ render_dashboard_header(
+ "🤖 AI Content Writers",
+ "Choose from our collection of specialized AI writers, each designed for specific content types and industries. Create engaging, high-quality content with just a few clicks."
+ )
+
writers = list_ai_writers()
logger.info(f"Found {len(writers)} AI writers")
- # Add custom CSS for a professional dashboard with VIBRANT clickable cards
- st.markdown("""
-
- """, unsafe_allow_html=True)
-
- # Dashboard header
- st.markdown("""
-
- """, unsafe_allow_html=True)
-
- # Create columns for the grid layout
- cols = st.columns(3)
-
- # Render buttons styled as cards for each writer
- for idx, writer in enumerate(writers):
- with cols[idx % 3]:
- # Prepare the button label using simple Markdown with newlines
- button_label = f"{writer['icon']}\n**{writer['name']}**\n{writer['description']}"
-
- if st.button(
- button_label,
- key=f"writer_{writer['path']}",
- help=f"Click to use the {writer['name']}", # More specific help text
- use_container_width=True,
- ):
- logger.info(f"Selected writer: {writer['name']} with path: {writer['path']}")
- st.session_state.selected_writer = writer
- st.query_params["writer"] = writer['path']
- logger.info(f"Updated query params with writer: {writer['path']}")
- st.rerun()
+ # Render writers by category with common cards
+ for category_name, category_writers in categories.items():
+ render_category_header(category_name)
+
+ # Create columns for this category
+ cols = st.columns(min(len(category_writers), 3))
+
+ for idx, writer in enumerate(category_writers):
+ with cols[idx % 3]:
+ # Use the common card renderer
+ if render_card(
+ icon=writer['icon'],
+ title=writer['name'],
+ description=writer['description'],
+ category=writer['category'],
+ key_suffix=f"{writer['path']}_{category_name}",
+ help_text=f"Launch {writer['name']} - {writer['description']}"
+ ):
+ logger.info(f"Selected writer: {writer['name']} with path: {writer['path']}")
+ st.session_state.selected_writer = writer
+ st.query_params["writer"] = writer['path']
+ logger.info(f"Updated query params with writer: {writer['path']}")
+ st.rerun()
+
+ # Add spacing between categories
+ st.markdown('', unsafe_allow_html=True)
logger.info("Finished rendering AI Writers Dashboard")
- # Return writers list, though it's not strictly needed if only rendering UI
+
return writers
# Remove the old ai_writers function since it's now integrated into get_ai_writers
\ No newline at end of file
diff --git a/lib/alwrity_ui/dashboard_styles.py b/lib/alwrity_ui/dashboard_styles.py
new file mode 100644
index 00000000..b527ddd5
--- /dev/null
+++ b/lib/alwrity_ui/dashboard_styles.py
@@ -0,0 +1,510 @@
+import streamlit as st
+
+def apply_dashboard_style():
+ """Apply common glassmorphic styling for all dashboards (AI Writers, SEO Tools, Social Media)."""
+ st.markdown("""
+
+ """, unsafe_allow_html=True)
+
+def render_dashboard_header(title, description):
+ """Render a standardized dashboard header."""
+ st.markdown(f"""
+
+ """, unsafe_allow_html=True)
+
+def render_category_header(category_name):
+ """Render a standardized category header."""
+ st.markdown(f"""
+
+ """, unsafe_allow_html=True)
+
+def render_card(icon, title, description, category, key_suffix="", help_text=""):
+ """Render a standardized premium card with button."""
+ st.markdown(f"""
+
+
+
+
+
{icon}
+
{title}
+
{description}
+
+
+
+
+
+ """, unsafe_allow_html=True)
+
+ # Return button for functionality
+ return st.button(
+ f"Select {title}",
+ key=f"card_{key_suffix}",
+ help=help_text or f"Launch {title} - {description}",
+ use_container_width=True
+ )
\ No newline at end of file
diff --git a/lib/alwrity_ui/navigation_styles.py b/lib/alwrity_ui/navigation_styles.py
new file mode 100644
index 00000000..2e3e3a98
--- /dev/null
+++ b/lib/alwrity_ui/navigation_styles.py
@@ -0,0 +1,331 @@
+import streamlit as st
+
+def apply_navigation_styles():
+ """Apply navigation and UI setup specific styling."""
+ st.markdown("""
+
+ """, unsafe_allow_html=True)
+
+def apply_compact_layout():
+ """Apply compact layout styling for specific pages."""
+ st.markdown("""
+
+ """, unsafe_allow_html=True)
\ No newline at end of file
diff --git a/lib/alwrity_ui/seo_tools_dashboard.py b/lib/alwrity_ui/seo_tools_dashboard.py
new file mode 100644
index 00000000..bf6112e1
--- /dev/null
+++ b/lib/alwrity_ui/seo_tools_dashboard.py
@@ -0,0 +1,293 @@
+import streamlit as st
+from loguru import logger
+
+from lib.ai_seo_tools.seo_structured_data import ai_structured_data
+from lib.ai_seo_tools.content_title_generator import ai_title_generator
+from lib.ai_seo_tools.meta_desc_generator import metadesc_generator_main
+from lib.ai_seo_tools.image_alt_text_generator import alt_text_gen
+from lib.ai_seo_tools.opengraph_generator import og_tag_generator
+from lib.ai_seo_tools.optimize_images_for_upload import main_img_optimizer
+from lib.ai_seo_tools.google_pagespeed_insights import google_pagespeed_insights
+from lib.ai_seo_tools.on_page_seo_analyzer import analyze_onpage_seo
+from lib.ai_seo_tools.weburl_seo_checker import url_seo_checker
+from lib.ai_marketing_tools.ai_backlinker.backlinking_ui_streamlit import backlinking_ui
+from lib.ai_seo_tools.content_gap_analysis.ui import ContentGapAnalysisUI
+from lib.ai_seo_tools.content_calendar.ui.dashboard import ContentCalendarDashboard
+from lib.alwrity_ui.dashboard_styles import apply_dashboard_style, render_dashboard_header, render_category_header, render_card
+
+def render_content_gap_analysis():
+ """Render the content gap analysis workflow interface."""
+ from lib.ai_seo_tools.content_gap_analysis.ui import ContentGapAnalysisUI
+
+ # Initialize and run the Content Gap Analysis UI
+ ui = ContentGapAnalysisUI()
+ ui.run()
+
+def render_content_calendar():
+ """Render the content calendar dashboard."""
+ import logging
+ import sys
+ from datetime import datetime
+
+ # Configure logging
+ logging.basicConfig(
+ level=logging.DEBUG,
+ format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
+ handlers=[
+ logging.StreamHandler(sys.stdout),
+ logging.FileHandler('content_calendar.log', mode='a')
+ ]
+ )
+ logger = logging.getLogger('content_calendar')
+
+ try:
+ logger.info("Initializing Content Calendar Dashboard")
+ dashboard = ContentCalendarDashboard()
+ logger.info("Rendering Content Calendar Dashboard")
+ dashboard.render()
+ logger.info("Content Calendar Dashboard rendered successfully")
+ except Exception as e:
+ logger.error(f"Error rendering content calendar: {str(e)}", exc_info=True)
+ st.error(f"An error occurred while loading the content calendar: {str(e)}")
+
+def render_seo_tools_dashboard():
+ """Render a modern dashboard for SEO tools with premium glassmorphic design."""
+
+ # Apply common dashboard styling
+ apply_dashboard_style()
+
+ # Enhanced dashboard header with modern design
+ render_dashboard_header(
+ "🚀 SEO AI Power Suite",
+ "Dominate search rankings with our comprehensive AI-powered SEO toolkit. From keyword research to content optimization, master every aspect of search engine optimization."
+ )
+
+ # Define SEO tools organized by category
+ seo_tools = {
+ "Research & Strategy": {
+ "Color Analysis": {
+ "icon": "🎨",
+ "description": "Analyze website color schemes for optimal user experience and SEO performance",
+ "category": "Analysis",
+ "path": "color_analysis",
+ "features": ["Color Psychology", "Accessibility Check", "Brand Analysis", "Conversion Optimization"]
+ },
+ "Keyword Research": {
+ "icon": "🔑",
+ "description": "Discover high-impact keywords with advanced AI-powered research and competition analysis",
+ "category": "Research",
+ "path": "keyword_research",
+ "features": ["Keyword Discovery", "Competition Analysis", "Search Volume", "Difficulty Scoring"]
+ },
+ "SEO Audit": {
+ "icon": "🔍",
+ "description": "Comprehensive website analysis with actionable insights for improving search rankings",
+ "category": "Analysis",
+ "path": "seo_audit",
+ "features": ["Technical SEO", "Content Analysis", "Performance Check", "Mobile Optimization"]
+ }
+ },
+ "Content Optimization": {
+ "Content Optimizer": {
+ "icon": "📝",
+ "description": "Transform your content with AI-driven SEO optimization for maximum search visibility",
+ "category": "Optimization",
+ "path": "content_optimizer",
+ "features": ["Content Analysis", "SEO Scoring", "Readability Check", "Meta Optimization"]
+ },
+ "Meta Generator": {
+ "icon": "🏷️",
+ "description": "Create compelling meta titles and descriptions that boost click-through rates",
+ "category": "Optimization",
+ "path": "meta_generator",
+ "features": ["Title Generation", "Description Writing", "Character Optimization", "SERP Preview"]
+ },
+ "Schema Markup": {
+ "icon": "🏗️",
+ "description": "Generate structured data markup to enhance search result appearance",
+ "category": "Technical",
+ "path": "schema_markup",
+ "features": ["Rich Snippets", "Local SEO", "Product Markup", "FAQ Schema"]
+ }
+ },
+ "Analysis & Tracking": {
+ "Rank Tracker": {
+ "icon": "📊",
+ "description": "Monitor keyword rankings and track your SEO progress with detailed analytics",
+ "category": "Analytics",
+ "path": "rank_tracker",
+ "features": ["Position Tracking", "Progress Analytics", "Competitor Monitoring", "Ranking Reports"]
+ },
+ "Backlink Analyzer": {
+ "icon": "🔗",
+ "description": "Analyze your backlink profile and discover new link building opportunities",
+ "category": "Analysis",
+ "path": "backlink_analyzer",
+ "features": ["Link Analysis", "Authority Metrics", "Anchor Text Analysis", "Toxic Link Detection"]
+ },
+ "Site Speed Test": {
+ "icon": "⚡",
+ "description": "Evaluate website performance and get optimization recommendations",
+ "category": "Performance",
+ "path": "speed_test",
+ "features": ["Speed Analysis", "Core Web Vitals", "Optimization Tips", "Mobile Performance"]
+ }
+ }
+ }
+
+ # Render categories and tools
+ for category, tools in seo_tools.items():
+ # Render category header
+ render_category_header(category)
+
+ # Create responsive grid for tools in this category
+ cols = st.columns(3)
+ for idx, (tool_name, details) in enumerate(tools.items()):
+ with cols[idx % 3]:
+ # Use the common card renderer
+ if render_card(
+ icon=details['icon'],
+ title=tool_name,
+ description=details['description'],
+ category=details['category'],
+ key_suffix=f"seo_{tool_name.replace(' ', '_')}",
+ help_text=f"Open {tool_name} - {details['description'][:50]}..."
+ ):
+ # Set query parameters to redirect to the specific tool
+ st.query_params["tool"] = details["path"]
+ st.rerun()
+
+ # Add SEO insights section
+ st.markdown("""
+
+
+
+ """, unsafe_allow_html=True)
+
+ # SEO insights grid
+ insight_cols = st.columns(2)
+ insights = [
+ {
+ "title": "🤖 AI-Powered Analysis",
+ "description": "Advanced machine learning algorithms analyze your content and provide data-driven optimization recommendations."
+ },
+ {
+ "title": "📈 Real-Time Tracking",
+ "description": "Monitor your SEO performance with live ranking updates and comprehensive progress analytics."
+ },
+ {
+ "title": "🎯 Competitor Intelligence",
+ "description": "Stay ahead of the competition with detailed analysis of competitor strategies and opportunities."
+ },
+ {
+ "title": "🚀 Technical Excellence",
+ "description": "Comprehensive technical SEO analysis covering Core Web Vitals, mobile optimization, and site architecture."
+ }
+ ]
+
+ for idx, insight in enumerate(insights):
+ with insight_cols[idx % 2]:
+ st.markdown(f"""
+
+
+
+
{insight['title']}
+
{insight['description']}
+
+
+
+ """, unsafe_allow_html=True)
+
+ # Close dashboard container
+ st.markdown('', unsafe_allow_html=True)
+
+def ai_seo_tools():
+ """Render the SEO tools dashboard with premium glassmorphic design."""
+ logger.info("Starting SEO Tools Dashboard")
+
+ # Apply common dashboard styling
+ apply_dashboard_style()
+
+ # Check if a specific tool is selected
+ selected_tool = st.query_params.get("tool")
+
+ if selected_tool:
+ # Map tool paths to their respective functions
+ tool_functions = {
+ # Individual tools
+ "structured_data": ai_structured_data,
+ "blog_title": ai_title_generator,
+ "meta_description": metadesc_generator_main,
+ "alt_text": alt_text_gen,
+ "opengraph": og_tag_generator,
+ "image_optimizer": main_img_optimizer,
+ "pagespeed": google_pagespeed_insights,
+ "onpage_seo": analyze_onpage_seo,
+ "url_checker": url_seo_checker,
+ "backlinking": backlinking_ui,
+
+ # Tool combinations
+ "content_optimization": lambda: run_tool_combination([
+ ai_title_generator,
+ metadesc_generator_main,
+ ai_structured_data
+ ], "Content Optimization Suite"),
+ "technical_audit": lambda: run_tool_combination([
+ google_pagespeed_insights,
+ analyze_onpage_seo,
+ url_seo_checker
+ ], "Technical SEO Audit"),
+ "image_optimization": lambda: run_tool_combination([
+ alt_text_gen,
+ main_img_optimizer
+ ], "Image Optimization Suite"),
+ "social_optimization": lambda: run_tool_combination([
+ og_tag_generator,
+ backlinking_ui
+ ], "Social Media Optimization"),
+
+ # Add Content Gap Analysis and Content Calendar
+ "content_gap_analysis": render_content_gap_analysis,
+ "content_calendar": render_content_calendar
+ }
+
+ if selected_tool in tool_functions:
+ # Clear any existing content
+ st.empty()
+ # Execute the selected tool's function
+ tool_functions[selected_tool]()
+ else:
+ st.error(f"Invalid tool selected: {selected_tool}")
+ render_seo_tools_dashboard()
+ else:
+ # Show the dashboard if no tool is selected
+ render_seo_tools_dashboard()
+
+def run_tool_combination(tools, combination_name):
+ """Run a combination of tools and provide cross-tool analysis."""
+ st.markdown(f"# {combination_name}")
+ st.markdown("Running comprehensive analysis...")
+
+ # Create tabs for each tool in the combination
+ tabs = st.tabs([f"Step {i+1}" for i in range(len(tools))])
+
+ # Run each tool in its own tab
+ for i, (tab, tool) in enumerate(zip(tabs, tools)):
+ with tab:
+ st.markdown(f"### Step {i+1}")
+ tool()
+
+ # Add cross-tool analysis section
+ st.markdown("## 📊 Cross-Tool Analysis")
+ st.markdown("Analyzing results across all tools...")
+
+ # Add recommendations based on combined results
+ st.markdown("## 💡 Recommendations")
+ st.markdown("Based on the combined analysis, here are the key recommendations:")
+
+ # Add a button to export the complete analysis
+ if st.button("📥 Export Complete Analysis", use_container_width=True):
+ st.info("Analysis export functionality coming soon!")
diff --git a/lib/alwrity_ui/settings_page.py b/lib/alwrity_ui/settings_page.py
new file mode 100644
index 00000000..3bdcbefd
--- /dev/null
+++ b/lib/alwrity_ui/settings_page.py
@@ -0,0 +1,973 @@
+import streamlit as st
+from loguru import logger
+import asyncio
+from lib.web_crawlers.async_web_crawler import AsyncWebCrawlerService
+from lib.personalization.style_analyzer import StyleAnalyzer
+from lib.alwrity_ui.dashboard_styles import apply_dashboard_style, render_dashboard_header
+import sys
+
+# Configure logger
+logger.remove() # Remove default handler
+logger.add(
+ "logs/settings_page.log",
+ rotation="500 MB",
+ retention="10 days",
+ level="DEBUG",
+ format="{time:YYYY-MM-DD HH:mm:ss} | {level} | {message}",
+ backtrace=True,
+ diagnose=True
+)
+logger.add(
+ sys.stdout,
+ level="INFO",
+ format="{time:YYYY-MM-DD HH:mm:ss} | {level: <8} | {message}"
+)
+
+def display_style_analysis(analysis_results: dict):
+ """Display the style analysis results in a structured format with premium styling."""
+ try:
+ # Writing Style Section
+ st.markdown("""
+
+
🎨
+
Writing Style Analysis
+
+ """, unsafe_allow_html=True)
+
+ writing_style = analysis_results.get("writing_style", {})
+ col1, col2 = st.columns(2)
+ with col1:
+ st.markdown(f"""
+
+
+ Tone:
+ {writing_style.get("tone", "N/A")}
+
+
+ Voice:
+ {writing_style.get("voice", "N/A")}
+
+
+ """, unsafe_allow_html=True)
+ with col2:
+ st.markdown(f"""
+
+
+ Complexity:
+ {writing_style.get("complexity", "N/A")}
+
+
+ Engagement:
+ {writing_style.get("engagement_level", "N/A")}
+
+
+ """, unsafe_allow_html=True)
+
+ # Content Characteristics Section
+ st.markdown("""
+
+
📊
+
Content Characteristics
+
+ """, unsafe_allow_html=True)
+
+ content_chars = analysis_results.get("content_characteristics", {})
+ col1, col2 = st.columns(2)
+ with col1:
+ st.markdown(f"""
+
+
+ Sentence Structure:
+ {content_chars.get("sentence_structure", "N/A")}
+
+
+ Vocabulary Level:
+ {content_chars.get("vocabulary_level", "N/A")}
+
+
+ """, unsafe_allow_html=True)
+ with col2:
+ st.markdown(f"""
+
+
+ Organization:
+ {content_chars.get("paragraph_organization", "N/A")}
+
+
+ Content Flow:
+ {content_chars.get("content_flow", "N/A")}
+
+
+ """, unsafe_allow_html=True)
+
+ # Target Audience Section
+ st.markdown("""
+
+ """, unsafe_allow_html=True)
+
+ target_audience = analysis_results.get("target_audience", {})
+ col1, col2 = st.columns(2)
+ with col1:
+ st.markdown(f"""
+
+
+ Demographics:
+ {', '.join(target_audience.get("demographics", ["N/A"]))}
+
+
+ Expertise Level:
+ {target_audience.get("expertise_level", "N/A")}
+
+
+ """, unsafe_allow_html=True)
+ with col2:
+ st.markdown(f"""
+
+
+ Industry Focus:
+ {target_audience.get("industry_focus", "N/A")}
+
+
+ Geographic Focus:
+ {target_audience.get("geographic_focus", "N/A")}
+
+
+ """, unsafe_allow_html=True)
+
+ # Recommended Settings Section
+ st.markdown("""
+
+
⚙️
+
Recommended Settings
+
+ """, unsafe_allow_html=True)
+
+ recommended = analysis_results.get("recommended_settings", {})
+ st.markdown(f"""
+
+
+
🎭
+
Writing Tone
+
{recommended.get("writing_tone", "N/A")}
+
+
+
👥
+
Target Audience
+
{recommended.get("target_audience", "N/A")}
+
+
+
📝
+
Content Type
+
{recommended.get("content_type", "N/A")}
+
+
+
🎨
+
Creativity Level
+
{recommended.get("creativity_level", "N/A")}
+
+
+ """, unsafe_allow_html=True)
+
+ except Exception as e:
+ logger.error(f"Error displaying style analysis: {str(e)}")
+ st.error(f"Error displaying analysis results: {str(e)}")
+
+def render_settings_page():
+ """Renders the settings page with premium glassmorphic design and all configuration options in tabs"""
+
+ # Apply common dashboard styling
+ apply_dashboard_style()
+
+ # Add settings-specific CSS for tabs and form elements
+ st.markdown("""
+
+ """, unsafe_allow_html=True)
+
+ # Use the common dashboard header
+ render_dashboard_header(
+ "⚙️ Settings & Configuration",
+ "Customize your AI experience with precision controls for content generation, personalization, and optimization. Fine-tune every aspect to match your unique requirements and style."
+ )
+
+ # Create tabs for different settings categories with premium styling
+ tabs = st.tabs([
+ "📝 Content",
+ "🖼️ Images",
+ "🤖 LLM",
+ "🔍 Search",
+ "🎨 AI Personalization"
+ ])
+
+ # Content Settings Tab
+ with tabs[0]:
+ st.markdown("""
+
+
📝 Content Personalization
+
+ """, unsafe_allow_html=True)
+
+ col1, col2 = st.columns(2)
+
+ with col1:
+ blog_length = st.text_input(
+ "**Content Length (words)**",
+ value="2000",
+ key="settings_blog_length",
+ help="Approximate word count for blogs. Note: Actual length may vary based on GPT provider and max token count."
+ )
+
+ blog_tone_options = ["Casual", "Professional", "How-to", "Beginner", "Research", "Programming", "Social Media", "Customize"]
+ blog_tone = st.selectbox(
+ "**Content Tone**",
+ options=blog_tone_options,
+ key="settings_blog_tone",
+ help="Select the desired tone for the blog content."
+ )
+
+ # Initialize custom_tone variable
+ custom_tone = ""
+ if blog_tone == "Customize":
+ custom_tone = st.text_input(
+ "Enter the tone of your content",
+ key="settings_custom_tone",
+ help="Specify the tone of your content."
+ )
+ if custom_tone:
+ blog_tone = custom_tone
+ else:
+ st.warning("Please specify the tone of your content.")
+
+ blog_demographic_options = ["Professional", "Gen-Z", "Tech-savvy", "Student", "Digital Marketing", "Customize"]
+ blog_demographic = st.selectbox(
+ "**Target Audience**",
+ options=blog_demographic_options,
+ key="settings_blog_demographic",
+ help="Select the primary audience for the blog content."
+ )
+
+ with col2:
+ blog_type = st.selectbox(
+ "**Content Type**",
+ options=["Informational", "Commercial", "Company", "News", "Finance", "Competitor", "Programming", "Scholar"],
+ key="settings_blog_type",
+ help="Select the category that best describes the blog content."
+ )
+
+ blog_language = st.selectbox(
+ "**Content Language**",
+ options=["English", "Spanish", "German", "Chinese", "Arabic", "Nepali", "Hindi", "Hindustani", "Customize"],
+ key="settings_blog_language",
+ help="Select the language in which the blog will be written."
+ )
+
+ blog_output_format = st.selectbox(
+ "**Content Output Format**",
+ options=["markdown", "HTML", "plaintext"],
+ key="settings_blog_output_format",
+ help="Select the format for the blog output."
+ )
+
+ # Images Settings Tab
+ with tabs[1]:
+ st.markdown("""
+
+
🖼️ Images Personalization
+
+ """, unsafe_allow_html=True)
+
+ col1, col2 = st.columns(2)
+
+ with col1:
+ image_generation_model = st.selectbox(
+ "**Image Generation Model**",
+ options=["stable-diffusion", "dalle2", "dalle3"],
+ key="settings_image_model",
+ help="Select the model to generate images for the blog."
+ )
+
+ with col2:
+ number_of_blog_images = st.number_input(
+ "**Number of Blog Images**",
+ value=1,
+ min_value=1,
+ max_value=10,
+ key="settings_number_of_images",
+ help="Specify the number of images to include in the blog."
+ )
+
+ # LLM Settings Tab
+ with tabs[2]:
+ st.markdown("""
+
+
🤖 LLM Personalization
+
+ """, unsafe_allow_html=True)
+
+ col1, col2 = st.columns(2)
+
+ with col1:
+ gpt_provider = st.selectbox(
+ "**GPT Provider**",
+ options=["google", "openai", "minstral"],
+ key="settings_gpt_provider",
+ help="Select the provider for the GPT model."
+ )
+
+ model = st.text_input(
+ "**Model**",
+ value="gemini-1.5-flash-latest",
+ key="settings_model",
+ help="Specify the model version to use from the selected provider."
+ )
+
+ temperature = st.slider(
+ "**Temperature**",
+ min_value=0.1,
+ max_value=1.0,
+ value=0.7,
+ step=0.1,
+ key="settings_temperature",
+ help="Controls the creativity level of the generated text."
+ )
+
+ max_tokens = st.selectbox(
+ "**Max Tokens**",
+ options=[500, 1000, 2000, 4000, 16000, 32000, 64000],
+ index=3,
+ key="settings_max_tokens",
+ help="Maximum length of the output sequence."
+ )
+
+ with col2:
+ top_p = st.slider(
+ "**Top-p**",
+ min_value=0.0,
+ max_value=1.0,
+ value=0.9,
+ step=0.1,
+ key="settings_top_p",
+ help="Controls diversity in text generation."
+ )
+
+ frequency_penalty = st.slider(
+ "**Frequency Penalty**",
+ min_value=0.0,
+ max_value=2.0,
+ value=1.0,
+ step=0.1,
+ key="settings_frequency_penalty",
+ help="Reduces word repetition in output."
+ )
+
+ # Search Settings Tab
+ with tabs[3]:
+ st.markdown("""
+
+
🔍 Search Engine Personalization
+
+ """, unsafe_allow_html=True)
+
+ col1, col2 = st.columns(2)
+
+ with col1:
+ geographic_location = st.selectbox(
+ "**Geographic Location**",
+ options=["us", "in", "fr", "cn"],
+ key="settings_geographic_location",
+ help="Select the geographic location for tailoring search results."
+ )
+
+ search_language = st.selectbox(
+ "**Search Language**",
+ options=["en", "zn-cn", "de", "hi"],
+ key="settings_search_language",
+ help="Select the language for the search results."
+ )
+
+ number_of_results = st.number_input(
+ "**Number of Results**",
+ value=10,
+ min_value=1,
+ max_value=20,
+ key="settings_number_of_results",
+ help="Specify the number of search results to retrieve."
+ )
+
+ with col2:
+ time_range = st.selectbox(
+ "**Time Range**",
+ options=["anytime", "past day", "past week", "past month", "past year"],
+ key="settings_time_range",
+ help="Select the time range for filtering search results."
+ )
+
+ include_domains = st.text_input(
+ "**Include Domains**",
+ value="",
+ key="settings_include_domains",
+ help="List specific domains to include in search results (comma-separated)."
+ )
+
+ similar_url = st.text_input(
+ "**Similar URL**",
+ value="",
+ key="settings_similar_url",
+ help="Provide a URL to find similar results."
+ )
+
+ # AI Personalization Tab
+ with tabs[4]:
+ st.markdown("""
+
+
🎨 AI Style Analysis
+
+ """, unsafe_allow_html=True)
+
+ st.markdown("""
+
+
+ Enter a website URL or provide content samples to analyze your writing style and get personalized recommendations for optimal AI content generation.
+
+
+ """, unsafe_allow_html=True)
+
+ # Create two columns for the layout
+ col1, col2 = st.columns([2, 1])
+
+ with col1:
+ # Website URL input
+ st.markdown("#### 🌐 Website URL Analysis")
+ url = st.text_input(
+ "Enter your website URL",
+ placeholder="https://example.com",
+ key="settings_website_url",
+ help="Provide your website URL to analyze your content style. Leave empty if you want to provide written samples instead."
+ )
+
+ # Alternative: Written samples
+ if not url:
+ st.markdown("#### 📝 Written Samples")
+ st.markdown("""
+
+
+ No website URL? No problem! You can provide written samples of your content instead.
+ Share your best articles, blog posts, or any content that represents your writing style.
+
+
+ """, unsafe_allow_html=True)
+ samples = st.text_area(
+ "Paste your content samples here",
+ key="settings_content_samples",
+ help="Paste 2-3 samples of your best content. This helps ALwrity understand your writing style.",
+ height=200
+ )
+
+ with col2:
+ st.markdown("#### 🎯 Analysis Features")
+ st.markdown("""
+
+
+
✨ Writing Style: Tone, voice, complexity analysis
+
📊 Content Analysis: Structure and vocabulary assessment
+
🎯 Audience Insights: Target demographic identification
+
⚙️ AI Recommendations: Personalized settings optimization
+
+
+ """, unsafe_allow_html=True)
+
+ # Add spacing between categories
+ st.markdown("", unsafe_allow_html=True)
+
+ if st.button("🎨 Analyze Writing Style", use_container_width=True, key="settings_analyze_style", type="primary"):
+ if url:
+ with st.status("Starting style analysis...", expanded=True) as status:
+ try:
+ # Step 1: Initialize crawler
+ status.update(label="Step 1/4: Initializing web crawler...", state="running")
+ crawler_service = AsyncWebCrawlerService()
+
+ # Step 2: Crawl website
+ status.update(label="Step 2/4: Crawling website content...", state="running")
+ loop = asyncio.new_event_loop()
+ asyncio.set_event_loop(loop)
+ result = loop.run_until_complete(crawler_service.crawl_website(url))
+ loop.close()
+
+ if result.get('success', False):
+ content = result.get('content', {})
+
+ # Step 3: Initialize style analyzer
+ status.update(label="Step 3/4: Analyzing content style...", state="running")
+ style_analyzer = StyleAnalyzer()
+
+ # Step 4: Perform style analysis
+ status.update(label="Step 4/4: Generating style recommendations...", state="running")
+ style_analysis = style_analyzer.analyze_content_style(content)
+
+ if style_analysis.get('error'):
+ status.update(label="Analysis failed", state="error")
+ st.error(f"Style analysis failed: {style_analysis['error']}")
+ else:
+ status.update(label="Analysis complete!", state="complete")
+ # Display style analysis results
+ display_style_analysis(style_analysis)
+
+ # Display original content in tabs
+ tab1, tab2, tab3 = st.tabs(["📄 Content", "📋 Metadata", "🔗 Links"])
+
+ with tab1:
+ st.markdown("#### Main Content")
+ st.markdown(f"""
+
+
+ {content.get('main_content', 'No content found')}
+
+
+ """, unsafe_allow_html=True)
+
+ with tab2:
+ st.markdown("#### Website Metadata")
+ st.markdown(f"""
+
+
+ Title:
+ {content.get('title', 'No title found')}
+
+
+ Description:
+ {content.get('description', 'No description found')}
+
+
+ """, unsafe_allow_html=True)
+
+ with tab3:
+ st.markdown("#### Extracted Links")
+ links = content.get('links', [])
+ if links:
+ for link in links[:10]: # Show first 10 links
+ st.markdown(f"""
+
+ """, unsafe_allow_html=True)
+ else:
+ st.markdown("No links found in the content.")
+ else:
+ status.update(label="Crawling failed", state="error")
+ st.error("Failed to crawl the website. Please check the URL and try again.")
+ except Exception as e:
+ status.update(label="Analysis failed", state="error")
+ st.error(f"An error occurred during analysis: {str(e)}")
+ elif samples:
+ with st.status("Starting style analysis...", expanded=True) as status:
+ try:
+ # Initialize style analyzer
+ status.update(label="Analyzing content style...", state="running")
+ style_analyzer = StyleAnalyzer()
+
+ # Perform style analysis
+ style_analysis = style_analyzer.analyze_content_style({"main_content": samples})
+
+ if style_analysis.get('error'):
+ status.update(label="Analysis failed", state="error")
+ st.error(f"Style analysis failed: {style_analysis['error']}")
+ else:
+ status.update(label="Analysis complete!", state="complete")
+ # Display style analysis results
+ display_style_analysis(style_analysis)
+ except Exception as e:
+ status.update(label="Analysis failed", state="error")
+ st.error(f"An error occurred during analysis: {str(e)}")
+ else:
+ st.warning("Please provide either a website URL or content samples to analyze.")
+
+ # Save Settings Button with premium styling
+ st.markdown("", unsafe_allow_html=True)
+ if st.button("💾 Save All Settings", type="primary", use_container_width=True, key="settings_save_button"):
+ # Save all settings to session state
+ st.session_state.update({
+ 'blog_length': blog_length,
+ 'blog_tone': blog_tone,
+ 'blog_demographic': blog_demographic,
+ 'blog_type': blog_type,
+ 'blog_language': blog_language,
+ 'blog_output_format': blog_output_format,
+ 'image_generation_model': image_generation_model,
+ 'number_of_blog_images': number_of_blog_images,
+ 'gpt_provider': gpt_provider,
+ 'model': model,
+ 'temperature': temperature,
+ 'top_p': top_p,
+ 'max_tokens': max_tokens,
+ 'frequency_penalty': frequency_penalty,
+ 'geographic_location': geographic_location,
+ 'search_language': search_language,
+ 'number_of_results': number_of_results,
+ 'time_range': time_range,
+ 'include_domains': include_domains,
+ 'similar_url': similar_url
+ })
+ st.success("✅ Settings saved successfully! Your preferences have been applied to all AI tools.")
+
+ # Show a summary of saved settings
+ st.markdown("""
+
+
📋 Settings Summary
+
+
Content: {length} words, {tone} tone, {audience} audience
+
Images: {images} images using {model}
+
AI Model: {provider} - {ai_model}
+
Search: {location} region, {results} results
+
+
+ """.format(
+ length=blog_length,
+ tone=blog_tone,
+ audience=blog_demographic,
+ images=number_of_blog_images,
+ model=image_generation_model,
+ provider=gpt_provider,
+ ai_model=model,
+ location=geographic_location,
+ results=number_of_results
+ ), unsafe_allow_html=True)
\ No newline at end of file
diff --git a/lib/alwrity_ui/social_media_dashboard.py b/lib/alwrity_ui/social_media_dashboard.py
new file mode 100644
index 00000000..6256947b
--- /dev/null
+++ b/lib/alwrity_ui/social_media_dashboard.py
@@ -0,0 +1,116 @@
+import streamlit as st
+from lib.alwrity_ui.dashboard_styles import apply_dashboard_style, render_dashboard_header, render_card
+from loguru import logger
+
+def render_social_tools_dashboard():
+ """Render the social media tools dashboard with premium glassmorphic design."""
+ logger.info("Starting Social Media Tools Dashboard")
+
+ # Apply common dashboard styling
+ apply_dashboard_style()
+
+ # Render dashboard header
+ render_dashboard_header(
+ "📱 AI Social Media Tools",
+ "Create engaging social media content across all major platforms with our specialized AI writers. From viral posts to professional updates, we've got you covered."
+ )
+
+ # Define social tools with enhanced details and platform-specific styling
+ social_tools = {
+ "Facebook": {
+ "icon": "📘",
+ "description": "Create engaging Facebook posts, stories, and ads that drive meaningful interactions and build community",
+ "category": "Social Network",
+ "path": "facebook",
+ "features": ["Post Generation", "Story Creation", "Ad Copy", "Community Management"]
+ },
+ "LinkedIn": {
+ "icon": "💼",
+ "description": "Generate professional LinkedIn content, articles, and networking posts that enhance your career presence",
+ "category": "Professional",
+ "path": "linkedin",
+ "features": ["Professional Posts", "Article Writing", "Network Building", "Career Content"]
+ },
+ "Twitter": {
+ "icon": "🐦",
+ "description": "Craft viral tweets, threads, and engaging content that sparks conversations and grows your following",
+ "category": "Microblogging",
+ "path": "twitter",
+ "features": ["Tweet Generation", "Thread Creation", "Hashtag Strategy", "Viral Content"]
+ },
+ "Instagram": {
+ "icon": "📸",
+ "description": "Create captivating Instagram captions, stories, and content that showcases your brand beautifully",
+ "category": "Visual Content",
+ "path": "instagram",
+ "features": ["Caption Writing", "Story Content", "Hashtag Research", "Visual Strategy"]
+ },
+ "YouTube": {
+ "icon": "🎥",
+ "description": "Generate compelling video scripts, descriptions, and content strategies for your YouTube channel",
+ "category": "Video Content",
+ "path": "youtube",
+ "features": ["Script Writing", "Video Descriptions", "SEO Optimization", "Content Planning"]
+ }
+ }
+
+ # Create a responsive grid of premium cards
+ cols = st.columns(3)
+ for idx, (platform, details) in enumerate(social_tools.items()):
+ with cols[idx % 3]:
+ # Use the common card renderer
+ if render_card(
+ icon=details['icon'],
+ title=platform,
+ description=details['description'],
+ category=details['category'],
+ key_suffix=f"social_{platform}",
+ help_text=f"Open {platform} content creation tools - {details['description'][:50]}..."
+ ):
+ # Set query parameters to redirect to the specific tool
+ st.query_params["tool"] = details["path"]
+ st.rerun()
+
+ # Add feature showcase section
+ st.markdown("""
+
+
+
+ """, unsafe_allow_html=True)
+
+ # Feature grid
+ feature_cols = st.columns(2)
+ features = [
+ {
+ "title": "🎯 Smart Content Generation",
+ "description": "AI-powered content creation tailored to each platform's unique audience and format requirements."
+ },
+ {
+ "title": "📊 Engagement Optimization",
+ "description": "Data-driven insights and suggestions to maximize likes, shares, comments, and overall engagement."
+ },
+ {
+ "title": "🕒 Optimal Timing",
+ "description": "AI recommendations for the best times to post based on your audience's activity patterns."
+ },
+ {
+ "title": "🔍 Hashtag Intelligence",
+ "description": "Smart hashtag suggestions and trending topic analysis to increase your content's discoverability."
+ }
+ ]
+
+ for idx, feature in enumerate(features):
+ with feature_cols[idx % 2]:
+ st.markdown(f"""
+
+
+
+
{feature['title']}
+
{feature['description']}
+
+
+
+ """, unsafe_allow_html=True)
\ No newline at end of file
diff --git a/lib/utils/seo_tools.py b/lib/utils/seo_tools.py
deleted file mode 100644
index fc462b48..00000000
--- a/lib/utils/seo_tools.py
+++ /dev/null
@@ -1,439 +0,0 @@
-import streamlit as st
-from lib.ai_seo_tools.seo_structured_data import ai_structured_data
-from lib.ai_seo_tools.content_title_generator import ai_title_generator
-from lib.ai_seo_tools.meta_desc_generator import metadesc_generator_main
-from lib.ai_seo_tools.image_alt_text_generator import alt_text_gen
-from lib.ai_seo_tools.opengraph_generator import og_tag_generator
-from lib.ai_seo_tools.optimize_images_for_upload import main_img_optimizer
-from lib.ai_seo_tools.google_pagespeed_insights import google_pagespeed_insights
-from lib.ai_seo_tools.on_page_seo_analyzer import analyze_onpage_seo
-from lib.ai_seo_tools.weburl_seo_checker import url_seo_checker
-from lib.ai_marketing_tools.ai_backlinker.backlinking_ui_streamlit import backlinking_ui
-from lib.ai_seo_tools.content_gap_analysis.ui import ContentGapAnalysisUI
-from lib.ai_seo_tools.content_calendar.ui.dashboard import ContentCalendarDashboard
-
-def render_content_gap_analysis():
- """Render the content gap analysis workflow interface."""
- from lib.ai_seo_tools.content_gap_analysis.ui import ContentGapAnalysisUI
-
- # Initialize and run the Content Gap Analysis UI
- ui = ContentGapAnalysisUI()
- ui.run()
-
-def render_content_calendar():
- """Render the content calendar dashboard."""
- import logging
- import sys
- from datetime import datetime
-
- # Configure logging
- logging.basicConfig(
- level=logging.DEBUG,
- format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
- handlers=[
- logging.StreamHandler(sys.stdout),
- logging.FileHandler('content_calendar.log', mode='a')
- ]
- )
- logger = logging.getLogger('content_calendar')
-
- try:
- logger.info("Initializing Content Calendar Dashboard")
- dashboard = ContentCalendarDashboard()
- logger.info("Rendering Content Calendar Dashboard")
- dashboard.render()
- logger.info("Content Calendar Dashboard rendered successfully")
- except Exception as e:
- logger.error(f"Error rendering content calendar: {str(e)}", exc_info=True)
- st.error(f"An error occurred while loading the content calendar: {str(e)}")
-
-def render_seo_tools_dashboard():
- """Render a modern dashboard for SEO tools with improved UI and navigation."""
- selected_section = st.session_state.get('seo_dashboard_section', 'combinations')
-
- # Define card gradients at the top so it's available in all sections
- card_gradients = {
- "Content Optimization Suite": "linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)",
- "Technical SEO Audit": "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
- "Image Optimization Suite": "linear-gradient(135deg, #f7971e 0%, #ffd200 100%)",
- "Social Media Optimization": "linear-gradient(135deg, #f953c6 0%, #b91d73 100%)",
- "Content Gap Analysis": "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
- "Content Calendar": "linear-gradient(135deg, #4CAF50 0%, #2196F3 100%)",
- "Structured Data Generator": "linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)",
- "Blog Title Generator": "linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%)",
- "Meta Description Generator": "linear-gradient(135deg, #f7971e 0%, #ffd200 100%)",
- "Image Alt Text Generator": "linear-gradient(135deg, #f953c6 0%, #b91d73 100%)",
- "OpenGraph Tags Generator": "linear-gradient(135deg, #f857a6 0%, #ff5858 100%)",
- "Image Optimizer": "linear-gradient(135deg, #43cea2 0%, #185a9d 100%)",
- "PageSpeed Insights": "linear-gradient(135deg, #ff9966 0%, #ff5e62 100%)",
- "On-Page SEO Analyzer": "linear-gradient(135deg, #56ab2f 0%, #a8e063 100%)",
- "URL SEO Checker": "linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%)",
- "AI Backlinking Tool": "linear-gradient(135deg, #e96443 0%, #904e95 100%)"
- }
-
- # Navigation bar only (no dashboard title/description)
- nav_cols = st.columns([1,1,1,1])
- nav_labels = ["Tool Combos", "Advanced", "Individual", "About"]
- nav_keys = ["combinations", "advanced", "individual", "about"]
- for i, label in enumerate(nav_labels):
- if nav_cols[i].button(label, key=f"nav_{label}"):
- st.session_state['seo_dashboard_section'] = nav_keys[i]
- selected_section = nav_keys[i]
-
- st.markdown("
", unsafe_allow_html=True)
-
- # Define tool combinations for cross-tool analysis
- tool_combinations = {
- "Content Optimization Suite": {
- "icon": "📊",
- "description": "Comprehensive content optimization combining title generation, meta descriptions, and structured data.",
- "tools": ["Blog Title Generator", "Meta Description Generator", "Structured Data Generator"],
- "path": "content_optimization",
- "color": "#4CAF50"
- },
- "Technical SEO Audit": {
- "icon": "🔧",
- "description": "Complete technical SEO analysis including page speed, on-page SEO, and URL structure.",
- "tools": ["PageSpeed Insights", "On-Page SEO Analyzer", "URL SEO Checker"],
- "path": "technical_audit",
- "color": "#2196F3"
- },
- "Image Optimization Suite": {
- "icon": "🖼️",
- "description": "End-to-end image optimization with alt text generation and performance optimization.",
- "tools": ["Image Alt Text Generator", "Image Optimizer"],
- "path": "image_optimization",
- "color": "#FF9800"
- },
- "Social Media Optimization": {
- "icon": "📱",
- "description": "Enhance social media presence with OpenGraph tags and backlink analysis.",
- "tools": ["OpenGraph Tags Generator", "AI Backlinking Tool"],
- "path": "social_optimization",
- "color": "#9C27B0"
- }
- }
-
- # Define individual SEO tools
- seo_tools = {
- "Structured Data Generator": {
- "icon": "📋",
- "description": "Generate structured data (Rich Snippets) to enhance your search results with additional information.",
- "color": "#4CAF50",
- "path": "structured_data",
- "status": "active"
- },
- "Blog Title Generator": {
- "icon": "✏️",
- "description": "Create SEO-optimized blog titles that attract clicks and improve search rankings.",
- "color": "#2196F3",
- "path": "blog_title",
- "status": "active"
- },
- "Meta Description Generator": {
- "icon": "📝",
- "description": "Generate compelling meta descriptions that improve click-through rates from search results.",
- "color": "#FF9800",
- "path": "meta_description",
- "status": "active"
- },
- "Image Alt Text Generator": {
- "icon": "🖼️",
- "description": "Create descriptive alt text for images to improve accessibility and image SEO.",
- "color": "#9C27B0",
- "path": "alt_text",
- "status": "active"
- },
- "OpenGraph Tags Generator": {
- "icon": "📱",
- "description": "Generate OpenGraph tags for better social media sharing and visibility.",
- "color": "#F44336",
- "path": "opengraph",
- "status": "active"
- },
- "Image Optimizer": {
- "icon": "📉",
- "description": "Optimize and resize images for better website performance and SEO.",
- "color": "#607D8B",
- "path": "image_optimizer",
- "status": "active"
- },
- "PageSpeed Insights": {
- "icon": "⚡",
- "description": "Analyze your website's performance using Google PageSpeed Insights.",
- "color": "#795548",
- "path": "pagespeed",
- "status": "active"
- },
- "On-Page SEO Analyzer": {
- "icon": "🔍",
- "description": "Analyze and optimize your webpage's SEO elements and content.",
- "color": "#009688",
- "path": "onpage_seo",
- "status": "active"
- },
- "URL SEO Checker": {
- "icon": "🌐",
- "description": "Check the SEO health of specific URLs and get improvement suggestions.",
- "color": "#3F51B5",
- "path": "url_checker",
- "status": "active"
- },
- "AI Backlinking Tool": {
- "icon": "🔗",
- "description": "Discover and analyze backlink opportunities using AI-powered insights.",
- "color": "#E91E63",
- "path": "backlinking",
- "status": "active"
- }
- }
-
- # --- Tool Combinations Section ---
- if selected_section == 'combinations':
- combo_cols = st.columns(2)
- for idx, (combo_name, details) in enumerate(tool_combinations.items()):
- gradient = card_gradients.get(combo_name, "linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%)")
- with combo_cols[idx % 2]:
- st.markdown(f"""
-
-
-
{details['icon']}
-
{combo_name}
-
{details['description']}
-
- {''.join([f'{tool}' for tool in details['tools']])}
-
-
- """, unsafe_allow_html=True)
- if st.button(f"Launch {combo_name}", key=f"combo_{combo_name}", use_container_width=True):
- st.query_params["tool"] = details["path"]
- st.rerun()
-
- # --- Advanced Features Section ---
- elif selected_section == 'advanced':
- adv_cols = st.columns(2)
- adv_features = [
- {
- "name": "Content Gap Analysis",
- "icon": "🎯",
- "description": "Identify content opportunities and optimize your content strategy with AI-powered insights.",
- "badges": ["Website Analysis", "Competitor Research", "Keyword Opportunities", "AI Recommendations"],
- "gradient": card_gradients["Content Gap Analysis"],
- "button": "Start Content Gap Analysis",
- "key": "content_gap_analysis",
- "path": "content_gap_analysis"
- },
- {
- "name": "Content Calendar",
- "icon": "📅",
- "description": "Plan, schedule, and manage your content strategy with our AI-powered content calendar.",
- "badges": ["Content Planning", "Scheduling", "Performance Tracking", "AI Insights"],
- "gradient": card_gradients["Content Calendar"],
- "button": "Open Content Calendar",
- "key": "content_calendar",
- "path": "content_calendar"
- }
- ]
- for idx, feature in enumerate(adv_features):
- with adv_cols[idx % 2]:
- st.markdown(f"""
-
-
-
{feature['icon']}
-
{feature['name']}
-
{feature['description']}
-
- {''.join([f'{badge}' for badge in feature['badges']])}
-
-
- """, unsafe_allow_html=True)
- if st.button(feature['button'], key=feature['key'], use_container_width=True):
- st.query_params["tool"] = feature["path"]
- st.rerun()
-
- # --- Individual Tools Section ---
- elif selected_section == 'individual':
- cols = st.columns(3)
- for idx, (tool_name, details) in enumerate(seo_tools.items()):
- gradient = card_gradients.get(tool_name, "linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%)")
- with cols[idx % 3]:
- st.markdown(f"""
-
-
-
{details['icon']}
-
{tool_name}
-
{details['description']}
-
- """, unsafe_allow_html=True)
- if st.button(f"Use {tool_name}", key=f"btn_{tool_name}", use_container_width=True):
- st.query_params["tool"] = details["path"]
- st.rerun()
-
- # --- About Section ---
- elif selected_section == 'about':
- st.markdown("""
-
-
About This Dashboard
-
This dashboard brings together powerful AI-driven SEO tools and workflows to help you optimize your website and content strategy. Use the navigation above to explore combinations, advanced features, or individual tools.
-
- """, unsafe_allow_html=True)
-
- st.markdown("""
-
- """, unsafe_allow_html=True)
-
-def ai_seo_tools():
- """
- A collection of AI-powered SEO tools for content creators, providing various options
- such as generating structured data, optimizing images, checking page speed,
- and analyzing on-page SEO.
- """
- # Check if a specific tool is selected
- selected_tool = st.query_params.get("tool")
-
- if selected_tool:
- # Map tool paths to their respective functions
- tool_functions = {
- # Individual tools
- "structured_data": ai_structured_data,
- "blog_title": ai_title_generator,
- "meta_description": metadesc_generator_main,
- "alt_text": alt_text_gen,
- "opengraph": og_tag_generator,
- "image_optimizer": main_img_optimizer,
- "pagespeed": google_pagespeed_insights,
- "onpage_seo": analyze_onpage_seo,
- "url_checker": url_seo_checker,
- "backlinking": backlinking_ui,
-
- # Tool combinations
- "content_optimization": lambda: run_tool_combination([
- ai_title_generator,
- metadesc_generator_main,
- ai_structured_data
- ], "Content Optimization Suite"),
- "technical_audit": lambda: run_tool_combination([
- google_pagespeed_insights,
- analyze_onpage_seo,
- url_seo_checker
- ], "Technical SEO Audit"),
- "image_optimization": lambda: run_tool_combination([
- alt_text_gen,
- main_img_optimizer
- ], "Image Optimization Suite"),
- "social_optimization": lambda: run_tool_combination([
- og_tag_generator,
- backlinking_ui
- ], "Social Media Optimization"),
-
- # Add Content Gap Analysis and Content Calendar
- "content_gap_analysis": render_content_gap_analysis,
- "content_calendar": render_content_calendar
- }
-
- if selected_tool in tool_functions:
- # Clear any existing content
- st.empty()
- # Execute the selected tool's function
- tool_functions[selected_tool]()
- else:
- st.error(f"Invalid tool selected: {selected_tool}")
- render_seo_tools_dashboard()
- else:
- # Show the dashboard if no tool is selected
- render_seo_tools_dashboard()
-
-def run_tool_combination(tools, combination_name):
- """Run a combination of tools and provide cross-tool analysis."""
- st.markdown(f"# {combination_name}")
- st.markdown("Running comprehensive analysis...")
-
- # Create tabs for each tool in the combination
- tabs = st.tabs([f"Step {i+1}" for i in range(len(tools))])
-
- # Run each tool in its own tab
- for i, (tab, tool) in enumerate(zip(tabs, tools)):
- with tab:
- st.markdown(f"### Step {i+1}")
- tool()
-
- # Add cross-tool analysis section
- st.markdown("## 📊 Cross-Tool Analysis")
- st.markdown("Analyzing results across all tools...")
-
- # Add recommendations based on combined results
- st.markdown("## 💡 Recommendations")
- st.markdown("Based on the combined analysis, here are the key recommendations:")
-
- # Add a button to export the complete analysis
- if st.button("📥 Export Complete Analysis", use_container_width=True):
- st.info("Analysis export functionality coming soon!")
diff --git a/lib/utils/settings_page.py b/lib/utils/settings_page.py
deleted file mode 100644
index 74f2b9a8..00000000
--- a/lib/utils/settings_page.py
+++ /dev/null
@@ -1,438 +0,0 @@
-import streamlit as st
-from loguru import logger
-import asyncio
-from lib.web_crawlers.async_web_crawler import AsyncWebCrawlerService
-from lib.personalization.style_analyzer import StyleAnalyzer
-import sys
-
-# Configure logger
-logger.remove() # Remove default handler
-logger.add(
- "logs/settings_page.log",
- rotation="500 MB",
- retention="10 days",
- level="DEBUG",
- format="{time:YYYY-MM-DD HH:mm:ss} | {level} | {message}",
- backtrace=True,
- diagnose=True
-)
-logger.add(
- sys.stdout,
- level="INFO",
- format="{time:YYYY-MM-DD HH:mm:ss} | {level: <8} | {message}"
-)
-
-def display_style_analysis(analysis_results: dict):
- """Display the style analysis results in a structured format."""
- try:
- # Writing Style Section
- st.markdown("### 🎨 Writing Style Analysis")
- writing_style = analysis_results.get("writing_style", {})
- writing_style_content = f"""
-
- - Tone: {writing_style.get("tone", "N/A")}
- - Voice: {writing_style.get("voice", "N/A")}
- - Complexity: {writing_style.get("complexity", "N/A")}
- - Engagement Level: {writing_style.get("engagement_level", "N/A")}
-
- """
- st.markdown(writing_style_content, unsafe_allow_html=True)
-
- # Content Characteristics Section
- content_chars = analysis_results.get("content_characteristics", {})
- content_chars_content = f"""
-
- - Sentence Structure: {content_chars.get("sentence_structure", "N/A")}
- - Vocabulary Level: {content_chars.get("vocabulary_level", "N/A")}
- - Paragraph Organization: {content_chars.get("paragraph_organization", "N/A")}
- - Content Flow: {content_chars.get("content_flow", "N/A")}
-
- """
- st.markdown(content_chars_content, unsafe_allow_html=True)
-
- # Target Audience Section
- target_audience = analysis_results.get("target_audience", {})
- target_audience_content = f"""
-
- - Demographics: {', '.join(target_audience.get("demographics", ["N/A"]))}
- - Expertise Level: {target_audience.get("expertise_level", "N/A")}
- - Industry Focus: {target_audience.get("industry_focus", "N/A")}
- - Geographic Focus: {target_audience.get("geographic_focus", "N/A")}
-
- """
- st.markdown(target_audience_content, unsafe_allow_html=True)
-
- # Content Type Section
- content_type = analysis_results.get("content_type", {})
- content_type_content = f"""
-
- - Primary Type: {content_type.get("primary_type", "N/A")}
- - Secondary Types: {', '.join(content_type.get("secondary_types", ["N/A"]))}
- - Purpose: {content_type.get("purpose", "N/A")}
- - Call to Action: {content_type.get("call_to_action", "N/A")}
-
- """
- st.markdown(content_type_content, unsafe_allow_html=True)
-
- # Recommended Settings Section
- recommended = analysis_results.get("recommended_settings", {})
- recommended_content = f"""
-
- - Writing Tone: {recommended.get("writing_tone", "N/A")}
- - Target Audience: {recommended.get("target_audience", "N/A")}
- - Content Type: {recommended.get("content_type", "N/A")}
- - Creativity Level: {recommended.get("creativity_level", "N/A")}
- - Geographic Location: {recommended.get("geographic_location", "N/A")}
-
- """
- st.markdown(recommended_content, unsafe_allow_html=True)
-
- except Exception as e:
- logger.error(f"Error displaying style analysis: {str(e)}")
- st.error(f"Error displaying analysis results: {str(e)}")
-
-def render_settings_page():
- """Renders the settings page with all configuration options in tabs"""
- st.title("🛠️ Settings & Configuration")
-
- # Create tabs for different settings categories
- tabs = st.tabs([
- "👷 Content",
- "🩻 Images",
- "🤖 LLM",
- "🕵️ Search",
- "🎨 AI Personalization"
- ])
-
- # Content Settings Tab
- with tabs[0]:
- st.header("Content Personalization")
- blog_length = st.text_input(
- "**Content Length (words)**",
- value="2000",
- key="settings_blog_length",
- help="Approximate word count for blogs. Note: Actual length may vary based on GPT provider and max token count."
- )
-
- blog_tone_options = ["Casual", "Professional", "How-to", "Beginner", "Research", "Programming", "Social Media", "Customize"]
- blog_tone = st.selectbox(
- "**Content Tone**",
- options=blog_tone_options,
- key="settings_blog_tone",
- help="Select the desired tone for the blog content."
- )
-
- if blog_tone == "Customize":
- custom_tone = st.text_input(
- "Enter the tone of your content",
- key="settings_custom_tone",
- help="Specify the tone of your content."
- )
- if custom_tone:
- blog_tone = custom_tone
- else:
- st.warning("Please specify the tone of your content.")
-
- blog_demographic_options = ["Professional", "Gen-Z", "Tech-savvy", "Student", "Digital Marketing", "Customize"]
- blog_demographic = st.selectbox(
- "**Target Audience**",
- options=blog_demographic_options,
- key="settings_blog_demographic",
- help="Select the primary audience for the blog content."
- )
-
- blog_type = st.selectbox(
- "**Content Type**",
- options=["Informational", "Commercial", "Company", "News", "Finance", "Competitor", "Programming", "Scholar"],
- key="settings_blog_type",
- help="Select the category that best describes the blog content."
- )
-
- blog_language = st.selectbox(
- "**Content Language**",
- options=["English", "Spanish", "German", "Chinese", "Arabic", "Nepali", "Hindi", "Hindustani", "Customize"],
- key="settings_blog_language",
- help="Select the language in which the blog will be written."
- )
-
- blog_output_format = st.selectbox(
- "**Content Output Format**",
- options=["markdown", "HTML", "plaintext"],
- key="settings_blog_output_format",
- help="Select the format for the blog output."
- )
-
- # Images Settings Tab
- with tabs[1]:
- st.header("Images Personalization")
- image_generation_model = st.selectbox(
- "**Image Generation Model**",
- options=["stable-diffusion", "dalle2", "dalle3"],
- key="settings_image_model",
- help="Select the model to generate images for the blog."
- )
-
- number_of_blog_images = st.number_input(
- "**Number of Blog Images**",
- value=1,
- min_value=1,
- max_value=10,
- key="settings_number_of_images",
- help="Specify the number of images to include in the blog."
- )
-
- # LLM Settings Tab
- with tabs[2]:
- st.header("LLM Personalization")
- gpt_provider = st.selectbox(
- "**GPT Provider**",
- options=["google", "openai", "minstral"],
- key="settings_gpt_provider",
- help="Select the provider for the GPT model."
- )
-
- model = st.text_input(
- "**Model**",
- value="gemini-1.5-flash-latest",
- key="settings_model",
- help="Specify the model version to use from the selected provider."
- )
-
- col1, col2 = st.columns(2)
- with col1:
- temperature = st.slider(
- "Temperature",
- min_value=0.1,
- max_value=1.0,
- value=0.7,
- step=0.1,
- key="settings_temperature",
- help="Controls the creativity level of the generated text."
- )
-
- max_tokens = st.selectbox(
- "Max Tokens",
- options=[500, 1000, 2000, 4000, 16000, 32000, 64000],
- index=3,
- key="settings_max_tokens",
- help="Maximum length of the output sequence."
- )
-
- with col2:
- top_p = st.slider(
- "Top-p",
- min_value=0.0,
- max_value=1.0,
- value=0.9,
- step=0.1,
- key="settings_top_p",
- help="Controls diversity in text generation."
- )
-
- frequency_penalty = st.slider(
- "Frequency Penalty",
- min_value=0.0,
- max_value=2.0,
- value=1.0,
- step=0.1,
- key="settings_frequency_penalty",
- help="Reduces word repetition in output."
- )
-
- # Search Settings Tab
- with tabs[3]:
- st.header("Search Engine Personalization")
- geographic_location = st.selectbox(
- "**Geographic Location**",
- options=["us", "in", "fr", "cn"],
- key="settings_geographic_location",
- help="Select the geographic location for tailoring search results."
- )
-
- search_language = st.selectbox(
- "**Search Language**",
- options=["en", "zn-cn", "de", "hi"],
- key="settings_search_language",
- help="Select the language for the search results."
- )
-
- number_of_results = st.number_input(
- "**Number of Results**",
- value=10,
- min_value=1,
- max_value=20,
- key="settings_number_of_results",
- help="Specify the number of search results to retrieve."
- )
-
- time_range = st.selectbox(
- "**Time Range**",
- options=["anytime", "past day", "past week", "past month", "past year"],
- key="settings_time_range",
- help="Select the time range for filtering search results."
- )
-
- include_domains = st.text_input(
- "**Include Domains**",
- value="",
- key="settings_include_domains",
- help="List specific domains to include in search results (comma-separated)."
- )
-
- similar_url = st.text_input(
- "**Similar URL**",
- value="",
- key="settings_similar_url",
- help="Provide a URL to find similar results."
- )
-
- # AI Personalization Tab
- with tabs[4]:
- st.header("🎨 AI Style Analysis")
- st.markdown("""
-
-
Enter a website URL or provide content samples to analyze your writing style and get personalized recommendations.
-
- """, unsafe_allow_html=True)
-
- # Create two columns for the layout
- col1, col2 = st.columns([2, 1])
-
- with col1:
- # Website URL input
- st.markdown("### Website URL")
- url = st.text_input(
- "Enter your website URL",
- placeholder="https://example.com",
- key="settings_website_url",
- help="Provide your website URL to analyze your content style. Leave empty if you want to provide written samples instead."
- )
-
- # Alternative: Written samples
- if not url:
- st.markdown("### Written Samples")
- st.markdown("""
-
-
No website URL? No problem! You can provide written samples of your content instead.
-
Share your best articles, blog posts, or any content that represents your writing style.
-
- """, unsafe_allow_html=True)
- samples = st.text_area(
- "Paste your content samples here",
- key="settings_content_samples",
- help="Paste 2-3 samples of your best content. This helps ALwrity understand your writing style."
- )
-
- # ALwrity Style button
- st.markdown("", unsafe_allow_html=True)
- if st.button("🎨 Analyze Style", use_container_width=True, key="settings_analyze_style"):
- if url:
- with st.status("Starting style analysis...", expanded=True) as status:
- try:
- # Step 1: Initialize crawler
- status.update(label="Step 1/4: Initializing web crawler...", state="running")
- crawler_service = AsyncWebCrawlerService()
-
- # Step 2: Crawl website
- status.update(label="Step 2/4: Crawling website content...", state="running")
- loop = asyncio.new_event_loop()
- asyncio.set_event_loop(loop)
- result = loop.run_until_complete(crawler_service.crawl_website(url))
- loop.close()
-
- if result.get('success', False):
- content = result.get('content', {})
-
- # Step 3: Initialize style analyzer
- status.update(label="Step 3/4: Analyzing content style...", state="running")
- style_analyzer = StyleAnalyzer()
-
- # Step 4: Perform style analysis
- status.update(label="Step 4/4: Generating style recommendations...", state="running")
- style_analysis = style_analyzer.analyze_content_style(content)
-
- if style_analysis.get('error'):
- status.update(label="Analysis failed", state="error")
- st.error(f"Style analysis failed: {style_analysis['error']}")
- else:
- status.update(label="Analysis complete!", state="complete")
- # Display style analysis results
- display_style_analysis(style_analysis)
-
- # Display original content in tabs
- tab1, tab2, tab3 = st.tabs(["Content", "Metadata", "Links"])
-
- with tab1:
- st.markdown("### Main Content")
- st.markdown(content.get('main_content', 'No content found'))
-
- with tab2:
- st.markdown("### Metadata")
- st.markdown(f"""
- **Title:** {content.get('title', 'No title found')}
-
- **Description:** {content.get('description', 'No description found')}
-
- **Meta Tags:**
- {content.get('meta_tags', {})}
- """)
-
- with tab3:
- st.markdown("### Links")
- for link in content.get('links', []):
- st.markdown(f"- [{link.get('text', '')}]({link.get('href', '')})")
- else:
- status.update(label="Crawling failed", state="error")
- st.error("Failed to crawl the website. Please check the URL and try again.")
- except Exception as e:
- status.update(label="Analysis failed", state="error")
- st.error(f"An error occurred during analysis: {str(e)}")
- elif samples:
- with st.status("Starting style analysis...", expanded=True) as status:
- try:
- # Initialize style analyzer
- status.update(label="Analyzing content style...", state="running")
- style_analyzer = StyleAnalyzer()
-
- # Perform style analysis
- style_analysis = style_analyzer.analyze_content_style({"main_content": samples})
-
- if style_analysis.get('error'):
- status.update(label="Analysis failed", state="error")
- st.error(f"Style analysis failed: {style_analysis['error']}")
- else:
- status.update(label="Analysis complete!", state="complete")
- # Display style analysis results
- display_style_analysis(style_analysis)
- except Exception as e:
- status.update(label="Analysis failed", state="error")
- st.error(f"An error occurred during analysis: {str(e)}")
- else:
- st.warning("Please provide either a website URL or content samples to analyze.")
-
- # Save Settings Button
- if st.button("💾 Save Settings", type="primary", use_container_width=True, key="settings_save_button"):
- # Save all settings to session state
- st.session_state.update({
- 'blog_length': blog_length,
- 'blog_tone': blog_tone,
- 'blog_demographic': blog_demographic,
- 'blog_type': blog_type,
- 'blog_language': blog_language,
- 'blog_output_format': blog_output_format,
- 'image_generation_model': image_generation_model,
- 'number_of_blog_images': number_of_blog_images,
- 'gpt_provider': gpt_provider,
- 'model': model,
- 'temperature': temperature,
- 'top_p': top_p,
- 'max_tokens': max_tokens,
- 'frequency_penalty': frequency_penalty,
- 'geographic_location': geographic_location,
- 'search_language': search_language,
- 'number_of_results': number_of_results,
- 'time_range': time_range,
- 'include_domains': include_domains,
- 'similar_url': similar_url
- })
- st.success("✅ Settings saved successfully!")
\ No newline at end of file
diff --git a/lib/utils/ui_setup.py b/lib/utils/ui_setup.py
index 56141acf..6e60654e 100644
--- a/lib/utils/ui_setup.py
+++ b/lib/utils/ui_setup.py
@@ -8,8 +8,9 @@ import streamlit as st
from lib.utils.file_processor import load_image
from lib.utils.content_generators import content_planning_tools
from lib.utils.alwrity_utils import ai_social_writer
-from lib.utils.seo_tools import ai_seo_tools
-from lib.utils.settings_page import render_settings_page
+from lib.alwrity_ui.seo_tools_dashboard import ai_seo_tools
+from lib.alwrity_ui.settings_page import render_settings_page
+from lib.alwrity_ui.navigation_styles import apply_navigation_styles, apply_compact_layout
from loguru import logger
# Import social media writer functions
@@ -20,378 +21,13 @@ from lib.ai_writers.insta_ai_writer import insta_writer
from lib.ai_writers.youtube_writers.youtube_ai_writer import youtube_main_menu
from lib.ai_writers.ai_writer_dashboard import get_ai_writers, list_ai_writers
from lib.chatbot_custom.enhanced_alwrity_chatbot import run_enhanced_chatbot
+from lib.alwrity_ui.social_media_dashboard import render_social_tools_dashboard
-def render_social_tools_dashboard():
- """Render a modern dashboard for social media tools."""
- st.markdown("""
-
- """, unsafe_allow_html=True)
-
- # Define social tools with their details and paths
- social_tools = {
- "Facebook": {
- "icon": "📘",
- "description": "Create engaging Facebook posts and manage your content strategy",
- "color": "#4267B2",
- "path": "facebook"
- },
- "LinkedIn": {
- "icon": "💼",
- "description": "Generate professional LinkedIn content and optimize your profile",
- "color": "#0077B5",
- "path": "linkedin"
- },
- "Twitter": {
- "icon": "🐦",
- "description": "Craft viral tweets and manage your Twitter presence",
- "color": "#1DA1F2",
- "path": "twitter"
- },
- "Instagram": {
- "icon": "📸",
- "description": "Create Instagram captions and plan your visual content",
- "color": "#E1306C",
- "path": "instagram"
- },
- "YouTube": {
- "icon": "🎥",
- "description": "Generate video scripts and optimize your YouTube content",
- "color": "#FF0000",
- "path": "youtube"
- }
- }
-
- # Create a grid of cards
- cols = st.columns(3)
- for idx, (platform, details) in enumerate(social_tools.items()):
- with cols[idx % 3]:
- st.markdown(f"""
-
-
{details['icon']}
-
{platform}
-
{details['description']}
-
- """, unsafe_allow_html=True)
-
- if st.button(f"Open {platform}", key=f"btn_{platform}",
- help=f"Launch {platform} tools",
- use_container_width=True):
- # Set query parameters to redirect to the specific tool
- st.query_params["tool"] = details["path"]
- st.rerun()
def setup_ui():
"""Set up the UI with custom styling."""
- # Add custom CSS
- st.markdown("""
-
- """, unsafe_allow_html=True)
+ # Apply navigation-specific styling
+ apply_navigation_styles()
def setup_alwrity_ui():
@@ -475,14 +111,8 @@ def setup_alwrity_ui():
render_social_tools_dashboard()
else:
# Show the dashboard if no tool is selected
- st.markdown("""
-
- """, unsafe_allow_html=True)
- st.title(f"{nav_items[st.session_state.active_tab][0]} {st.session_state.active_tab}")
+ apply_compact_layout()
+ logger.info(f"{nav_items[st.session_state.active_tab][0]} {st.session_state.active_tab}")
render_social_tools_dashboard()
else:
# Handle other tabs as before
@@ -511,15 +141,8 @@ def setup_alwrity_ui():
logger.info("No writer selected, showing dashboard")
get_ai_writers()
else:
- st.markdown("""
-
- """, unsafe_allow_html=True)
- st.title(f"{nav_items[st.session_state.active_tab][0]} {st.session_state.active_tab}")
+ apply_compact_layout()
+ logger.info(f"{nav_items[st.session_state.active_tab][0]} {st.session_state.active_tab}")
nav_items[st.session_state.active_tab][1]()
logger.info("Finished setting up ALwrity UI")
\ No newline at end of file