Application developed with the following technologies:
The project consists of 2 modules:
Module composed of two HTML pages, MVC architecture. Located in ./modules/Application
Technologies
HTML5. CSS, PHP, jQuery, D3.js
Basic structure
System interfaces
Interface with the Api module, which consumes the web services exposed through a series of endpoints that return JSON, with which the report graphics are built dynamically.
RESTful web services layer. Located in ./modules/Api
Technologies
PHP, MySQL, Doctrine
It consists of a series of endpoints consulted by the results page that provide data for the graphs on the results page.
Exposed endpoints
$ git clone [email protected]:diegoangel/informe-gei.git
$ cd informe-gei
$ git checkout zf3-version
$ composer install
Change connection credentials if applicable and run:
mysql -u root -proot -e " CREATE SCHEMA informe_gei "
The connection configuration data must be placed in the config/autoload/local.php
file.
. . .
return [
' doctrine ' => [
' connection ' => [
' orm_default ' => [
' driverClass ' => PDOMySqlDriver::class,
' params ' => [
' host ' => ' 127.0.0.1 ' ,
' user ' => ' root ' ,
' password ' => ' root ' ,
' dbname ' => ' informe_gei ' ,
' charset ' => ' utf8 ' ,
]
],
],
],
];
This file will not exist, so you must create it by copying, pasting and renaming the config/autoload/local.php.dist
file.
cp config/autoload/local.php.dist config/autoload/local.php
Additionally, this file is ignored in the version control repository and therefore the connection credentials will never be accidentally shared and remain secure.
The functionality of the Doctrine Migrations project is used to manage changes and versioning of the database. To learn more about the possibilities or operation of this tool, we suggest visiting the link to the project documentation.
Once the database is configured, proceed with the initial data loading.
Run the following command to start it:
./vendor/bin/doctrine-module migrations:migrate
You will then be informed that the command is about to be executed and its possible criticality and you must confirm it.
Loading configuration from the integration code of your framework (setter).
Doctrine Database Migrations
WARNING ! You are about to execute a database migration that could result in schema changes and data lost. Are you sure you wish to continue ? (y/n)
Press the letter and
Doctrine Migration configuration parameters are located in the config/autoload/global.php
file
. . .
return [
' doctrine ' => [
// migrations configuration
' migrations_configuration ' => [
' orm_default ' => [
' directory ' => ' data/Migrations ' ,
' name ' => ' Doctrine Database Migrations ' ,
' namespace ' => ' Migrations ' ,
' table ' => ' migrations ' ,
],
],
],
];
Start the console server on port 8080 and navigate to http://localhost:8080/ to check the normal operation of the website.
Note: The embedded PHP server is only for development , in production use Apache, Nginx or another that meets your requirements.
$ php -S 0.0.0.0:8080 -t public/ public/index.php
# O utilizar el alias definido en la sección scripts de composer.json:
$ composer serve
The project comes with a default development mode, useful for declaring configuration that will only run in the developer's local environment in order to, for example, be able to establish a connection to a test database among other things. Provides three aliases to enable, disable, and query status:
$ composer development-enable # habilita el modo desarrollo
$ composer development-disable # deshabilita el modo desarrollo
$ composer development-status # informa sobre si esta o no habilitado el modo desarrollo
Two unit test suites were created using PHPUnit.
./module/Api/test
./module/Application/test
Run the following command in the console.
$ ./vendor/bin/phpunit -v --debug --testsuite Api
$ ./vendor/bin/phpunit -v --debug --testsuite Application
You can run both suites with the command:
$ ./vendor/bin/phpunit -v --debug
To generate the test coverage report, execute the following command in the console and then open the file ./data/coverage/index.html
in the browser.
$ ./vendor/bin/phpunit -v --debug --coverage-html data/coverage
If you need to add local modifications to the PHPUnit configuration, copy phpunit.xml.dist
to phpunit.xml
and edit the new file; the latter takes precedence over the former when the tests are run and is ignored by the version control system. If you want to permanently edit the configuration, edit the phpunit.xml.dist
file.
Used Scrutinizer CI to run:
You can find the configuration file scrutinizer.yml
, which we use on the Scrutinizer continuous integration server.
The evaluation of code quality, test coverage and the status of the last build can be viewed through the badges found under the title of the document.
NOTE: Additional information such as images, technical documents and screenshots with project report information can be accessed in the ./doc folder.
Functional configuration example in Apache.
This example does not contemplate the declaration of logging levels, location of log files or special rewrite rules, for example.
< VirtualHost *:80>
ServerName informe-gei.local
DocumentRoot /var/www/html/informe-gei/public
< Directory /var/www/html/informe-gei/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
< IfModule mod_authz_core.c>
Require all granted
IfModule >
Directory >
VirtualHost >