Backend service for opis-manager project. Take a look at our postman documentation
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Install PHP 7.3+, composer and some php extensions: php-xml, php-mbstring, php-mysql, php-sqlite3.
Clone the repository
$ git clone https://github.com/UNICT-DMI/opis-manager-core.gitCopy the example enviroment file in a valid .env
$ cp .env.example .envOpis-manager database is quite agnostic to the database driver under the hood, so configure it in .env.
DB_CONNECTION=(database driver)
DB_HOST=(database host server)
DB_PORT=(database port)
DB_DATABASE=(database name)
DB_USERNAME=(database user)
DB_PASSWORD=(database user password)Install project dependencies
$ composer installSet an application encryption key
$ php artisan key:generateGenerate a JWT secret
$ php artisan jwt:secretMigrate the database schema
$ php artisan migrateYou can actually use seeders to fill the database with existing data.
$ php artisan db:seedStart a local web server:
$ php artisan serveThis project uses phpunit with several Laravel testing features. In order to run tests, you must run:
$ php artisan testOr directly with phpunit:
$ vendor/bin/phpunitThe recommended deployement setup is NGINX + php-fpm. Set up the project and link a virtual host to public/index.php.
Cache configurations and routes for faster performances:
$ php artisan config:cache
$ php artisan route:cacheConfigure the .env file using as DB_HOST=db, keep the variableDB_PASSWORD= empty.
Run the following command to pull the image from the github docker hub and to run it locally:
docker-compose upYou can check if the application is running on http://127.0.0.1:8080/ but keep in mind that you need to insert a database into the current mysql db container.
- Laravel 8 - the web framework used
- Composer - Dependency management