Skip to content

betagouv/aides-jeunes

master
Switch branches/tags
Code

Latest commit

* Bump aides-velo from 2.0.40 to 2.0.42

Bumps [aides-velo](https://github.com/mquandalle/mesaidesvelo/tree/HEAD/package-aides-velo) from 2.0.40 to 2.0.42.
- [Release notes](https://github.com/mquandalle/mesaidesvelo/releases)
- [Changelog](https://github.com/mquandalle/mesaidesvelo/blob/master/package-aides-velo/CHANGELOG.md)
- [Commits](https://github.com/mquandalle/mesaidesvelo/commits/HEAD/package-aides-velo)

---
updated-dependencies:
- dependency-name: aides-velo
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Ajout des logos des institutions

* Résolution conflits package.json

* Corrige l'outil de géneration d'institutions d'aides vélos

* Met à jour en version `2.0.43`

* Ajoute le code siren de la ville de Mennecy

* Ajoute le code siren de la ville de Montigny-lès-Metz

* Ajoute le siren

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Valandr <valerie.andriani@gmail.com>
Co-authored-by: kout95 <antoine.bernier@outlook.fr>
8d3c4c4

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
lib
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Cette documentation est technique. Pour plus d'informations sur le simulateur d'aides pour les jeunes, regardez notre wiki.

L'interface utilisateur (et le serveur principal) du simulateur d'aides et de prestations sociales pour les jeunes. Il est basé sur simulateur socio-fiscal libre Openfisca.

Setup

Stack

3rd parties

Front only install

If you want to play with the UI, you can be set up very quickly:

npm ci
npm run front

Cf. package.json for more on the underlying commands.

The application should be accessible at localhost:8080.

Full install

System dependencies

Ubuntu

Make sure build-essential, mongodb and node 16.x are installed on your machine:

sudo apt-get install build-essential
sudo apt-get install mongodb

For all platforms

The runtime is Node 16.x for the web application, and Python 3.7 for Openfisca.

You can for example use nvm to install this specific version.

You will need pip to install Openfisca.

Application

Run the following from the root of the project to install the dependencies

npm ci

Openfisca

⚠️ As of now, python3.9 is not yet compatible with all python packages used in Openfisca. It is recommend to use a lower version such as 3.8.13.

You should install Python 3 in a virtual environment to prevent yourself from messing with your main python installation. The instructions below rely on the built-in venv module so that there are no additional external dependencies:

python3 -m venv .venv   # create the virtual environment in the .venv folder
source .venv/bin/activate  # activate the virtual environment
pip install pip --upgrade  # make sure we're using the latest pip version
npm run install-openfisca  # install dependencies

Then, to start the OpenFisca server, simply run source .venv/bin/activate followed by npm run openfisca.

OpenFisca dependencies are specified in openfisca/requirements.txt, a basic Python requirements file. It is possible to refer to non-production commit hashs but is prefered to use main-merged commits.

Development mode

If you are working on openfisca-france and want to use your local version:

cd (...)/openfisca-france
pip install --editable .

Test in production mode

If you want to test locally the app in production mode:

npm run build
npm run start

Usage

First, start a Mongo server:

npm run db

Then, in another shell (you will have to run source .venv/bin/activate), start the Openfisca server:

OPENFISCA_WORKERS=1 npm run openfisca

Finally, in a third shell, start the server:

npm run serve

Testing

There are several levels of tests:

  • Unit tests are executed by Jest and run with npm test.
  • End-to-end test are executed with Cypress with npm run cypress

You can safely use npm test && npm run cypress to drive your developments.

Email

We use the framework MJML to design and integrate the templates. Sendinblue is our service to send emails.

The development server for emails can be easily start with: node tools/mjml.js or npm run serve-mail

If you want to verify the email sending, the variable SEND_IN_BLUE_PRIVATE_KEY=API_SECRET should be configured in your .env file. You can create a free account here or request one on the mattermost channel.

Linting and format

We use ESLint as a linter and Prettier to format the codebase. We also utilize some ESLint plugins, such as vue-eslint and eslint-plugin-cypress, to provide a support for tests and framework.

Continuous deployment

SSHs keys were generated to run scripts on the production server.

With the deploy key at hand, linked to the deploment script it is possible kick of a now deployment thanks to:

ssh root@solstice.mes-aides.1jeune1solution.beta.gouv.fr -i deploy

For more, a normal/manual root connection is required.

ssh root@solstice.mes-aides.1jeune1solution.beta.gouv.fr

Other tools scripts & tips

  • npm run test-benefits-urls validate links to 3rd parties.

  • npm run husky will install git hooks used to facilitate development and reduce the CI running time.

  • Locally or on production, it is possible to visualize all the available benefits of the simulator. It is done by adding debug as a parameter. It is also possible to set debug=ppa,rsa to choose which benefits are listed.

  • Adding debug=parcours as a parameter, show a debug version of all the steps in the simulator, locally and production.

  • OpenFisca tracer allows you to debug OpenFisca computations. (source)

  • npm run generate-missing-institutions-aides-velo allows you to generate missing institutions for the package aides-velo.

  • npm run test-definition-periods allows you to valid the periods of openfisca requested variables.

  • npm run evaluate-benefits <simulationId> allows you to evaluate benefits with simulation id.

  • node tools/geographical-benefits-details.js allows you to get the relevant benefits for each commune.

  • node tools/get-all-steps.js allows you to get all the steps and substeps of a simulation.

  • node tools/mjms.js allows you to generate emails which contain the result of a simulation or survey.

NetlifyCMS development

It is possible to locally debug changes in NetlifyCMS configuration.

  • First, contribuer/public/admin/config.yml#L15 must be uncommented;
  • npx netlify-cms-proxy-server should be ran from . and
  • npm ci and npm run dev should be ran from contribuer.
  • Netlify CMS should now be accessible at http://localhost:3000/admin/index.html

Changes made will be reflected locally instead of generating pull requests in production.