This documentation provides instructions on setting up and running the News Aggregator website project. The project consists of a backend application built with Laravel and a frontend application developed with React.js. Both applications are Dockerized, allowing for easy deployment and management.
Before getting started, ensure that you have the following software installed on your machine:
- Docker Compose: Installation Guide
Follow the steps below to set up and run the News Aggregator website:
-
Clone the repository:
git clone https://github.com/ayoubechara/NewsFuse.git cd NewsFuse
-
Configure the backend:
- Rename the
.env.example
file in thebackend
directory to.env
and update the necessary configuration options such as database credentials, API keys, etc. - The API Keys you will need are: NewsAPI, The New York Times, The Guardian.
NEWS_API_KEY=YOUR_NEWS_API_KEY NYT_API_KEY=YOUR_NEW_YORK_TIMES_API_KEY THE_GUARDIAN_API_KEY=YOUR_THE_GUARDIAN_API_KEY
- Rename the
-
Build and run the project:
docker-compose up -d --build
-
Run Laravel migrations:
docker exec -it newsfuse-backend-1 sh
After that you have to migrate the tables with seeds to fill the categories table.
php artisan migrate:refresh --seed
-
Access the application:
- Backend API: http://localhost:8000
- Frontend application: http://localhost:3000
Once the project is up and running, you can use the News Aggregator website as follows:
-
User Registration and Authentication:
- Visit the frontend application URL (http://localhost:3000) in your web browser.
- Create a new account by clicking on the "Create account" link and providing the required information.
- After creating your account you will get redirected to a page to select your preferred sources.
- After successful registration, log in using your credentials on the login page.
-
Article Search and Filtering:
- On the homepage, you will find the news feed where you can search for articles by entering keywords in the search bar.
- Use the provided filters (date, category, and source) to narrow down the search results.
-
Personalized News Feed:
- To customize your news feed according to your preferences, simply access the preferences page by clicking on 'Preferences' located in the user dropdown menu.
- Select your preferred categories and sources to personalize the articles displayed on your news feed.
-
Mobile-Responsive Design:
- The News Aggregator website is optimized for viewing on mobile devices. You can access and use the website on your smartphone or tablet.
To access the article data from various sources, the project relies on external APIs that may require API keys. Please make sure to obtain the necessary API keys (NewsAPI, NYT API, TheGuardianAPI) and update the corresponding configuration options in the .env file of the backend application.