Skip to content
Anuj edited this page Jan 15, 2025 · 1 revision

AiLert Wiki

Home

Welcome to the AiLert wiki! Here you'll find comprehensive documentation about the project, how to use it, and how to contribute.

Table of Contents

  1. Overview
  2. Installation
  3. Configuration
  4. Components
  5. Usage Guide
  6. Contributing
  7. FAQ

Overview

What is AiLert?

AiLert is an open-source newsletter platform that aggregates AI-related content from various sources including research papers, GitHub repositories, news sites, and events. It automates the process of tracking and curating AI developments.

Key Features

  • Content aggregation from 150+ sources
  • Automated newsletter generation
  • Customizable templates
  • Source management
  • Content categorization
  • Engagement tracking

Architecture

AiLert consists of several core components:

  • Content Fetchers
  • Data Processors
  • Newsletter Builder
  • Template Engine
  • AWS Integration

Installation

Prerequisites

  • Python 3.8+
  • AWS Account (for DynamoDB)
  • Git

Basic Setup

# Clone the repository
git clone https://github.com/yourusername/ailert.git
cd ailert

# Install dependencies
pip install -r requirements.txt

# Configure AWS credentials
export AWS_ACCESS_KEY_ID="your_access_key"
export AWS_SECRET_ACCESS_KEY="your_secret_key"
export AWS_REGION="your_region"

# Run the application
python main.py

Docker Setup

# Build the image
docker build -t ailert .

# Run the container
docker run -d -p 8000:8000 ailert

Configuration

Environment Variables

AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_REGION=your_region

Source Configuration

Sources are configured in links.py:

rss_feed = [
    "https://example.com/feed",
    "https://another-source.com/rss"
]

Newsletter Templates

Templates are stored in /static/ directory:

static/
├── newsletter.html
└── daily_newsletter.html

Components

Content Fetchers

The fetching system uses async Python to efficiently gather content from multiple sources:

async def fetch_content(session, source):
    async with session.get(source.url) as response:
        return await response.text()

Newsletter Builder

Handles the assembly and formatting of newsletters:

class NewsletterBuilder:
    def __init__(self, dict_vars):
        self.template = load_template(self.template_path)
        self.news_service = NewsService(rss_feed)

Database Handler

Manages interactions with AWS DynamoDB:

class Dynamo:
    def __init__(self, region_name):
        self.dynamodb = boto3.resource('dynamodb', 
                                     region_name=region_name)

Usage Guide

Basic Usage

  1. Configure your sources in links.py
  2. Set up your AWS credentials
  3. Run the application
  4. Access the dashboard at http://localhost:8000

Customizing Templates

  1. Navigate to /static/
  2. Edit newsletter.html
  3. Use template variables:
    • {{content}}
    • {{brand_name}}
    • {{current_year}}

Managing Sources

  • Add new sources to links.py
  • Use the source manager API
  • Monitor source health

Contributing

Getting Started

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

Development Setup

# Create virtual environment
python -m venv venv
source venv/bin/activate

# Install dev dependencies
pip install -r requirements-dev.txt

# Run tests
python -m pytest

Code Style

  • Follow PEP 8
  • Use type hints
  • Write docstrings
  • Add tests for new features

Areas for Contribution

  • Add new sources
  • Improve content processing
  • Enhance templates
  • Write documentation
  • Fix bugs
  • Add features

FAQ

Common Issues

Q: How do I add new sources? A: Add RSS feeds to links.py or use the source manager API.

Q: Can I customize the newsletter template? A: Yes, edit the HTML templates in the /static/ directory.

Q: How do I handle rate limits? A: The fetcher includes automatic rate limiting and retries.

Best Practices

  1. Content Management

    • Regular source verification
    • Content deduplication
    • Quality filtering
  2. Performance Optimization

    • Use async operations
    • Implement caching
    • Monitor resource usage
  3. Template Design

    • Mobile-responsive
    • Clean formatting
    • Consistent styling

Support

  • Create an issue for bugs
  • Join Discord for help
  • Check documentation
  • Contact maintainers