Backend service for opis-manager project. Take a look at our postman API 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.
You will need:
- PHP 7.3+
- Composer
- php-xml
- php-mbstring
- php-mysql
In a debian-based you could install PHP 7.4 following this guide and the related php extensions using:
sudo apt install php-xml php-mbstring php-mysql
Clone the repository
$ git clone https://github.com/UNICT-DMI/opis-manager-core.git
Copy the example enviroment file in a valid .env
$ cp .env.example .env
Opis-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 install
Set an application encryption key
$ php artisan key:generate
Generate a JWT secret
$ php artisan jwt:secret
Migrate the database schema
$ php artisan migrate
You can actually use seeders to fill the database with existing data.
$ php artisan db:seed
Start a local web server:
$ php artisan serve
This project uses phpunit with several Laravel testing features. In order to run tests, you must run:
$ php artisan test
Or directly with phpunit:
$ vendor/bin/phpunit
The 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:cache
- Laravel 7 - the web framework used
- Composer - Dependency management