This application is the base for the backend API applications.
- PHP 7.2+
- PDO with MySQL support
- Composer
- Apache with mod_rewrite enabled
- Clone this repo on your web server
- Run the
composer install
command to install all dependencies - Copy
etc/config.dist.json
toetc/config.json
and configure your environment (see below for full details on the configuration) - Run
vendor/bin/phinx migrate
to set up the database
The database schema is managed through Phinx. The phinx.php
file at the root of this repo configures the Phinx environment. Please see their documentation for more information.
The application's configuration is defined as follows:
- Database - The
joomla/database
package is used to provide a database connection as requireddatabase.host
- The address of the database serverdatabase.user
- The user to connect to the database asdatabase.password
- The password for the database userdatabase.database
- The name of the database to usedatabase.prefix
- The prefix to use for the database's tables
- Logging - The
monolog/monolog
package is used for logging functionalitylog.level
- The default logging level to use for all application loggers, this defaults to theERROR
levellog.application
- The logging level to use specifically for themonolog.handler.application
logger; defaults to thelog.level
value
- Error Reporting - The
errorReporting
configuration key can be set to a valid bitmask to be passed into theerror_reporting()
function - Debug - The
debug
key allows enabling the application's debug mode - Dev - The
dev
key allows to run application in the developer mode - Session Expire -
sessionExpire
the time amount in seconds when user session will be ended - Token Expire -
tokenExpire
the time amount in seconds when the token will be not valid - Token -
k
the JWT key for admins - Allowed Domains -
allowDomains
the list of domains which have access to the API