Skip to content

A powerful API platform that integrates multiple news APIs into a unified interface. It provides features like centralized news access, keyword search, personalized news feeds based on user preferences (sources, categories, authors), and more. Perfect for delivering tailored and comprehensive news experiences in a single place.

Notifications You must be signed in to change notification settings

asmshaon/news-aggregator

Repository files navigation

News Aggregator API Platform

The News Aggregator platform combines multiple news APIs into a unified experience, allowing users to browse, search, and personalize their news feed. This repository provides a streamlined setup for developers to get started quickly.


Features

  • Integrates various news APIs into a single platform.
  • Provides a personalized news feed based on user preferences.
  • Enables searching and filtering of news by keyword, category, source, and author.
  • Supports scheduled scraping and import of news data.

Setup Instructions

Prerequisites

  • Docker and Docker Compose installed.
  • Familiarity with Laravel Sail for local development.

Installation Steps

  1. Set Docker Context

    docker context use default
  2. Clone the Repository

    git clone https://github.com/asmshaon/news-aggregator
    cd news-aggregator
  3. Start the Application

    ./vendor/bin/sail up
    OR for 1st run you may need this with --build flag
    ./vendor/bin/sail up --build
  4. Encrypt/Decrypt Environment File

    • Contact me to obtain the encryption key.
    • Decrypt .env file:
      ./vendor/bin/sail artisan env:decrypt --key=<your-encryption-key> --filename=.env.decrypted --force
  5. Prepare the .env File

    • Copy the decrypted environment file:
      cp env.decrypted .env
  6. Run Migrations

    ./vendor/bin/sail composer install
  7. Run Migrations

    ./vendor/bin/sail artisan migrate
  8. Scrape News Data

    • Import all sources:
      ./vendor/bin/sail artisan news-aggregator:scrape-all
    • Import individual sources:
      ./vendor/bin/sail artisan news-aggregator:guardian-api:scrape
      ./vendor/bin/sail artisan news-aggregator:news-api:scrape
      ./vendor/bin/sail artisan news-aggregator:ny-times-api:scrape
  9. Optional: Schedule Tasks

    ./vendor/bin/sail artisan schedule:work
  10. Download the Frontend APP and Check out there


Postman Collection

  • Contact me to obtain the Postman collection for API testing.

Notes

  • Keep the encryption key secure and use it consistently for encrypting and decrypting the .env file.
  • For production, consider setting up a robust environment variable management system.
  • Use the schedule:work command for periodic updates of the news database.

API Integrated

  • NEWS API ORG
  • Guardian API
  • New York Times API

Troubleshoot

Please see this documentation if you are unable to run this app, this may vary, I am using Linux https://laravel.com/docs/11.x/sail#rebuilding-sail-images

*** If you get any ports conflicts please kill your process or use different port on docker compose file ***

Happy Developing! 🎉

About

A powerful API platform that integrates multiple news APIs into a unified interface. It provides features like centralized news access, keyword search, personalized news feeds based on user preferences (sources, categories, authors), and more. Perfect for delivering tailored and comprehensive news experiences in a single place.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages