Dématérialiser et simplifier les démarches administratives
Find a file
Pierre de La Morinerie b8328b90e6 README: always use binstubs
Otherwise we use the gem installed globally, which may not be the same
version as the gem defined in the project Gemfile.
2018-06-13 10:45:19 +02:00
.circleci Bump ruby to 2.5.0 2018-03-02 15:42:20 +01:00
app Remove erroneous space in haml 2018-06-13 10:21:57 +02:00
bin Update binstubs 2018-05-22 17:03:52 +02:00
config [Fix #2089] Add missing validation message 2018-06-12 16:36:26 +02:00
db Create virus scan model to store clamav result 2018-06-12 15:12:38 +02:00
doc Remove the mandataire_social guess 2018-03-20 16:09:00 +01:00
lib Add task to scan old champs pj 2018-06-12 15:12:40 +02:00
log First Commit 2015-08-10 11:05:06 +02:00
public Revert "Commit compiled assets" 2018-01-31 16:23:40 +01:00
spec When a new PJ is uploaded enqueue a anti virus scan job 2018-06-12 15:12:39 +02:00
vendor/assets tps.apientreprise.fr -> demarches-simplifiees.fr 2018-03-01 10:33:53 +01:00
.editorconfig Add a .editorconfig file 2017-04-04 17:32:36 +02:00
.gitignore Gitignore: add storage/ 2018-02-26 10:17:08 +01:00
.haml-lint.yml Bump development gems 2018-01-23 16:26:56 +01:00
.rspec First Commit 2015-08-10 11:05:06 +02:00
.rubocop.yml Bump gems 2018-05-18 18:14:17 +02:00
.ruby-version Bump ruby to 2.5.0 2018-03-02 15:42:20 +01:00
.scss-lint.yml Add the direct_upload JS ans SCSS files 2018-02-15 11:14:03 +01:00
config.ru Delete redis and actioncable 2017-10-12 07:21:02 +02:00
Gemfile [#2071] Sort Gemfile 2018-06-10 11:39:48 +02:00
Gemfile.lock [Fix #2071] Let premailer generate a plain text version of html emails 2018-06-09 09:00:33 +02:00
Guardfile Enable the Layout/EmptyLines cop 2017-06-13 10:35:20 +02:00
LICENSE.agpl-3.0.txt Add license 2017-04-03 11:05:37 +02:00
Procfile Add a Procfile and document usage of hivemind 2018-01-02 11:20:22 +01:00
Rakefile Bump development gems 2018-03-06 16:17:22 +01:00
README.md README: always use binstubs 2018-06-13 10:45:19 +02:00

demarches-simplifiees.fr

Context

demarches-simplifiees.fr est un site web conçu afin de répondre au besoin urgent de l'État d'appliquer la directive sur le 100 % dématérialisation pour les procédures administratives.

Dépendances

Tous environnements

  • postgresql

Développement

Tests

Initialisation de l'environnement de développement

Afin d'initialiser l'environnement de développement, exécutez la commande suivante :

bundle install

Création de la base de données

Les informations nécessaire à l'initialisation de la base doivent être pré-configurées à la main grâce à la procédure suivante :

su - postgres
psql
> create user tps_development with password 'tps_development' superuser;
> create user tps_test with password 'tps_test' superuser;
> \q

Afin de générer la BDD de l'application, il est nécessaire d'exécuter les commandes suivantes :

# Create and load the schema for both databases
bin/rails db:create db:schema:load

# Migrate the development database and the test database
bin/rails db:migrate

Bouchonnage de lauthentification

Créer le fichier config/france_connect.yml avec le contenu

particulier_identifier: ''
particulier_secret: ''

particulier_redirect_uri: ''
particulier_authorization_endpoint: ''
particulier_token_endpoint: ''
particulier_userinfo_endpoint: ''
particulier_logout_endpoint: ''

Créer le fichier config/github_secrets.yml avec le contenu

client_id: ''
client_secret: ''

Connexion a Pipedrive

Dans le fichier config/intializers/token.rb, ajouter

PIPEDRIVE_TOKEN = 'token'

Note : les valeurs pour ces paramètres sont renseignées dans le Keepass

Création des comptes initiaux

bin/rails console
> email = "<votre email>"
> password = "<votre mot de passe>"
> Administration.create(email: email, password: password)
> Administrateur.create(email: email, password: password)
> Gestionnaire.create(email: email, password: password)
> User.create(email: email, password: password)

Lancement de l'application

overmind s

Programmation des jobs

AutoArchiveProcedureJob.set(cron: "* * * * *").perform_later
WeeklyOverviewJob.set(cron: "0 8 * * 0").perform_later
AutoReceiveDossiersForProcedureJob.set(cron: "* * * * *").perform_later(procedure_declaratoire_id, 'en_instruction')
FindDubiousProceduresJob.set(cron: "0 0 * * *").perform_later
Administrateurs::ActivateBeforeExpirationJob.set(cron: "0 8 * * *").perform_later

Exécution des tests (RSpec)

Pour exécuter les tests de l'application, plusieurs possibilités :

  • Lancer tous les tests

      bin/rake spec
      bin/rspec
    
  • Lancer un test en particulier

      bin/rake spec SPEC=file_path/file_name_spec.rb:line_number
      bin/rspec file_path/file_name_spec.rb:line_number
    
  • Lancer tous les tests d'un fichier

      bin/rake spec SPEC=file_path/file_name_spec.rb
      bin/rspec file_path/file_name_spec.rb
    

Debug

Une fois overmind lancé, et un breakpoint byebug inséré dans le code, il faut se connecter au process server dans un nouveau terminal afin d'intéragir avec byebug :

overmind connect server

Linting

  • Faire tourner RuboCop : bundle exec rubocop
  • Faire tourner Brakeman : bundle exec brakeman
  • Linter les fichiers HAML : bundle exec haml-lint app/views/
  • Linter les fichiers SCSS : bundle exec scss-lint app/assets/stylesheets/
  • AccessLint tourne automatiquement sur les PRs

Déploiement

  • Tout nouveau commit ajouté à la branche dev est automatiquement déployé en intégration
  • Tout nouveau commit ajouté à la branche master est automatiquement déployé en production

Régénérer les binstubs

bundle binstub railties --force
bin/rake rails:update:bin

Tâches Super Admin

  • ajouter un compte super admin : bin/rake admin:create_admin[email-du-compte-github@exemple.com]

  • lister les comptes super admin : bin/rake admin:list

  • supprimer un compte super admin : bin/rake admin:delete_admin[email-du-compte-github@exemple.com]

Compatibilité navigateurs

L'application supporte les navigateurs récents Firefox, Chrome, Internet Explorer (Edge, 11).

La compatibilité est testée par Browserstack.

Performance

View performance data on Skylight

Nous utilisons Skylight pour suivre les performances de notre application.