Owly News Summariser

Owly News Summariser is a web application that fetches news articles from various RSS feeds, uses an LLM (Large Language Model) to summarize them, and presents them in a clean, user-friendly interface.

Features

  • Fetches news from configurable RSS feeds
  • Automatically summarizes articles using Ollama LLM
  • Filters news by country
  • Progressive Web App (PWA) support for offline access
  • Scheduled background updates

Project Structure

The project consists of two main components:

  • Backend: A FastAPI application that fetches and processes news feeds, summarizes articles, and provides API endpoints
  • Frontend: A Vue.js application that displays the news and provides a user interface for managing feeds

Prerequisites

  • Python 3.8+ for the backend
  • Node.js 16+ and Yarn for the frontend
  • Ollama for article summarization

Installing Yarn

Yarn is a package manager for JavaScript that's required for the frontend. Here's how to install it:

If you already have Node.js installed, the easiest way to install Yarn is via npm:

npm install -g yarn

Platform-specific installations

Windows

  • Using Chocolatey: choco install yarn
  • Using Scoop: scoop install yarn
  • Manual installation: Download and run the installer

macOS

  • Using Homebrew: brew install yarn
  • Using MacPorts: sudo port install yarn

Linux

  • Debian/Ubuntu:

    curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
    echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
    sudo apt update && sudo apt install yarn
    
  • CentOS/Fedora/RHEL:

    curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
    sudo yum install yarn
    
  • Arch Linux: pacman -S yarn

After installation, verify Yarn is installed correctly:

yarn --version

Setup

Backend Setup

  1. Navigate to the backend directory:

    cd backend
    
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. Create a .env file based on the example:

    cp example.env .env
    
  5. Customize the .env file as needed:

    • OLLAMA_HOST: URL for the Ollama service (default: http://localhost:11434)
    • CRON_HOURS: Interval for scheduled news fetching (default: 1)
    • DATABASE_URL: SQLite database connection string

Frontend Setup

  1. Navigate to the frontend directory:

    cd frontend
    
  2. Install dependencies:

    yarn
    

Running the Application

Running the Backend

  1. Navigate to the backend directory:

    cd backend
    
  2. Activate the virtual environment:

    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Start the backend server:

    uvicorn app.main:app --reload
    

    The backend will be available at http://localhost:8000

Running the Frontend

  1. Navigate to the frontend directory:

    cd frontend
    
  2. Start the development server:

    yarn dev:watch
    

    The frontend will be available at http://localhost:5173

Building for Production

Building the Backend

The backend can be deployed as a standard FastAPI application. You can use tools like Gunicorn with Uvicorn workers:

pip install gunicorn
gunicorn app.main:app -w 4 -k uvicorn.workers.UvicornWorker

Building the Frontend

  1. Navigate to the frontend directory:

    cd frontend
    
  2. Build the frontend:

    yarn build
    

    The built files will be in the dist directory and can be served by any static file server.

API Endpoints

The backend provides the following API endpoints:

  • GET /news: Get news articles with optional filtering
  • GET /meta/last_sync: Get the timestamp of the last feed synchronization
  • POST /meta/cron: Set the schedule for automatic feed synchronization
  • GET /meta/feeds: List all configured feeds
  • POST /meta/feeds: Add a new feed
  • DELETE /meta/feeds: Delete a feed
  • GET /meta/model: Check the status of the LLM model
  • POST /meta/sync: Manually trigger a feed synchronization

Environment Variables

Backend

  • OLLAMA_HOST: URL for the Ollama service
  • CRON_HOURS: Interval for scheduled news fetching in hours
  • DATABASE_URL: SQLite database connection string

License

Code ist unter der PolyForm Noncommercial 1.0.0 lizenziert. Für jegliche kommerzielle Nutzung bitte Kontakt aufnehmen.

Description
No description provided
Readme 5.3 MiB
Languages
Python 43%
Vue 41.7%
TypeScript 10.4%
CSS 4.5%
HTML 0.4%