Server to filkom news reader API provider and crawl news data
Branch: development
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
application
assets
.editorconfig
.gitignore
.htaccess
CONTRIBUTING.md
LICENSE
README.md
composer.json
composer.lock
composer.phar
db_structure.sql
favicon.ico

README.md

Filkom Brawijaya News Reader Server

GitHub release Codacy Badge

Filkom News Reader Server is backend service for filkom news reader app. It build based on Codeigniter. The server will perform crawling data and give API for access the data.

See Online Here

Requirement

  • PHP >= 7.1
  • Codeigniter >= 3.1.6

Installation

  • Clone this Repo
  • Download Codeigniter file
  • Unzip/Extract the Codeigniter file but don't replace the composer.json
  • Change crawler token in web config application/config/web_config.php
    $config['crawler_token'] = 'YOUR_TOKEN'
    
  • Change some config application/config/config.php from Codeigniter to this
    $config['index_page'] = '';
    ...
    $config['subclass_prefix'] = 'FNR_';
    ...
    $config['composer_autoload'] = TRUE;
    
  • Change routers config application/config/routes.php from Codeigniter to this
    $route['default_controller'] = 'Docs';
    
  • Add some constant in application/config/constants.php
    /*
     * JSON Object Key
     */
    defined('KEY_STATUS') OR define('KEY_STATUS', 'status');
    defined('KEY_STATUS_CODE') OR define('KEY_STATUS_CODE', 'code');
    defined('KEY_STATUS_MESSAGE') OR define('KEY_STATUS_MESSAGE', 'message');
    defined('KEY_DATA') OR define('KEY_DATA', 'data');
    
    /*
     * JSON Default Value
     */
    defined('VALUE_STATUS_OK') OR define('VALUE_STATUS_OK', 'OK');
    defined('VALUE_STATUS_CODE_OK') OR define('VALUE_STATUS_CODE_OK', 200);
    defined('VALUE_STATUS_MESSAGE_DEFAULT') OR define('VALUE_STATUS_MESSAGE_DEFAULT', null);
    defined('VALUE_STATUS_ERROR') OR define('VALUE_STATUS_ERROR', 'ERROR');
    defined('VALUE_STATUS_CODE_ERROR') OR define('VALUE_STATUS_CODE_ERROR', 404);
    defined('VALUE_STATUS_MESSAGE_ERROR') OR define('VALUE_STATUS_MESSAGE_ERROR', 'Something wrong!');
    defined('VALUE_DATA_ERROR') OR define('VALUE_DATA_ERROR', null);
    
  • Add some code in project root index.php
    /**
     * -------------------------------------------------------------------
     * CUSTOM CONFIG
     * -------------------------------------------------------------------
     *
     */
    date_default_timezone_set('Asia/Jakarta'); // Your Timezone
    define('ROOTPATH',basename(__DIR__));
    
  • Import the db_structure.sql to your database
  • Change config for database in application/config/database.php
  • Install composer dependencies
    $ php composer.phar install
  • Change CI_ENV in bottom of .htaccess to production or developmet

Contributing

Please look at Contributing

License

Copyright 2017 Rizky Kharisma (@ngengs).

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.