[update] overhauled README.md
to reflect new Rust backend, modernized tooling instructions, updated frontend and backend setup guides, and improved clarity on application structure
This commit is contained in:
177
README.md
177
README.md
@@ -1,6 +1,6 @@
|
|||||||
# Owly News Summariser
|
# 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.
|
Owly News Summariser is a modern 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
|
## Features
|
||||||
|
|
||||||
@@ -9,97 +9,56 @@ Owly News Summariser is a web application that fetches news articles from variou
|
|||||||
- Filters news by country
|
- Filters news by country
|
||||||
- Progressive Web App (PWA) support for offline access
|
- Progressive Web App (PWA) support for offline access
|
||||||
- Scheduled background updates
|
- Scheduled background updates
|
||||||
|
- High-performance Rust backend for optimal resource usage
|
||||||
|
- Modern Vue.js frontend with TypeScript support
|
||||||
|
|
||||||
## Project Structure
|
## Project Structure
|
||||||
|
|
||||||
The project consists of two main components:
|
The project consists of multiple components:
|
||||||
|
|
||||||
- **Backend**: A FastAPI application that fetches and processes news feeds, summarizes articles, and provides API endpoints
|
- **Backend (Rust)**: Primary backend written in Rust using Axum framework for high performance (`backend-rust/`)
|
||||||
- **Frontend**: A Vue.js application that displays the news and provides a user interface for managing feeds
|
- **Backend (Python)**: Legacy FastAPI backend (`backend/`)
|
||||||
|
- **Frontend**: Modern Vue.js 3 application with TypeScript and Tailwind CSS (`frontend/`)
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
- Python 3.8+ for the backend
|
### For Rust Backend (Recommended)
|
||||||
- Node.js 16+ and Yarn for the frontend
|
- Rust 1.88.0+
|
||||||
|
- [Ollama](https://ollama.ai/) for article summarization
|
||||||
|
- SQLite (handled automatically by SQLx)
|
||||||
|
|
||||||
|
### For Python Backend (Legacy)
|
||||||
|
- Python 3.8+
|
||||||
- [Ollama](https://ollama.ai/) for article summarization
|
- [Ollama](https://ollama.ai/) for article summarization
|
||||||
|
|
||||||
## Installing Yarn
|
### For Frontend
|
||||||
|
- Node.js 22+ and npm
|
||||||
Yarn is a package manager for JavaScript that's required for the frontend. Here's how to install it:
|
- Modern web browser with PWA support
|
||||||
|
|
||||||
### Using npm (recommended)
|
|
||||||
|
|
||||||
If you already have Node.js installed, the easiest way to install Yarn is via npm:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
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](https://classic.yarnpkg.com/latest.msi)
|
|
||||||
|
|
||||||
#### macOS
|
|
||||||
|
|
||||||
- **Using Homebrew**: `brew install yarn`
|
|
||||||
- **Using MacPorts**: `sudo port install yarn`
|
|
||||||
|
|
||||||
#### Linux
|
|
||||||
|
|
||||||
- **Debian/Ubuntu**:
|
|
||||||
```bash
|
|
||||||
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**:
|
|
||||||
```bash
|
|
||||||
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:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn --version
|
|
||||||
```
|
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
### Backend Setup
|
### Rust Backend Setup (Recommended)
|
||||||
|
|
||||||
1. Navigate to the backend directory:
|
1. Navigate to the Rust backend directory:
|
||||||
```bash
|
```bash
|
||||||
cd backend
|
cd backend-rust
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Create a virtual environment:
|
2. Create a `.env` file based on the example:
|
||||||
```bash
|
|
||||||
python -m venv venv
|
|
||||||
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Install dependencies:
|
|
||||||
```bash
|
|
||||||
pip install -r requirements.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
4. Create a `.env` file based on the example:
|
|
||||||
```bash
|
```bash
|
||||||
cp example.env .env
|
cp example.env .env
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Customize the `.env` file as needed:
|
3. 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
|
- `DATABASE_URL`: SQLite database connection string
|
||||||
|
- `OLLAMA_BASE_URL`: URL for the Ollama service (default: http://localhost:11434)
|
||||||
|
- Other configuration options as documented in the example file
|
||||||
|
|
||||||
|
4. Run database migrations:
|
||||||
|
```bash
|
||||||
|
cargo install sqlx-cli
|
||||||
|
sqlx migrate run
|
||||||
|
```
|
||||||
|
|
||||||
### Frontend Setup
|
### Frontend Setup
|
||||||
|
|
||||||
@@ -110,29 +69,24 @@ yarn --version
|
|||||||
|
|
||||||
2. Install dependencies:
|
2. Install dependencies:
|
||||||
```bash
|
```bash
|
||||||
yarn
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
## Running the Application
|
## Running the Application
|
||||||
|
|
||||||
### Running the Backend
|
### Running the Rust Backend
|
||||||
|
|
||||||
1. Navigate to the backend directory:
|
1. Navigate to the Rust backend directory:
|
||||||
```bash
|
```bash
|
||||||
cd backend
|
cd backend-rust
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Activate the virtual environment:
|
2. Start the backend server:
|
||||||
```bash
|
```bash
|
||||||
source venv/bin/activate # On Windows: venv\Scripts\activate
|
cargo run
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Start the backend server:
|
The backend will be available at http://localhost:3000
|
||||||
```bash
|
|
||||||
uvicorn app.main:app --reload
|
|
||||||
```
|
|
||||||
|
|
||||||
The backend will be available at http://localhost:8000
|
|
||||||
|
|
||||||
### Running the Frontend
|
### Running the Frontend
|
||||||
|
|
||||||
@@ -143,21 +97,26 @@ yarn --version
|
|||||||
|
|
||||||
2. Start the development server:
|
2. Start the development server:
|
||||||
```bash
|
```bash
|
||||||
yarn dev:watch
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
The frontend will be available at http://localhost:5173
|
The frontend will be available at http://localhost:5173
|
||||||
|
|
||||||
## Building for Production
|
## Building for Production
|
||||||
|
|
||||||
### Building the Backend
|
### Building the Rust Backend
|
||||||
|
|
||||||
The backend can be deployed as a standard FastAPI application. You can use tools like Gunicorn with Uvicorn workers:
|
1. Navigate to the Rust backend directory:
|
||||||
|
```bash
|
||||||
|
cd backend-rust
|
||||||
|
```
|
||||||
|
|
||||||
```bash
|
2. Build the optimized release binary:
|
||||||
pip install gunicorn
|
```bash
|
||||||
gunicorn app.main:app -w 4 -k uvicorn.workers.UvicornWorker
|
cargo build --release
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The binary will be available at `target/release/owly-news-summariser`
|
||||||
|
|
||||||
### Building the Frontend
|
### Building the Frontend
|
||||||
|
|
||||||
@@ -168,32 +127,32 @@ gunicorn app.main:app -w 4 -k uvicorn.workers.UvicornWorker
|
|||||||
|
|
||||||
2. Build the frontend:
|
2. Build the frontend:
|
||||||
```bash
|
```bash
|
||||||
yarn build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
The built files will be in the `dist` directory and can be served by any static file server.
|
The built files will be in the `dist` directory and can be served by any static file server.
|
||||||
|
|
||||||
## API Endpoints
|
## Development
|
||||||
|
|
||||||
The backend provides the following API endpoints:
|
### Code Quality
|
||||||
|
|
||||||
- `GET /news`: Get news articles with optional filtering
|
The project includes comprehensive tooling for code quality:
|
||||||
- `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
|
**Frontend:**
|
||||||
|
- ESLint with Vue and TypeScript support
|
||||||
|
- Prettier for code formatting
|
||||||
|
- Vitest for testing
|
||||||
|
- TypeScript for type safety
|
||||||
|
- Oxlint for additional linting
|
||||||
|
|
||||||
### Backend
|
**Backend (Rust):**
|
||||||
|
- Standard Rust tooling (`cargo fmt`, `cargo clippy`)
|
||||||
|
- SQLx for compile-time checked SQL queries
|
||||||
|
|
||||||
- `OLLAMA_HOST`: URL for the Ollama service
|
### Testing
|
||||||
- `CRON_HOURS`: Interval for scheduled news fetching in hours
|
|
||||||
- `DATABASE_URL`: SQLite database connection string
|
|
||||||
|
|
||||||
## License
|
Run frontend tests:
|
||||||
|
```bash
|
||||||
Code ist unter der [PolyForm Noncommercial 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0/) lizenziert. Für jegliche kommerzielle Nutzung bitte Kontakt aufnehmen.
|
cd frontend
|
||||||
|
npm run test
|
||||||
|
```
|
||||||
|
Reference in New Issue
Block a user