Content Calendar, Content Gap Analysis, and Content Optimization
This commit is contained in:
26
Getting Started/Option_4_Mac_Users/Dockerfile
Normal file
26
Getting Started/Option_4_Mac_Users/Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
# Use Python 3.8 slim image optimized for M1/M2 Macs
|
||||
FROM --platform=linux/arm64 python:3.8-slim
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
curl \
|
||||
software-properties-common \
|
||||
git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Clone the repository
|
||||
RUN git clone https://github.com/AJaySi/AI-Writer.git .
|
||||
|
||||
# Install Python dependencies
|
||||
RUN python -m pip install --upgrade pip
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
# Expose Streamlit port
|
||||
EXPOSE 8501
|
||||
|
||||
# Run the application
|
||||
CMD ["streamlit", "run", "alwrity.py"]
|
||||
23
Getting Started/Option_4_Mac_Users/README.md
Normal file
23
Getting Started/Option_4_Mac_Users/README.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# ALwrity Installation for Mac Users
|
||||
|
||||
## Prerequisites
|
||||
- macOS 10.15 or later
|
||||
- Terminal access
|
||||
- Internet connection
|
||||
|
||||
## Installation Methods
|
||||
|
||||
### Method 1: Easy Setup (Recommended)
|
||||
1. Open Terminal
|
||||
2. Navigate to this directory
|
||||
3. Run: `python setup.py`
|
||||
4. Follow the on-screen instructions
|
||||
|
||||
### Method 2: Docker Installation
|
||||
1. Install Docker Desktop for Mac
|
||||
- Visit [Docker Desktop](https://www.docker.com/products/docker-desktop)
|
||||
- Download and install the Apple Silicon (M1/M2) or Intel version
|
||||
2. Build and run:
|
||||
```bash
|
||||
docker build -t alwrity .
|
||||
docker run -p 8501:8501 alwrity
|
||||
78
Getting Started/Option_4_Mac_Users/setup.py
Normal file
78
Getting Started/Option_4_Mac_Users/setup.py
Normal file
@@ -0,0 +1,78 @@
|
||||
import sys
|
||||
import os
|
||||
import subprocess
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
def print_step(text):
|
||||
print(f"\n→ {text}")
|
||||
|
||||
def print_error(text):
|
||||
print(f"\nError: {text}", file=sys.stderr)
|
||||
|
||||
def check_homebrew():
|
||||
try:
|
||||
subprocess.run(['brew', '--version'], capture_output=True, check=True)
|
||||
return True
|
||||
except:
|
||||
return False
|
||||
|
||||
def setup_homebrew():
|
||||
print_step("Homebrew is required for some dependencies")
|
||||
print("Please install Homebrew by running this command in Terminal:")
|
||||
print('/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"')
|
||||
print("\nAfter installing Homebrew, run this setup script again.")
|
||||
sys.exit(1)
|
||||
|
||||
def create_virtual_environment(venv_path):
|
||||
try:
|
||||
if venv_path.exists():
|
||||
shutil.rmtree(venv_path)
|
||||
subprocess.run([sys.executable, '-m', 'venv', str(venv_path)], check=True)
|
||||
return True
|
||||
except Exception as e:
|
||||
print_error(f"Failed to create virtual environment: {e}")
|
||||
return False
|
||||
|
||||
def install_requirements(venv_python, requirements_path):
|
||||
try:
|
||||
subprocess.run([str(venv_python), '-m', 'pip', 'install', '--upgrade', 'pip'], check=True)
|
||||
subprocess.run([str(venv_python), '-m', 'pip', 'install', '-r', str(requirements_path)], check=True)
|
||||
return True
|
||||
except Exception as e:
|
||||
print_error(f"Failed to install requirements: {e}")
|
||||
return False
|
||||
|
||||
def main():
|
||||
print("\n=== ALwrity Mac Installation ===\n")
|
||||
|
||||
if not check_homebrew():
|
||||
setup_homebrew()
|
||||
|
||||
current_dir = Path(__file__).parent
|
||||
project_root = current_dir.parent.parent
|
||||
requirements_path = project_root / 'requirements.txt'
|
||||
venv_path = current_dir / 'venv'
|
||||
|
||||
print_step("Creating virtual environment")
|
||||
if not create_virtual_environment(venv_path):
|
||||
return
|
||||
|
||||
print_step("Installing dependencies")
|
||||
venv_python = venv_path / 'bin' / 'python'
|
||||
if not install_requirements(venv_python, requirements_path):
|
||||
return
|
||||
|
||||
print("\n✓ Installation completed successfully!")
|
||||
print("\nTo start ALwrity:")
|
||||
print("1. Open Terminal in this directory")
|
||||
print("2. Run: source venv/bin/activate")
|
||||
print("3. Run: streamlit run alwrity.py")
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
print("\nInstallation cancelled")
|
||||
except Exception as e:
|
||||
print_error(f"Unexpected error: {e}")
|
||||
Reference in New Issue
Block a user