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.
- 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.
- Docker and Docker Compose installed.
- Familiarity with Laravel Sail for local development.
-
Set Docker Context
docker context use default
-
Clone the Repository
git clone https://github.com/asmshaon/news-aggregator cd news-aggregator -
Start the Application
./vendor/bin/sail up OR for 1st run you may need this with --build flag ./vendor/bin/sail up --build -
Encrypt/Decrypt Environment File
- Contact me to obtain the encryption key.
- Decrypt
.envfile:./vendor/bin/sail artisan env:decrypt --key=<your-encryption-key> --filename=.env.decrypted --force
-
Prepare the
.envFile- Copy the decrypted environment file:
cp env.decrypted .env
- Copy the decrypted environment file:
-
Run Migrations
./vendor/bin/sail composer install
-
Run Migrations
./vendor/bin/sail artisan migrate
-
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
- Import all sources:
-
Optional: Schedule Tasks
./vendor/bin/sail artisan schedule:work
- Contact me to obtain the Postman collection for API testing.
- Keep the encryption key secure and use it consistently for encrypting and decrypting the
.envfile. - For production, consider setting up a robust environment variable management system.
- Use the
schedule:workcommand for periodic updates of the news database.
- NEWS API ORG
- Guardian API
- New York Times API
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! 🎉