Skip to content

Commit

Permalink
Documentation update and .env files clean-up.
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienTouze committed Jun 21, 2019
1 parent e158926 commit 88a632b
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 54 deletions.
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=70224d578f9919b2c3cb966f6117856b
APP_VERSION='0.4.1'
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
#TRUSTED_HOSTS='^localhost|example\.com$'
###< symfony/framework-bundle ###
Expand Down
14 changes: 14 additions & 0 deletions .template.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This is a template for environement configuration
# You should rename this file to .env.local and change the configuration according to your specific infrastructure.
# see .env for more information and documentation

###> symfony/framework-bundle ###
APP_ENV=prod #should be prod or dev
APP_SECRET=thisIsNotASecretChangeIt #random ~32 characters string
###< symfony/framework-bundle ###

###> doctrine/doctrine-bundle ###
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
DATABASE_URL=pgsql://user:[email protected]:5432/databasename?charset=UTF8 #update DB name, user and password
DATABASE_VERSION=9.6 #update to your DB version (>=9.6)
###< doctrine/doctrine-bundle ###
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# RapportNav

Outil pour éditer des rapports de mission de contrôle, à destination des agents de la Direction des Affaires Maritimes (DAM).
L'objectif de l'outil est de permettre la centralisation des données d'une mission de contrôle pour produire à l'ensemble des parties prenantes (environnement, sécurité maritime, gens de mers, ...) les rapports nécessaire ou exposer la base à un outil de visualisation pour le suivi d'indicateurs.

L'application est développée avec Symfony 4, apprès avoir cloné le dépôt et installé les dépenances avec composer il est nécessaire de configurer l'application.
Pour ce faire, renommer le fichier d'exemple `.template.env` en `.env.local` et y insérer les informations nécessaires (connexion à la base de données, ...).
La documentation plus détaillée est en anglais ci-dessous.

# RapportNav (en)

Simple reporting tool for Direction des Affaires Maritimes (French Maritime Affairs) public officials.

## Requirements

* PHP7.2
* composer

Other requirements are in composer.json and packages.json (for PHP and js) managed by [composer](https://getcomposer.org/) and [yarn](https://yarnpkg.com/)
To check all requirements on server use `composer check-platform-reqs` (after libraries install you may have additional platform requirements).

## Install

Install instructions are for server using Apache on Debian (Apache user being `www-data`) adapt to your needs.

A PostGre database and role should be created for the application.

```(bash)
$ cd /var/www/
$ git clone https://github.com/SebastienTouze/rapportNav.git app/rapportNav
```
Before taking the next steps, create your environment `.env.local` file copying `.template.env`.
You will need to configure :
* the app setting (**APP_ENV** and **APP_SECRET**)
* note that APP_ENV can be *prod*, *dev* or you can add other environment [see Symfony documentation for more information](https://symfony.com/doc/current/configuration.html#configuration-environments)
* make APP_SECRET random and unique, it is used as a seed for various functionalities [see Symfony documentation for more information](https://symfony.com/doc/current/reference/configuration/framework.html#secret)
* the database access and version (**DATABASE_URL** and **DATABASE_VERSION**)

Then finish install:

```(bash)
$ chown -R www-data:www-data app-ppr/
$ sudo -u www-data composer install
$ sudo -u www-data composer check-platform-reqs
$ sudo -u www-data yarn install
$ sudo -u www-data bin/console doctrine:migration:migrate
```

### Test environment configuration (for developers)

For tests only it is required to create a `var/data` folder where a SQLite database for tests will be instantiated.


## Conventions

Regarding coding style, if you use PHPStorm it should follow the coding rules in `.idea/codeStyle/codeStyleConfig.xml`.



2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"ext-intl": "^1.1",
"ext-json": "*",
"ext-mbstring": "*",
"ext-pgsql": "^7.2",
"friendsofsymfony/user-bundle": "^2.1",
"sensio/framework-extra-bundle": "^5.1",
"sonata-project/admin-bundle": "^3.48",
Expand Down
6 changes: 4 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
locale: 'fr'
app.version: '%env(resolve:APP_VERSION)%'
app.version: '0.4.1'

services:
# default configuration for services in *this* file
Expand Down
50 changes: 0 additions & 50 deletions doc/README.md

This file was deleted.

0 comments on commit 88a632b

Please sign in to comment.