Skip to content

UNICT-DMI/opis-manager-core

Repository files navigation

OPIS manager core 🫀

Backend service for opis-manager project. Take a look at our postman documentation

CodeFactor

Getting started

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.

Prerequisites

Install PHP 7.3+, composer and some php extensions: php-xml, php-mbstring, php-mysql, php-sqlite3.

Installation

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

Running the tests

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

Deployment

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

Docker Compose

Configure 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 up

You 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.

Built with

  • Laravel 8 - the web framework used
  • Composer - Dependency management

Contributors