Base code

This commit is contained in:
Kunthawat Greethong
2026-01-08 22:39:53 +07:00
parent 697115c61a
commit c35fa52117
2169 changed files with 626670 additions and 0 deletions

View File

@@ -0,0 +1,472 @@
# Configuration Guide
This guide will help you configure ALwrity with your API keys, settings, and preferences to get the most out of your AI-powered content creation platform.
## Overview
ALwrity requires configuration of several components to function optimally:
- **AI Service API Keys**: Core AI capabilities
- **Research & SEO Services**: Enhanced content research
- **Authentication**: User management and security
- **Database**: Data storage and management
- **Frontend Settings**: User interface configuration
## Backend Configuration
### Environment Variables
The backend configuration is managed through environment variables in the `.env` file located in the `backend/` directory.
#### Core AI Services (Required)
```env
# Google Gemini API - Primary AI service
GEMINI_API_KEY=your_gemini_api_key_here
# OpenAI API - Alternative AI service
OPENAI_API_KEY=your_openai_api_key_here
# Anthropic API - Claude AI service
ANTHROPIC_API_KEY=your_anthropic_api_key_here
```
#### Database Configuration
```env
# Database URL - SQLite for development, PostgreSQL for production
DATABASE_URL=sqlite:///./alwrity.db
# For PostgreSQL production setup:
# DATABASE_URL=postgresql://username:password@localhost:5432/alwrity
```
#### Security Settings
```env
# Secret key for JWT tokens and encryption
SECRET_KEY=your_very_secure_secret_key_here
# Generate a secure key:
# python -c "import secrets; print(secrets.token_urlsafe(32))"
```
### Research & SEO Services (Optional but Recommended)
#### Web Search & Research
```env
# Tavily API - Advanced web search and research
TAVILY_API_KEY=your_tavily_api_key_here
# Serper API - Google search results
SERPER_API_KEY=your_serper_api_key_here
# Metaphor API - Content discovery
METAPHOR_API_KEY=your_metaphor_api_key_here
# Firecrawl API - Web scraping and content extraction
FIRECRAWL_API_KEY=your_firecrawl_api_key_here
```
#### SEO & Analytics
```env
# Google Search Console integration
GSC_CLIENT_ID=your_gsc_client_id_here
GSC_CLIENT_SECRET=your_gsc_client_secret_here
# Google Analytics (if needed)
GA_TRACKING_ID=your_ga_tracking_id_here
```
#### Content Generation
```env
# Stability AI - Image generation
STABILITY_API_KEY=your_stability_api_key_here
# Additional AI services
MISTRAL_API_KEY=your_mistral_api_key_here
```
### Authentication & Integration
```env
# Clerk Authentication
CLERK_SECRET_KEY=your_clerk_secret_key_here
# CopilotKit Integration
COPILOT_API_KEY=your_copilot_api_key_here
# Webhook URLs (for production)
WEBHOOK_URL=your_webhook_url_here
```
## Frontend Configuration
### Environment Variables
The frontend configuration is managed through environment variables in the `.env` file located in the `frontend/` directory.
#### Core Settings
```env
# Backend API URL
REACT_APP_API_URL=http://localhost:8000
# For production:
# REACT_APP_API_URL=https://your-domain.com
# Environment
NODE_ENV=development
```
#### Authentication
```env
# Clerk Authentication
REACT_APP_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key_here
# Google OAuth (if using)
REACT_APP_GOOGLE_CLIENT_ID=your_google_client_id_here
```
#### AI Integration
```env
# CopilotKit
REACT_APP_COPILOT_API_KEY=your_copilot_api_key_here
# Additional AI services
REACT_APP_OPENAI_API_KEY=your_openai_api_key_here
```
#### SEO & Analytics
```env
# Google Search Console
REACT_APP_GSC_CLIENT_ID=your_gsc_client_id_here
# Google Analytics
REACT_APP_GA_TRACKING_ID=your_ga_tracking_id_here
```
## API Keys Setup
### 1. Google Gemini API
**Purpose**: Primary AI service for content generation and analysis
**Setup Steps**:
1. Visit [Google AI Studio](https://makersuite.google.com/app/apikey)
2. Sign in with your Google account
3. Click "Create API Key"
4. Copy the generated key
5. Add to `GEMINI_API_KEY` in backend `.env`
**Usage Limits**:
- Free tier: 15 requests per minute
- Paid tier: Higher limits available
### 2. OpenAI API
**Purpose**: Alternative AI service for content generation
**Setup Steps**:
1. Visit [OpenAI Platform](https://platform.openai.com/api-keys)
2. Sign in to your account
3. Click "Create new secret key"
4. Copy the generated key
5. Add to `OPENAI_API_KEY` in backend `.env`
**Usage Limits**:
- Pay-per-use model
- Rate limits based on your plan
### 3. Anthropic API
**Purpose**: Claude AI for advanced reasoning and analysis
**Setup Steps**:
1. Visit [Anthropic Console](https://console.anthropic.com/)
2. Sign in to your account
3. Navigate to API Keys
4. Create a new API key
5. Add to `ANTHROPIC_API_KEY` in backend `.env`
### 4. Tavily API
**Purpose**: Advanced web search and research capabilities
**Setup Steps**:
1. Visit [Tavily](https://tavily.com/)
2. Sign up for an account
3. Navigate to API section
4. Generate API key
5. Add to `TAVILY_API_KEY` in backend `.env`
**Benefits**:
- Real-time web search
- Content summarization
- Source verification
### 5. Serper API
**Purpose**: Google search results and SEO data
**Setup Steps**:
1. Visit [Serper](https://serper.dev/)
2. Sign up for an account
3. Get your API key
4. Add to `SERPER_API_KEY` in backend `.env`
**Benefits**:
- Google search results
- SEO data and insights
- Keyword research
### 6. Google Search Console
**Purpose**: SEO analysis and performance tracking
**Setup Steps**:
1. Visit [Google Search Console](https://search.google.com/search-console/)
2. Add your website property
3. Go to Settings → Users and permissions
4. Create OAuth credentials
5. Add client ID and secret to `.env`
**Benefits**:
- Real search performance data
- Keyword insights
- Technical SEO analysis
### 7. Clerk Authentication
**Purpose**: User authentication and management
**Setup Steps**:
1. Visit [Clerk Dashboard](https://dashboard.clerk.com/)
2. Create a new application
3. Get your publishable and secret keys
4. Add to frontend and backend `.env` files
**Benefits**:
- Secure user authentication
- Social login options
- User management
### 8. CopilotKit
**Purpose**: AI chat interface and interactions
**Setup Steps**:
1. Visit [CopilotKit](https://copilotkit.ai/)
2. Sign up for an account
3. Get your API key
4. Add to `COPILOT_API_KEY` in both `.env` files
**Benefits**:
- Interactive AI chat
- Context-aware responses
- Seamless user experience
## Database Configuration
### SQLite (Development)
**Default Configuration**:
```env
DATABASE_URL=sqlite:///./alwrity.db
```
**Benefits**:
- No additional setup required
- Perfect for development
- File-based storage
### PostgreSQL (Production)
**Setup Steps**:
1. Install PostgreSQL
2. Create database and user
3. Update environment variable:
```env
DATABASE_URL=postgresql://username:password@localhost:5432/alwrity
```
**Benefits**:
- Better performance
- Concurrent access
- Advanced features
### Database Initialization
```bash
# Initialize database with default data
python scripts/init_alpha_subscription_tiers.py
# Or manually initialize
python -c "from services.database import initialize_database; initialize_database()"
```
## Security Configuration
### Secret Key Generation
```bash
# Generate a secure secret key
python -c "import secrets; print(secrets.token_urlsafe(32))"
```
### Environment Security
**Best Practices**:
- Never commit `.env` files to version control
- Use different keys for development and production
- Rotate API keys regularly
- Monitor API usage and costs
### CORS Configuration
The backend automatically configures CORS for development. For production, update the CORS settings in `backend/app.py`:
```python
app.add_middleware(
CORSMiddleware,
allow_origins=["https://your-domain.com"], # Production domain
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
```
## Performance Configuration
### Backend Optimization
```env
# Worker processes (for production)
WORKERS=4
# Request timeout
REQUEST_TIMEOUT=30
# Database connection pool
DB_POOL_SIZE=10
```
### Frontend Optimization
```env
# Enable production optimizations
NODE_ENV=production
# Bundle analyzer
ANALYZE_BUNDLE=true
# Source maps (disable for production)
GENERATE_SOURCEMAP=false
```
## Monitoring & Logging
### Logging Configuration
```env
# Log level
LOG_LEVEL=INFO
# Log file
LOG_FILE=logs/alwrity.log
# Enable request logging
ENABLE_REQUEST_LOGGING=true
```
### Health Checks
```bash
# Backend health check
curl http://localhost:8000/health
# Database health check
curl http://localhost:8000/health/db
# API health check
curl http://localhost:8000/health/api
```
## Configuration Validation
### Test Configuration
```bash
# Test backend configuration
python -c "from services.api_key_manager import validate_api_keys; validate_api_keys()"
# Test database connection
python -c "from services.database import test_connection; test_connection()"
# Test API endpoints
curl http://localhost:8000/api/health
```
### Configuration Checklist
- [ ] All required API keys are set
- [ ] Database is initialized
- [ ] Backend server starts without errors
- [ ] Frontend connects to backend
- [ ] Authentication is working (if configured)
- [ ] API endpoints are accessible
- [ ] Health checks pass
## Troubleshooting Configuration
### Common Issues
**API Key Errors**:
- Verify keys are correctly copied
- Check for extra spaces or characters
- Ensure keys have proper permissions
**Database Connection Issues**:
- Verify database URL format
- Check database server is running
- Ensure proper permissions
**CORS Errors**:
- Check frontend URL in CORS settings
- Verify backend is running on correct port
- Check for HTTPS/HTTP mismatch
**Authentication Issues**:
- Verify Clerk keys are correct
- Check domain configuration in Clerk
- Ensure proper redirect URLs
### Getting Help
If you encounter configuration issues:
1. **Check Logs**: Review console output for error messages
2. **Validate Keys**: Test API keys individually
3. **Verify URLs**: Ensure all URLs are correct
4. **Check Permissions**: Verify API key permissions
5. **Review Documentation**: Check service-specific documentation
## Next Steps
After successful configuration:
1. **[First Steps](first-steps.md)** - Create your first content strategy
2. **[Quick Start](quick-start.md)** - Get up and running quickly
3. **[Troubleshooting Guide](../guides/troubleshooting.md)** - Common issues and solutions
4. **[API Reference](../api/overview.md)** - Complete API documentation
---
*Configuration complete? [Start creating content](first-steps.md) with your newly configured ALwrity platform!*

View File

@@ -0,0 +1,355 @@
# First Steps with ALwrity
Welcome to ALwrity! This guide will walk you through your first content creation journey, from initial setup to publishing your first AI-generated content. Follow these steps to get the most out of your AI-powered content creation platform.
## Prerequisites
Before you begin, ensure you have:
-**ALwrity Installed**: Follow the [Installation Guide](installation.md)
-**Configuration Complete**: Set up your [API keys and settings](configuration.md)
-**Backend Running**: Server available at `http://localhost:8000`
-**Frontend Running**: Application available at `http://localhost:3000`
## Step 1: Access the Dashboard
### 1.1 Open ALwrity
1. **Navigate to**: `http://localhost:3000`
2. **Sign In**: Use your authentication method (if configured)
3. **Dashboard**: You'll see the main ALwrity dashboard
### 1.2 User Journey Overview
```mermaid
journey
title ALwrity User Journey
section Initial Setup
Open ALwrity: 5: User
Sign In: 4: User
View Dashboard: 5: User
section Onboarding
Enter Business Info: 4: User
Set Content Preferences: 4: User
Generate Persona: 5: User
section Content Creation
Choose Content Type: 5: User
Input Topic: 4: User
Review Research: 5: User
Generate Content: 5: User
Review & Edit: 4: User
section Optimization
SEO Analysis: 5: User
Apply Recommendations: 4: User
Publish Content: 5: User
```
### 1.2 Dashboard Overview
The dashboard provides access to:
- **📝 Blog Writer**: AI-powered blog content creation
- **📊 SEO Dashboard**: Content optimization and analytics
- **💼 LinkedIn Writer**: Professional social media content
- **📱 Facebook Writer**: Social media content creation
- **🎯 Content Strategy**: Strategic planning and personas
- **📈 Analytics**: Performance tracking and insights
## Step 2: Complete Onboarding
### 2.1 Business Information
1. **Click "Get Started"** or navigate to onboarding
2. **Enter Business Details**:
- Business name and type
- Industry or niche
- Target audience description
- Business goals and objectives
### 2.2 Content Preferences
1. **Content Types**: Select the types of content you want to create
- Blog posts
- Social media content
- Email newsletters
- Marketing materials
2. **Brand Voice**: Define your brand personality
- Professional and formal
- Casual and friendly
- Technical and detailed
- Creative and engaging
3. **Content Goals**: Specify your objectives
- Brand awareness
- Lead generation
- Customer education
- Sales conversion
### 2.3 AI Persona Generation
1. **Persona Creation**: ALwrity will generate detailed buyer personas
2. **Review Personas**: Examine the AI-generated audience profiles
3. **Customize**: Adjust personas based on your knowledge
4. **Save**: Confirm your persona configuration
## Step 3: Create Your First Blog Post
### 3.1 Access Blog Writer
1. **Navigate to**: Blog Writer from the dashboard
2. **Click**: "Create New Blog Post"
3. **Select**: Content creation mode
### 3.2 Topic Selection
1. **Enter Topic**: Provide a topic or keyword
- Example: "AI in Digital Marketing"
- Example: "Content Strategy for Small Businesses"
- Example: "SEO Best Practices 2024"
2. **AI Research**: ALwrity will automatically:
- Research your topic
- Analyze competitor content
- Identify key points to cover
- Find relevant statistics and data
### 3.3 Content Planning
1. **Review Research**: Examine the AI-generated research
2. **Outline Generation**: AI creates a structured outline
3. **Customize Outline**: Adjust sections and points
4. **Add Requirements**: Specify any special requirements
### 3.4 Content Generation
1. **Generate Content**: AI creates the full blog post
2. **Review Sections**: Examine each section of the content
3. **Edit and Refine**: Make adjustments as needed
4. **Add Personal Touch**: Include your unique insights
### 3.5 SEO Optimization
1. **SEO Analysis**: AI analyzes content for SEO
2. **Keyword Optimization**: Optimize for target keywords
3. **Meta Tags**: Generate title and description
4. **Readability**: Ensure content is easy to read
## Step 4: Optimize with SEO Dashboard
### 4.1 SEO Analysis
1. **Navigate to**: SEO Dashboard
2. **Upload Content**: Import your blog post
3. **Run Analysis**: AI performs comprehensive SEO analysis
### 4.2 SEO Recommendations
1. **Keyword Density**: Optimize keyword usage
2. **Content Structure**: Improve headings and organization
3. **Meta Optimization**: Enhance title and description
4. **Internal Linking**: Add relevant internal links
### 4.3 Performance Insights
1. **Competitor Analysis**: Compare with top-performing content
2. **Gap Analysis**: Identify missing elements
3. **Improvement Suggestions**: Get specific recommendations
4. **Performance Prediction**: Forecast content success
## Step 5: Create Social Media Content
### 5.1 LinkedIn Content
1. **Navigate to**: LinkedIn Writer
2. **Select Content Type**:
- Professional posts
- Articles
- Carousel posts
- Video scripts
3. **Generate Content**: AI creates LinkedIn-optimized content
4. **Review and Edit**: Customize for your brand voice
5. **Add Hashtags**: Include relevant hashtags
### 5.2 Facebook Content
1. **Navigate to**: Facebook Writer
2. **Choose Format**:
- Text posts
- Image captions
- Video descriptions
- Event promotions
3. **Generate Content**: AI creates Facebook-optimized content
4. **Review Engagement**: Optimize for Facebook algorithms
5. **Schedule Posts**: Plan your content calendar
## Step 6: Develop Content Strategy
### 6.1 Strategic Planning
1. **Navigate to**: Content Strategy
2. **Review AI-Generated Strategy**: Examine the comprehensive plan
3. **Content Calendar**: View your suggested publishing schedule
4. **Topic Clusters**: Understand content themes and relationships
### 6.2 Persona Refinement
1. **Access Personas**: Review your buyer personas
2. **Update Information**: Add new insights about your audience
3. **Content Alignment**: Ensure content matches persona needs
4. **Journey Mapping**: Understand customer touchpoints
### 6.3 Performance Tracking
1. **Set Goals**: Define measurable objectives
2. **Track Metrics**: Monitor key performance indicators
3. **Analyze Results**: Review content performance
4. **Optimize Strategy**: Adjust based on data insights
## Step 7: Publish and Monitor
### 7.1 Content Publishing
1. **Export Content**: Download your optimized content
2. **Publish**: Upload to your website or platform
3. **Share**: Distribute across social media channels
4. **Track**: Monitor publication status
### 7.2 Performance Monitoring
1. **Analytics Dashboard**: View performance metrics
2. **Engagement Tracking**: Monitor likes, shares, comments
3. **Traffic Analysis**: Track website visits and conversions
4. **ROI Measurement**: Calculate return on investment
## Step 8: Iterate and Improve
### 8.1 Content Optimization
1. **Review Performance**: Analyze what's working
2. **Identify Patterns**: Find successful content types
3. **Adjust Strategy**: Modify approach based on results
4. **Scale Success**: Replicate winning formulas
### 8.2 Continuous Learning
1. **AI Feedback**: Let ALwrity learn from your preferences
2. **Strategy Refinement**: Continuously improve your approach
3. **New Features**: Explore additional ALwrity capabilities
4. **Best Practices**: Implement proven strategies
## Best Practices for Success
### Content Creation
- **Be Specific**: Provide detailed topic descriptions
- **Review AI Output**: Always review and customize generated content
- **Maintain Brand Voice**: Ensure consistency across all content
- **Add Personal Insights**: Include your unique perspective
### SEO Optimization
- **Target Keywords**: Focus on relevant, high-value keywords
- **Optimize Structure**: Use proper headings and formatting
- **Internal Linking**: Connect related content pieces
- **Monitor Performance**: Track SEO improvements over time
### Social Media
- **Platform Optimization**: Tailor content for each platform
- **Engagement Focus**: Create content that encourages interaction
- **Consistent Posting**: Maintain regular publishing schedule
- **Community Building**: Foster relationships with your audience
### Strategy Development
- **Data-Driven Decisions**: Base strategy on performance data
- **Regular Reviews**: Assess and adjust strategy monthly
- **Goal Alignment**: Ensure content supports business objectives
- **Competitive Analysis**: Stay aware of competitor activities
## Common First-Time User Tips
### Getting Started
1. **Start Small**: Begin with one content type and expand
2. **Learn the Interface**: Familiarize yourself with all features
3. **Test Different Topics**: Experiment with various content themes
4. **Save Templates**: Create reusable content templates
### Content Quality
1. **Review Everything**: Always review AI-generated content
2. **Add Personal Touch**: Include your unique insights
3. **Fact-Check**: Verify important information and statistics
4. **Maintain Consistency**: Keep brand voice consistent
### Performance Optimization
1. **Track Metrics**: Monitor key performance indicators
2. **A/B Test**: Experiment with different approaches
3. **Learn from Data**: Use analytics to guide decisions
4. **Iterate Quickly**: Make adjustments based on results
## Troubleshooting Common Issues
### Content Generation
**Issue**: AI generates generic content
**Solution**: Provide more specific topic descriptions and requirements
**Issue**: Content doesn't match brand voice
**Solution**: Update persona settings and brand voice preferences
**Issue**: SEO scores are low
**Solution**: Use SEO Dashboard recommendations and optimize content
### Technical Issues
**Issue**: Content doesn't save
**Solution**: Check browser console for errors and refresh page
**Issue**: Slow content generation
**Solution**: Verify API keys and check internet connection
**Issue**: Research data is outdated
**Solution**: Ensure research services are properly configured
## Next Steps
After completing your first content creation cycle:
1. **[Explore Advanced Features](../features/blog-writer/overview.md)** - Learn about advanced content creation
2. **[SEO Optimization Guide](../features/seo-dashboard/overview.md)** - Master SEO techniques
3. **[Content Strategy Development](../features/content-strategy/overview.md)** - Build comprehensive strategies
4. **[Performance Analytics](../guides/performance.md)** - Track and optimize results
5. **[Troubleshooting Guide](../guides/troubleshooting.md)** - Resolve common issues
## Success Metrics to Track
### Content Performance
- **Engagement Rate**: Likes, shares, comments per post
- **Click-Through Rate**: Clicks on links and CTAs
- **Time on Page**: How long readers engage with content
- **Conversion Rate**: Actions taken after reading content
### SEO Performance
- **Search Rankings**: Position in search results
- **Organic Traffic**: Visitors from search engines
- **Keyword Rankings**: Performance for target keywords
- **Backlinks**: Links from other websites
### Business Impact
- **Lead Generation**: New prospects from content
- **Sales Conversion**: Revenue attributed to content
- **Brand Awareness**: Mentions and recognition
- **Customer Engagement**: Interaction and feedback
---
*Ready to create amazing content? [Explore our advanced features](../features/blog-writer/overview.md) and take your content strategy to the next level!*

View File

@@ -0,0 +1,348 @@
# Installation Guide
This comprehensive guide will walk you through installing and setting up ALwrity on your system. Follow these steps to get your AI-powered content creation platform running.
## Prerequisites
Before you begin, ensure you have the following installed on your system:
### System Requirements
- **Operating System**: Windows 10/11, macOS 10.15+, or Linux (Ubuntu 18.04+)
- **Python**: Version 3.10 or higher
- **Node.js**: Version 18 or higher
- **Git**: Latest version for version control
- **Memory**: Minimum 4GB RAM (8GB recommended)
- **Storage**: At least 2GB free disk space
### Required Software
#### 1. Python 3.10+
```bash
# Check if Python is installed
python --version
# If not installed, download from: https://www.python.org/downloads/
# Or use package manager:
# Windows: choco install python
# macOS: brew install python
# Ubuntu: sudo apt install python3.10
```
#### 2. Node.js 18+
```bash
# Check if Node.js is installed
node --version
npm --version
# If not installed, download from: https://nodejs.org/
# Or use package manager:
# Windows: choco install nodejs
# macOS: brew install node
# Ubuntu: curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
```
#### 3. Git
```bash
# Check if Git is installed
git --version
# If not installed, download from: https://git-scm.com/
# Or use package manager:
# Windows: choco install git
# macOS: brew install git
# Ubuntu: sudo apt install git
```
## Installation Steps
### Step 1: Clone the Repository
```bash
# Clone the ALwrity repository
git clone https://github.com/AJaySi/ALwrity.git
# Navigate to the project directory
cd ALwrity
```
### Step 2: Backend Setup
#### 2.1 Install Python Dependencies
```bash
# Navigate to backend directory
cd backend
# Create virtual environment (recommended)
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
```
#### 2.2 Environment Configuration
Create a `.env` file in the backend directory:
```bash
# Create environment file
touch .env # Linux/macOS
# or
type nul > .env # Windows
```
Add the following configuration to your `.env` file:
```env
# AI Service API Keys (Required)
GEMINI_API_KEY=your_gemini_api_key_here
OPENAI_API_KEY=your_openai_api_key_here
ANTHROPIC_API_KEY=your_anthropic_api_key_here
# Database Configuration
DATABASE_URL=sqlite:///./alwrity.db
# Security
SECRET_KEY=your_secret_key_here
# Optional: Additional AI Services
TAVILY_API_KEY=your_tavily_api_key_here
SERPER_API_KEY=your_serper_api_key_here
METAPHOR_API_KEY=your_metaphor_api_key_here
FIRECRAWL_API_KEY=your_firecrawl_api_key_here
STABILITY_API_KEY=your_stability_api_key_here
# Optional: Google Search Console
GSC_CLIENT_ID=your_gsc_client_id_here
GSC_CLIENT_SECRET=your_gsc_client_secret_here
# Optional: Clerk Authentication
CLERK_SECRET_KEY=your_clerk_secret_key_here
# Optional: CopilotKit
COPILOT_API_KEY=your_copilot_api_key_here
```
#### 2.3 Initialize Database
```bash
# Initialize the database
python -c "from services.database import initialize_database; initialize_database()"
# Or run the initialization script
python scripts/init_alpha_subscription_tiers.py
```
#### 2.4 Start Backend Server
```bash
# Start the backend server
python start_alwrity_backend.py
# The server will be available at: http://localhost:8000
# API documentation: http://localhost:8000/api/docs
# Health check: http://localhost:8000/health
```
### Step 3: Frontend Setup
#### 3.1 Install Node.js Dependencies
```bash
# Navigate to frontend directory (in a new terminal)
cd frontend
# Install dependencies
npm install
```
#### 3.2 Frontend Environment Configuration
Create a `.env` file in the frontend directory:
```bash
# Create environment file
touch .env # Linux/macOS
# or
type nul > .env # Windows
```
Add the following configuration:
```env
# Backend API URL
REACT_APP_API_URL=http://localhost:8000
# Clerk Authentication (Optional)
REACT_APP_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key_here
# CopilotKit (Optional)
REACT_APP_COPILOT_API_KEY=your_copilot_api_key_here
# Google Search Console (Optional)
REACT_APP_GSC_CLIENT_ID=your_gsc_client_id_here
# Environment
NODE_ENV=development
```
#### 3.3 Start Frontend Development Server
```bash
# Start the frontend development server
npm start
# The application will be available at: http://localhost:3000
```
## Verification
### Backend Verification
1. **Health Check**: Visit `http://localhost:8000/health`
- Should return: `{"status": "healthy"}`
2. **API Documentation**: Visit `http://localhost:8000/api/docs`
- Should display interactive API documentation
3. **Database Check**: Verify database file exists
```bash
ls -la backend/alwrity.db # Linux/macOS
dir backend\alwrity.db # Windows
```
### Frontend Verification
1. **Application Load**: Visit `http://localhost:3000`
- Should display the ALwrity dashboard
2. **API Connection**: Check browser console for connection errors
- Should show successful API connections
3. **Authentication**: Test login functionality (if configured)
## API Keys Setup
### Required API Keys
#### 1. Google Gemini API
- Visit: [Google AI Studio](https://makersuite.google.com/app/apikey)
- Create a new API key
- Add to `GEMINI_API_KEY` in backend `.env`
#### 2. OpenAI API (Optional)
- Visit: [OpenAI Platform](https://platform.openai.com/api-keys)
- Create a new API key
- Add to `OPENAI_API_KEY` in backend `.env`
#### 3. Anthropic API (Optional)
- Visit: [Anthropic Console](https://console.anthropic.com/)
- Create a new API key
- Add to `ANTHROPIC_API_KEY` in backend `.env`
### Optional API Keys
#### Research & SEO Services
- **Tavily**: [Tavily API](https://tavily.com/) - Web search and research
- **Serper**: [Serper API](https://serper.dev/) - Google search results
- **Metaphor**: [Metaphor API](https://metaphor.systems/) - Content discovery
- **Firecrawl**: [Firecrawl API](https://firecrawl.dev/) - Web scraping
#### Content Generation
- **Stability AI**: [Stability Platform](https://platform.stability.ai/) - Image generation
#### Authentication & Integration
- **Clerk**: [Clerk Dashboard](https://dashboard.clerk.com/) - User authentication
- **CopilotKit**: [CopilotKit](https://copilotkit.ai/) - AI chat interface
## Troubleshooting
### Common Issues
#### Backend Issues
**Port Already in Use**
```bash
# Find process using port 8000
netstat -ano | findstr :8000 # Windows
lsof -i :8000 # macOS/Linux
# Kill the process or use different port
python start_alwrity_backend.py --port 8001
```
**Database Connection Error**
```bash
# Reset database
rm backend/alwrity.db # Linux/macOS
del backend\alwrity.db # Windows
# Reinitialize
python -c "from services.database import initialize_database; initialize_database()"
```
**Missing Dependencies**
```bash
# Reinstall requirements
pip install -r requirements.txt --force-reinstall
```
#### Frontend Issues
**Port Already in Use**
```bash
# Use different port
npm start -- --port 3001
```
**Build Errors**
```bash
# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install
```
**API Connection Issues**
- Verify backend is running on `http://localhost:8000`
- Check `REACT_APP_API_URL` in frontend `.env`
- Ensure CORS is properly configured
### Getting Help
If you encounter issues:
1. **Check Logs**: Review console output for error messages
2. **Verify Configuration**: Ensure all environment variables are set
3. **Test API Keys**: Verify API keys are valid and have sufficient credits
4. **Check Dependencies**: Ensure all required software is installed
5. **Review Documentation**: Check our [troubleshooting guide](../guides/troubleshooting.md)
## Next Steps
After successful installation:
1. **[Configuration Guide](configuration.md)** - Configure your API keys and settings
2. **[First Steps](first-steps.md)** - Create your first content strategy
3. **[Quick Start](quick-start.md)** - Get up and running quickly
4. **[Troubleshooting Guide](../guides/troubleshooting.md)** - Common issues and solutions
## Production Deployment
For production deployment, consider:
- **Environment Variables**: Use secure environment variable management
- **Database**: Consider PostgreSQL or MySQL for production
- **SSL/TLS**: Enable HTTPS for secure connections
- **Monitoring**: Set up logging and monitoring
- **Backup**: Implement regular database backups
---
*Installation complete? [Configure your settings](configuration.md) to start creating amazing content with ALwrity!*

View File

@@ -0,0 +1,131 @@
# Quick Start Guide
Get up and running with ALwrity in just a few minutes! This guide will help you set up the platform and create your first AI-generated content.
## Prerequisites
Before you begin, make sure you have:
- **Python 3.10+** installed on your system
- **Node.js 18+** for the frontend
- **API Keys** for AI services (Gemini, OpenAI, etc.)
- **Git** for version control
## Installation
### 1. Clone the Repository
```bash
git clone https://github.com/AJaySi/ALwrity.git
cd ALwrity
```
### 2. Backend Setup
```bash
cd backend
pip install -r requirements.txt
```
### 3. Frontend Setup
```bash
cd frontend
npm install
```
## Configuration
### 1. Environment Variables
Create a `.env` file in the backend directory:
```bash
# AI Service API Keys
GEMINI_API_KEY=your_gemini_api_key
OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
# Database
DATABASE_URL=sqlite:///./alwrity.db
# Security
SECRET_KEY=your_secret_key
```
### 2. Frontend Configuration
Create a `.env` file in the frontend directory:
```bash
REACT_APP_API_URL=http://localhost:8000
REACT_APP_CLERK_PUBLISHABLE_KEY=your_clerk_key
REACT_APP_COPILOT_API_KEY=your_copilot_key
```
## Running the Application
### 1. Start the Backend
```bash
cd backend
python start_alwrity_backend.py
```
The backend will be available at `http://localhost:8000`
### 2. Start the Frontend
```bash
cd frontend
npm start
```
The frontend will be available at `http://localhost:3000`
## Your First Content
### 1. Access the Dashboard
Navigate to `http://localhost:3000` and complete the onboarding process.
### 2. Create a Blog Post
1. Go to **Blog Writer**
2. Enter your topic or keyword
3. Click **Generate Content**
4. Review and edit the generated content
5. Use the **SEO Analysis** feature to optimize
### 3. LinkedIn Content
1. Navigate to **LinkedIn Writer**
2. Select content type (post, article, carousel)
3. Provide your topic and target audience
4. Generate and customize your content
## Next Steps
- **[Configuration Guide](configuration.md)** - Advanced configuration options
- **[First Steps](first-steps.md)** - Detailed walkthrough of key features
- **[API Reference](../api/overview.md)** - Integrate with your applications
- **[Best Practices](../guides/best-practices.md)** - Optimize your content strategy
## Troubleshooting
If you encounter any issues:
1. Check the [Troubleshooting Guide](../guides/troubleshooting.md)
2. Verify your API keys are correctly set
3. Ensure all dependencies are installed
4. Check the console for error messages
## Need Help?
- **GitHub Issues**: [Report bugs and request features](https://github.com/AJaySi/ALwrity/issues)
- **Documentation**: Browse our comprehensive guides
- **Community**: Join our developer community
---
*Ready to create amazing content? Check out our [First Steps Guide](first-steps.md) for a detailed walkthrough!*