npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@guillett/mes-aides-jeunes

v12.1.3

Published

Simulateur de prestations sociales pour les jeunes

Downloads

53

Readme

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

  • CircleCI (config)
    • Continuous integration and deployment
  • Netlify
    • Deloy previews
  • SendInBlue
  • Matomo (stats.data.gouv.fr)
    • [Dedicated site for usage data and impac][https://betagouv.github.io/mes-aides-analytics/] source
  • Sentry

Front only install

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

npm run fast-install
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 12.x are installed on your machine:

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

For all platforms

The runtime is Node 12.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

:warning: 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.6.

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 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 [email protected] -i deploy

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

ssh [email protected]

Other tools scripts & tips

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

  • npm run prepare 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 can allow you to debug OpenFisca computations. (source)

NetlifyCMS development

It is possible to locally debug changes in NetlifyCMS configuration.

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