davidhirtz / instafeed

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README

This project provides a basic backend to manage and configure Instagram Access Tokens through the Instagram Basic Display API. It's written in PHP, based on the Yii 2 Framework by David Hirtz for Anakin.

STRUCTURE

  commands            contains the console controllers for the cron job
  config/             contains application configurations
  controllers/        contains web controller classes
  messages/           contains translations (if required) 
  models/             contains model classes
  runtime/            contains files generated during runtime
  views/              contains view files for the web application
  web/                contains the entry script and web resources

REQUIREMENTS

This project requires PHP 7.4 or higher and MySQL 8.x. Detailed requirements can be found by running Composer.

INSTALLATION

Fetch source code via GIT.

git init
git remote add origin git@github.com:davidhirtz/instafeed.git
git fetch origin
git branch master origin/master
git checkout master

If you do not have Composer, you may install it by following the instructions at getcomposer.org. On Linux and Mac OS X, you'll run the following commands:

curl -sS https://getcomposer.org/installer | php

You can then install the dependencies using the following command:

php composer.phar install --no-dev

CONFIGURATION

Credentials

Create file config/params.php with your sensitive information, which should not be added to the version control. The file must include a cookie validation key, which can also be auto-generated by running the command below.

<?php
return [
    'cookieValidationKey' => 'YOUR-COOKIE-VALIDATION-KEY',
];
php yii params

Database

The database credentials are located in config/db.php. You can also run the migrations with the command below, which will set up the database configuration before applying the migrations.

<?php
return [
    'dsn' => 'mysql:host=127.0.0.1;dbname=DATABASE',
    'username' => 'USER',
    'password' => 'PASSWORD',
];
php yii migrate

Permissions

Important: Directories runtime and web/assets need write permissions for web and console user.

Staging

You can enable development mode by setting an environment variable YII_ENV to "dev" or "local". The latter is excluded from version control.

About


Languages

Language:PHP 99.0%Language:Batchfile 1.0%