Your task is to create a PHP application that is a feeds reader. The app can read feed from multiple feeds and store them to database. Sample feeds http://www.feedforall.com/sample-feeds.htm.
- The application must be developed by using a php framework and follow coding standard of that framework.
- As a developer, I want to run a command which help me to setup database easily with one run.
- As a developer, I want to run a command which accepts the feed urls (separated by comma) as argument to grab items from given urls. Duplicate items are accepted.
- As a developer, I want to see output of the command not only in shell but also in pre-defined log file. The log file should be defined as a parameter of the application.
- As a user, I want to see the list of items which were grabbed by running the command line. I also should see the pagination if there are more than one page. The page size is up to you.
- As a user, I want to filter items by category name on list of items.
- As a user, I want to create new item manually
- As a user, I want to update/delete an item
- Fork this repository
- Start coding
- Use gitflow to manage branches on your repository
- Open a pull request to this repository after done
- Apache: 2.2 or higher.
- PHP: 7.1.17 or higher.
- MySQL: 5.5 or higher.
- Composer: 1.6.5 or higher.
- Install vendor:
composer install - Create .env file:
cp .env.example .env - Edit database configuration in .env file:
DB_DATABASEvalue can be whatever. You don't need to create a database, my command in Usage section will help you.DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=feeds_reader DB_USERNAME=root DB_PASSWORD=
- Generate key application:
php artisan key:generate
- Create database:
php artisan initializeDatabase - Get data from feed URL:
php artisan feedUrl {URL} {logFile}
-
URLparameter is the URL you want to get feed data. You can implement with many URLs by separating by comma. -
logFileparameter is the log file to write output of this process.- Currently, accepted values for this parameter are
feed_log_1,feed_log_2,feed_log_3. These files are located instorage/logs. - You can edit or create more log options in
config/logging.php.
- Currently, accepted values for this parameter are
-
Example command:
php artisan feedUrl https://www.feedforall.com/sample.xml,https://www.feedforall.com/sample-feed.xml feed_log_1
After running two commands above, your database is completely created.
You also can use web app on: http://domain.name/base-php
- Domain name depends on server you use.
This app is powered by Laravel v5.8, Bootstrap v3.4.0 and jQuery v3.4.1
Khoa Nguyen | [email protected]