
# RMS (road management system)

## Table of Contents
- [Installation](#installation)
- [Dependencies](#dependencies)

<a name="dependencies"></a>
## Dependencies
<details>
  <summary>Server</summary>
  <ul>
    <li><img src="https://skillicons.dev/icons?i=php" width="20" style="vertical-align: middle;"/> <a href="https://www.php.net/downloads">php8.1</a></li>
    <li><img src="https://skillicons.dev/icons?i=laravel" width="20" style="vertical-align: middle;"/> <a href="https://www.php.net/downloads">Laravel10</a></li>
  </ul>
</details>

<details>
  <summary>Database</summary>
  <ul>
    <li><img src="https://skillicons.dev/icons?i=mysql" width="20" style="vertical-align: middle;"/> <a href="https://www.mysql.com">Mysql-15.1</a></li>
    <li><img src="https://skillicons.dev/icons?i=mariadb" width="20" style="vertical-align: middle;"/> <a href="https://mariadb.org">MariaDB-10.11.8</a></li>
  </ul>
</details>


<!-- GETTING STARTED -->
## Prod Prerequisites
apply bellow changes in order to set up the project on prod

<img src="https://skillicons.dev/icons?i=dynamodb" width="50" style="vertical-align: middle;"/>**Database Configuration**</span>

optimize MariaDB configuration through this path 
 ```sh
  /etc/mysql/mariadb.conf.d/50-server.cnf
 ```
 set this values
 
 |        Variable                   |  Value   |                   Hardware Condition                               | MaraiDB version    |
|:---------------------------------:|:--------:|:------------------------------------------------------------------:| :-----------------:|
|innodb_buffer_pool_instances       | `8`      |                   no condition                                     | `>=10.11`          |
|innodb_buffer_pool_size            | `8G`     |                   no condition                                     | `>=10.11`          |
|innodb_file_per_table              | `ON`     |                   no condition                                     | `>=10.11`          |
|innodb_log_file_size               | `768M`   |                   no condition                                     | `>=10.11`          | 
|innodb_log_files_in_group          | `4`      |                   in case of a 4-core system                       | `>=10.11`          |
|innodb_log_buffer_size             | `256M`   |                   no condition                                     | `>=10.11`          |
|innodb_thread_concurrency          | `32`     |                   no condition                                     | `>=10.11`          |
|innodb_stats_on_metadata           | `OFF`    |                   no condition                                     | `>=10.11`          |


<img src="https://skillicons.dev/icons?i=nginx" width="40" style="vertical-align: middle;"/> <span style="font-size: 24px; font-weight: bold;">**ginx Configuration**</span>


change Nginx configuration through this path in order to 
avoid any timeout response
 ```sh
  /etc/nginx/sites_available/exmapl.com
 ```
|       Variable        | Value |   Condtion   |         Context          |         
|:---------------------:|:-----:|:------------:|:------------------------:|
| proxy_connect_timeout | `120` | no condition | `http, server, location` |
|  proxy_send_timeout   | `120` | no condition | `http, server, location` |
|  proxy_read_timeout   | `120` | no condition | `http, server, location` |
|     send_timeout      | `120` | no condition | `http, server, location` | 
| fastcgi_read_timeout  | `300` | no condition |        `location`        |
| client_max_body_size  | `10M` | no condition |          `http`          |

<img src="https://skillicons.dev/icons?i=php" width="50" style="vertical-align: middle;"/> **Configuration**</span>

change php.ini through this path

 ```sh
  /etc/php/8.1/fpm/php.ini
 ```

set this values

|      Variable       | Value  |   Condtion   |    Context    |         
|:-------------------:|:------:|:------------:|:-------------:|
|    post_max_size    | `24M`  | no condition | fpm : php.ini |
| upload_max_filesize |  `8M`  | no condition | fpm : php.ini |
|    max_exec_time    | `120s` | no condition | fpm : php.ini |