Dive into a seamless news experience with the RSS Feed Aggregator! This project is a lean, mean, and efficient Go application designed to fetch and display RSS/Atom feeds from various sources in one convenient place. Built with performance in mind and featuring a clean web interface powered by HTMX, it's perfect for staying on top of your favorite content without the clutter. ✨
Getting this aggregator up and running on your local machine is straightforward. You have a couple of options: directly using Go or leveraging Docker for containerization.
- Go: Version 1.24.2 or newer
- Git: For cloning the repository
- Docker (Optional): If you prefer to run it in a container
First things first, grab the code:
git clone https://github.com/samueltuoyo15/Rss-Feed-Aggregator.git
cd Rss-Feed-AggregatorFollow these steps to run the application directly using your Go installation:
- 📦 Download Dependencies:
go mod download
- 🛠️ Build the Application:
go build -o main ./cmd/main.go
- 🚀 Run the Application:
./main
The server will start on http://localhost:8080.
For a more isolated and portable setup, Docker is your friend:
- 🐳 Build the Docker Image:
docker build -t rss-feed-aggregator . - 🚀 Run the Docker Container:
docker run -p 8080:8080 rss-feed-aggregator
The application will now be accessible via http://localhost:8080 in your browser.
Once the server is running (either via Go or Docker), you can interact with the RSS Feed Aggregator in a couple of ways:
Open your web browser and navigate to http://localhost:8080. You'll be greeted by the main page, which automatically fetches and displays the latest articles from the configured RSS feeds. The UI is designed to be responsive, providing a clean reading experience across different devices.
The feed items are loaded using HTMX, providing a snappy, dynamic feel without full page reloads.
The RSS feeds are configured via a YAML file located at config/feeds.yaml. You can easily add or remove feeds by editing this file.
Here's an example of the configuration structure:
feeds:
- name: "TechCrunch"
url: "https://techcrunch.com/feed/"
- name: "BBC News"
url: "http://feeds.bbci.co.uk/news/rss.xml"
- name: "BBC Sport - Football"
url: "http://feeds.bbci.co.uk/sport/football/rss.xml"After modifying config/feeds.yaml, you'll need to restart the application for the changes to take effect.
The aggregator also exposes a simple API endpoint for programmatically accessing the aggregated feeds:
- GET
/api/feeds: Returns a JSON array of all fetched feeds and their respective items. This is what the web interface uses under the hood for initial data and subsequent updates.
Example cURL request:
curl http://localhost:8080/api/feeds- 📰 Multi-Source Feed Aggregation: Consolidates articles from multiple RSS/Atom feeds into a single, unified view.
- 🚀 Efficient Fetching: Utilizes Go's concurrency features to fetch feeds in parallel, ensuring quick updates.
- 🖼️ Intelligent Thumbnail Extraction: Beyond standard RSS enclosures, it includes custom logic to extract featured images from linked articles (e.g., TechCrunch).
- ⚙️ YAML-based Configuration: Easily add, remove, or modify feed sources by editing a simple
feeds.yamlfile. - 🌐 Modern Web Interface: A clean and responsive user interface built with HTML templates, HTMX for dynamic content loading, and Tailwind CSS for styling.
- 💡 Custom Template Functions: Includes handy functions for date formatting and content truncation to present information neatly.
- 📦 Docker Support: Provided
Dockerfilefor easy containerization and deployment. - 📡 RESTful API: Exposes a
/api/feedsendpoint for consuming the aggregated data programmatically.
| Category | Technology | Description |
|---|---|---|
| Backend | Go | The primary language for the server-side logic, chosen for its concurrency and performance. |
| Libraries | gofeed | Robust RSS/Atom feed parsing library. |
| goquery | A Go library that brings jQuery-like syntax to Go for HTML parsing (used for thumbnail extraction). | |
| yaml.v3 | Handles YAML file parsing for feed configuration. | |
| Frontend | HTMX | A lightweight JavaScript library for dynamic UI updates via HTML attributes. |
| Tailwind CSS | A utility-first CSS framework for rapid and consistent styling. | |
| Containerization | Docker | For building and running the application in isolated containers. |
This project is open-source and released under an MIT License.
Samuel Tuoyo
A passionate developer with a keen interest in building efficient and scalable applications.