Simple news RSS Reader that is capable of reading news from several news APIs. It currently can read from two APIs:
- reuters.com
Does not support images
- newsapi.org
Please note: It was not possible to use Google's news API as it has been dupricated and taken out of service.
The project has been divided into two parts:
- API that serves the news. (Based on SLIM Framework mainly)
- Stand alone user UI. (Created using Redux, react and bootstrap - Compiled using webpack)
The RSS Reader has the following feature:
- Displays news articles.
- Displays categories that we can use to view different types of articles for example sports or economy.
- We can change the news source.
- We can select a favorite category by clicking on the star on its left. When we revisit the RSS Reader or refresh the page, the content of the favorite category will be displayed in the home page.
- Device friendly (Responsive). Works on desktop, tablets and mobile devices.
Based on SLIM framework. It uses different request methods (GET, POST, PUT and DELETE) to carry out operations. It can be easily extended to support more news APIs.
In order to run the API the following are required:
- A web server like Apache (CROS capable).
- Composer to install the required packages like SLIM framework.
- Enable mode rewrite on the server.
- PHP 7.
- Download the source code git.
- Extract it and configure your web server to run it. (See the slim website for more information)
- Using the command line navigate to the
rss-reader
directory and install the require packages using compose by issuing the following command
composer install
- You're done.
Currently the RSS Reader supports:
If you would you like to extend the client by adding more news sources then create a news adapter by implementing the following interface:
RSSReader\NewsSources\Adapters\Interfaces\NewsAdapter
And finally add your Adapter
to the News Adapter factory:
RSSReader\NewsSources\NewsAdapterFactory
The client is a stand alone HTML page. The page can be run in one of two ways:
- Can be served to the audience using a web server like apache.
- The easy way:
Can be simply downloaded to the desktop and run it in a browser.
The stand alone page has been created using:
- react
- Redux
- Bootstrap
- Webpack (Translates ES6 to ES5 using babel and also compresses the JS code into a single file.)
The stand alone client page location:
/rss-reader/public/index.html
NMP
is required to install the required packages to run the page.
Once NPM
has been installed, navigate to the UI's src directory and install the required packages:
cd rss-reader/src_ui/
npm install
Once npm
has finished installing the different packages, you will be able to run webpack-dev-server
and acces the page from the server.
Just run the following command
webpack-dev-server
You will be able to access the page by opening a browser and visitng localhost:8080.
If you want to build the JS package only without having to run the sevrer then execute:
webpack
- Added unit tests to SLIM and (redux+react).
- Add error messages system. Currently the Stand alone page goes bananas if the API is not running. I did not have time to manage the such errors.
- Compress the style sheets and the JS files of the UI client.
- Use actors to execute several action in a row.