|
# RSS Feed Manager
|
|
|
|
A FastAPI application for managing RSS feeds with SQLite database.
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
.
|
|
├── app.py # Main FastAPI application
|
|
├── routers.py # API routes
|
|
├── requirements.txt # Python dependencies
|
|
├── feeds.db # SQLite database (auto-created)
|
|
└── templates/ # Jinja2 templates
|
|
├── base.html # Base template
|
|
├── index.html # Main splash screen
|
|
├── manage_list.html # Feed list view
|
|
├── manage_create.html # Create form
|
|
├── manage_upload.html # Upload form
|
|
├── manage_sync.html # Sync page with live updates
|
|
├── manage_edit.html # Edit form
|
|
├── newspapers_list.html # Newspapers list
|
|
├── newspaper_view.html # Pure newspaper layout
|
|
└── sync_logs_list.html # Detailed sync history
|
|
```
|
|
|
|
## Installation
|
|
|
|
1. Install dependencies:
|
|
```bash
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
2. Run the application:
|
|
```bash
|
|
python app.py
|
|
```
|
|
|
|
3. Open browser at `http://localhost:8000`
|
|
|
|
## Features
|
|
|
|
- **Upload JSON**: Upload RSS feed configuration files
|
|
- **Sync by URL**: Automatically upsert feeds based on URL (unique field)
|
|
- **CRUD Operations**: Create, Read, Update, Delete feeds
|
|
- **Google Search Theme**: Clean, familiar interface
|
|
- **Backend Rendered**: All pages rendered server-side with Jinja2
|
|
|
|
## Database
|
|
|
|
Uses SQLite with `dataset` library (1.6.2) for simple ORM operations.
|
|
|
|
### Feeds Table
|
|
- id (auto-generated)
|
|
- name
|
|
- url (unique identifier for upsert)
|
|
- type
|
|
- category
|
|
- structure (JSON field)
|
|
- last_synced (timestamp)
|
|
|
|
### Articles Table
|
|
- id (auto-generated)
|
|
- feed_name
|
|
- feed_url
|
|
- title
|
|
- link
|
|
- description
|
|
- content (clean text extracted by trafilatura)
|
|
- published
|
|
- author
|
|
- guid (unique identifier for upsert)
|
|
- created_at (timestamp)
|
|
- last_synchronized (timestamp)
|
|
|
|
### Sync Logs Table
|
|
- id (auto-generated)
|
|
- sync_time (timestamp)
|
|
- total_feeds (integer)
|
|
- completed_feeds (integer)
|
|
- failed_feeds (integer)
|
|
- total_articles_processed (integer)
|
|
- new_articles (integer)
|
|
- elapsed_seconds (float)
|
|
- avg_req_per_sec (float)
|
|
- timed_out (boolean)
|
|
|
|
### Newspapers Table
|
|
- id (auto-generated)
|
|
- created_at (timestamp)
|
|
- article_count (integer)
|
|
- articles_json (JSON string)
|
|
|
|
## Routes
|
|
|
|
- `/` - Main splash screen
|
|
- `/manage` - List all feeds
|
|
- `/manage/create` - Create new feed
|
|
- `/manage/upload` - Upload JSON file
|
|
- `/manage/sync` - Synchronize all RSS feeds
|
|
- `/manage/edit/{id}` - Edit feed
|
|
- `/manage/delete/{id}` - Delete feed
|
|
- `/newspapers` - List all newspapers
|
|
- `/newspaper/{id}` - View newspaper (pure newspaper layout)
|
|
- `/sync-logs` - View complete synchronization history with detailed statistics
|
|
- `/ws/sync` - WebSocket endpoint for live sync updates
|