Giter VIP home page Giter VIP logo

opis-manager-core's Introduction

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

opis-manager-core's People

Contributors

dependabot[bot] avatar guberlo avatar helias avatar herbrant avatar lemuelpuglisi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

opis-manager-core's Issues

Vincoli per insegnamento e schede_opis

Attualmente, nel database, sono presenti dei vincoli di integrità solo per le tabelle dipartimento ed cds. Sarebbe opportuno aggiungerli anche ad insegnamento e schede_opis in modo da evitare record duplicati.

Missing columns in different tables

dipartimento

In the table dipartimento are missing different columns, a workaround to restore them is using the following SQL query, but I suggest to update the migrations/seeder of laravel scripts.

ALTER TABLE `dipartimento` ADD `tot_cds`          INT(11)          NOT NULL;
ALTER TABLE `dipartimento` ADD `tot_moduli`       INT(11)          NOT NULL;           -- tot. insegn/ moduli
ALTER TABLE `dipartimento` ADD `tot_valutati`     INT(11)          NOT NULL;           -- insegnamenti valutati almeno da 1 studente (scheda1 o scheda3)
ALTER TABLE `dipartimento` ADD `report`           INT(11)          DEFAULT NULL;       -- insegnamenti valutati almeno da 5 studenti (scheda1 o scheda3)
ALTER TABLE `dipartimento` ADD `tot_schedeF`      INT(11)          NOT NULL;           -- valutazioni degli studenti frequentanti
ALTER TABLE `dipartimento` ADD `tot_schedeNF`     INT(11)          NOT NULL;           -- valutazioni degli studenti non-frequentanti

corso_di_studi

ALTER TABLE `corso_di_studi` ADD `tot_moduli`        INT(11)         NOT NULL;       -- tot. insegn/ moduli
ALTER TABLE `corso_di_studi` ADD `tot_valutati`      INT(11)         NOT NULL;       -- insegnamenti valutati almeno da 1 studente (scheda1 o scheda3)
ALTER TABLE `corso_di_studi` ADD `report`            INT(11)         DEFAULT NULL;   -- insegnamenti valutati almeno da 5 studenti (scheda1 o scheda3)
ALTER TABLE `corso_di_studi` ADD `tot_schedeF`       INT(11)         NOT NULL;       -- valutazioni degli studenti frequentanti
ALTER TABLE `corso_di_studi` ADD `tot_schedeNF`      INT(11)         NOT NULL;       -- valutazioni degli studenti non-frequentanti

insegnamento

ALTER TABLE `insegnamento` ADD `tot_schedeF`  INT(11);
ALTER TABLE `insegnamento` ADD `tot_schedeNF` INT(11);

Change unict_id field of cds table

I am currently working on the scraper for the new opis website and I just found out that the cds IDs are now alpha-numerical.
Currently the id field is an integer, hence it should maybe be changed to a string(?).

Here are some references to the problem:

2019/2020
image

2018/2019
image

Funzionalità amministratore richieste dalla commissione paritetica nel verbale del 12 giugno 2020

  1. Dare la possibilità ad un utente amministratore di modificare i pesi delle singole domande. Bisogna quindi salvare i pesi delle domande sul database.
    1.1. Non è richiesto dalla commissione ma potrebbe essere utile dare la possibilità di modificare anche i pesi delle risposte
    1.2. Impedire di avere gruppi di pesi di domande a somma maggiore di 1
  2. Dare la possibilità ad un utente amministratore di modificare il valore di scostamento, uno per la numerosità di schede e uno per la media della valutazione. Bisogna quindi salvare questa coppia sul database.
    2.1. Se non ho capito male questa coppia non è globale ma bisogna salvarne una per ogni CDS

Issue with teachings that fork

If at a certain academic year a teaching forks (e.g. the teaching was split into two channel A-L / M-Z), the schede before that academic year aren't provided by the insegnamento/with-id/<id>/schedeopis API.

TRUNCATE command

Need a shortcut to TRUNCATE all tables removing all samples data.

This will be used to run the scraper.

For now, we can't use TRUNCATE table because several tables are strictly linked by foreign_keys to other table, a workaround for this is:

DELETE FROM `corso_di_studi`;
DELETE FROM `dipartimento`;
DELETE FROM `insegnamento`;
DELETE FROM `schede_opis`;

If you want to truncate also the tables related to authentication/users:

DELETE FROM `password_resets`;
DELETE FROM `users`;

Refactoring

Refactorare campi schede_opis:

  • domande
  • domande_nf
  • motivo_nf
  • sugg
  • sugg_nf

Questi campi sono di tipo JSON, andrebbero migliorati e strutturati decentemente.
Attualmente domande e' un array di dimensione 11*4. ogni domanda e' rappresentata da valori a gruppi di 4.
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.