A modern, concurrent RSS feed aggregator written in Go. Collects posts from multiple RSS feeds, cleans and stores them in PostgreSQL, and exposes a REST API for users to register, follow feeds, and retrieve posts.
- 🚀 Fast concurrent RSS scraping (configurable interval and workers)
- 🧹 Automatic HTML and UTF-8 cleaning for all post data
- 🔑 User registration and API key authentication
- 📡 Add, follow, and unfollow RSS feeds
- 💼 Aggregates job posts and other content
- 🗄️ PostgreSQL for persistent storage
- 🌐 REST API with pretty JSON responses
RSSAggregator/
├── cmd/api/ # Main application entry point
├── internal/
│ ├── handlers/ # HTTP handlers (users, feeds, posts, etc.)
│ ├── database/ # Database queries and models (sqlc generated)
│ ├── scraper/ # RSS scraping logic
│ ├── utils/ # Utilities (JSON, cleaning, etc.)
│ ├── models/ # Data models and transformations
│ └── auth/ # Authentication helpers
├── sql/
│ ├── schema/ # Database migrations
│ └── queries/ # SQL queries for sqlc
├── .env # Environment variables
├── go.mod / go.sum # Go dependencies
└── README.md
git clone https://github.com/CodeEzard/RSSAggregator.git
cd RSSAggregator
go mod tidy# Create the database (if not exists)
createdb rssaggregator
# Run migrations
go install github.com/pressly/goose/v3/cmd/goose@latest
goose -dir sql/schema postgres "postgres://username:password@localhost:5432/rssaggregator?sslmode=disable" upCreate a .env file:
PORT=8080
DB_URL=postgres://username:password@localhost:5432/rssaggregator?sslmode=disable
go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
sqlc generatego build -o bin/rssaggregator cmd/api/main.go
./bin/rssaggregatorAll endpoints (except user creation) require:
Authorization: ApiKey YOUR_API_KEY
POST /v1/users— Register a new userGET /v1/users— Get current user info
POST /v1/feeds— Add a new RSS feedGET /v1/feeds— List all feeds
POST /v1/feed_follows— Follow a feedGET /v1/feed_follows— List followed feedsDELETE /v1/feed_follows/{feedFollowID}— Unfollow a feed
GET /v1/posts— Get posts from followed feedsGET /v1/posts?clean=true&pretty=true— Get cleaned, pretty-printed posts
# Register a user
curl -X POST http://localhost:8080/v1/users \
-H "Content-Type: application/json" \
-d '{"name": "Alice"}'
# Add a feed
curl -X POST http://localhost:8080/v1/feeds \
-H "Authorization: ApiKey YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "RemoteOK", "url": "https://remoteok.io/remote-jobs.rss"}'
# Follow a feed
curl -X POST http://localhost:8080/v1/feed_follows \
-H "Authorization: ApiKey YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"feed_id": "FEED_UUID"}'
# Get posts
curl -H "Authorization: ApiKey YOUR_API_KEY" \
"http://localhost:8080/v1/posts?pretty=true"- Removes HTML tags and entities
- Cleans invalid UTF-8 sequences
- Normalizes whitespace
- Truncates long descriptions
- UTF-8 errors: The app automatically cleans invalid byte sequences.
- Database errors: Check your
DB_URLand PostgreSQL status. - Feed errors: Ensure the RSS feed URL is valid and reachable.
- Fork the repo
- Create a feature branch
- Commit your changes
- Open a pull request
MIT License
**Built with Go,