{"id":20722010,"url":"https://github.com/mes-aides/simulateur","last_synced_at":"2025-05-10T23:32:13.971Z","repository":{"id":38010958,"uuid":"230946626","full_name":"mes-aides/simulateur","owner":"mes-aides","description":"Un simulateur global des aides en France","archived":false,"fork":true,"pushed_at":"2025-05-04T18:59:40.000Z","size":66229,"stargazers_count":13,"open_issues_count":5,"forks_count":5,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-04T19:37:01.542Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://mes-aides.org/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"betagouv/aides-jeunes","license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mes-aides.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-30T16:28:02.000Z","updated_at":"2025-05-04T18:59:43.000Z","dependencies_parsed_at":"2023-02-01T03:31:10.692Z","dependency_job_id":null,"html_url":"https://github.com/mes-aides/simulateur","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mes-aides%2Fsimulateur","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mes-aides%2Fsimulateur/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mes-aides%2Fsimulateur/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mes-aides%2Fsimulateur/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mes-aides","download_url":"https://codeload.github.com/mes-aides/simulateur/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253497299,"owners_count":21917683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T03:33:57.177Z","updated_at":"2025-05-10T23:32:08.953Z","avatar_url":"https://github.com/mes-aides.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","[✨ inspiration](https://github.com/stars/ketsapiwiq/lists/inspiration)"],"sub_categories":[],"readme":"## Cette documentation est technique. Pour plus d'informations sur le [simulateur d'aides pour les jeunes](https://mes-aides.1jeune1solution.beta.gouv.fr), regardez notre [wiki](https://github.com/betagouv/aides-jeunes/wiki).\n\n\u003e L'interface utilisateur (et le serveur principal) du [simulateur d'aides et de prestations sociales pour les jeunes](https://mes-aides.1jeune1solution.beta.gouv.fr). Il est basé sur simulateur socio-fiscal libre [Openfisca](https://www.openfisca.fr/).\n\n# Setup\n\n## Stack\n\n- VueJS\n- NodeJS\n- MongoDB\n- OpenFisca (Python, numpy)\n- NetlifyCMS ([config](https://github.com/betagouv/aides-jeunes/blob/master/contribuer/public/admin/config.yml))\n  - [website](https://contribuer-aides-jeunes.netlify.app)\n- Fabric ([fabfile](https://github.com/betagouv/aides-jeunes-ops/blob/main/fabric.yml))\n\n## 3rd parties\n\n- Github Actions ([config](https://github.com/betagouv/aides-jeunes/blob/master/.github/workflows/))\n  - Continuous integration and deployment\n- Netlify\n  - Deloy previews\n- SendInBlue\n- Matomo ([stats.data.gouv.fr](https://stats.data.gouv.fr/index.php?module=CoreHome\u0026action=index\u0026idSite=165\u0026period=range\u0026date=previous30))\n  - [Dedicated site for usage data and impac][https://betagouv.github.io/mes-aides-analytics/] [source](https://github.com/betagouv/mes-aides-analytics)\n- Sentry\n  - [backend](https://sentry.io/organizations/betagouv-f7/projects/aides-jeunes-node/?project=5709109)\n  - [frontend](https://sentry.io/organizations/betagouv-f7/projects/aides-jeunes-front/?project=5709078)\n\n# Front only install\n\nIf you want to play with the UI, you can be set up very quickly:\n\n```bash\nnpm ci\nnpm run front\n```\n\nCf. `package.json` for more on the underlying commands.\n\nThe application should be accessible at `localhost:8080`.\n\n# Full install\n\n## System dependencies\n\n### Ubuntu\n\nMake sure `build-essential`, `mongodb` and `node` 16.x are installed on your machine:\n\n```sh\nsudo apt-get install build-essential\nsudo apt-get install mongodb\n```\n\n### For all platforms\n\nThe runtime is Node 16.x for the web application, and Python 3.7 for Openfisca.\n\nYou can for example use [`nvm`](https://github.com/creationix/nvm) to install this specific version.\n\nYou will need [`pip`](https://pip.pypa.io/) to install Openfisca.\n\n## Application\n\nRun the following from the root of the project to install the dependencies\n\n```sh\nnpm ci\n```\n\n## Openfisca\n\n: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.13`.\n\nYou should [install Python 3 in a virtual environment](https://virtualenv.pypa.io/en/stable/) 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:\n\n```bash\npython3 -m venv .venv   # create the virtual environment in the .venv folder\nsource .venv/bin/activate  # activate the virtual environment\npip install pip --upgrade  # make sure we're using the latest pip version\nnpm run install-openfisca  # install dependencies\n```\n\nThen, to start the OpenFisca server, simply run `source .venv/bin/activate` followed by `npm run openfisca`.\n\nOpenFisca dependencies are specified in [openfisca/requirements.txt](https://github.com/betagouv/aides-jeunes/blob/master/openfisca/requirements.txt), a basic [Python requirements file](https://pip.pypa.io/en/stable/reference/pip_install/#example-requirements-file). It is possible to refer to non-production commit hashs but is prefered to use _main-merged_ commits.\n\n### Development mode\n\nIf you are working on `openfisca-france` and want to use your local version:\n\n```\ncd (...)/openfisca-france\npip install --editable .\n```\n\n## Test in production mode\n\nIf you want to test locally the app in production mode:\n\n```sh\nnpm run build\nnpm run start\n```\n\n## Usage\n\nFirst, start a Mongo server:\n\n```sh\nnpm run db\n```\n\nThen, in another shell (you will have to run `source .venv/bin/activate`), start the Openfisca server:\n\n```sh\nOPENFISCA_WORKERS=1 npm run openfisca\n```\n\nFinally, in a third shell, start the server:\n\n```sh\nnpm run serve\n```\n\n# Testing\n\nThere are several levels of tests:\n\n- Unit tests are executed by [Jest](https://jestjs.io/fr/) and run with `npm test`.\n- End-to-end test are executed with [Cypress](https://www.cypress.io/) with `npm run cypress`\n\nYou can safely use `npm test \u0026\u0026 npm run cypress` to drive your developments.\n\n## Email\n\nWe use the framework [MJML](https://mjml.io/) to design and integrate the templates. [Sendinblue](https://fr.sendinblue.com/) is our service to send emails.\n\nThe development server for emails can be easily start with:\n`node tools/mjml.js` or `npm run serve-mail`\n\nIf you want to verify the email sending, the variable `SEND_IN_BLUE_PRIVATE_KEY=API_SECRET` should be configured in your `.env` file.\nYou can create a free account [here](https://app.sendinblue.com/account/register/profile) or request one on the mattermost channel.\n\n## Linting and format\n\nWe use [ESLint](https://eslint.org/) as a linter and [Prettier](https://prettier.io/) to format the codebase.\nWe also utilize some ESLint plugins, such as [vue-eslint](https://eslint.vuejs.org/user-guide/) and [eslint-plugin-cypress](https://github.com/cypress-io/eslint-plugin-cypress), to provide a support for tests and framework.\n\n# Continuous deployment\n\nSSHs keys were generated to [run scripts](http://man.openbsd.org/sshd#command=%22command%22) on the production server.\n\nWith the `deploy` key at hand, linked to the deploment script it is possible kick of a now deployment thanks to:\n\n```sh\nssh root@solstice.mes-aides.1jeune1solution.beta.gouv.fr -i deploy\n```\n\nFor more, a normal/manual root connection is required.\n\n```sh\nssh root@solstice.mes-aides.1jeune1solution.beta.gouv.fr\n```\n\n# Other tools scripts \u0026 tips\n\n- `npm run test-benefits-urls` validate links to 3rd parties.\n\n- `npm run husky` will install git hooks used to facilitate development and reduce the CI running time.\n\n- [Locally](http://localhost:8080/simulation/resultats?debug) or on [production](https://mes-aides.1jeune1solution.beta.gouv.fr/simulation/resultats?debug), 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.\n\n- Adding `debug=parcours` as a parameter, show a debug version of all the steps in the simulator, [locally](https://localhost:8080/simulation/individu/demandeur/date_naissance?debug=parcours) and [production](https://mes-aides.1jeune1solution.beta.gouv.fr/simulation/individu/demandeur/date_naissance?debug=parcours).\n\n- [OpenFisca tracer](https://openfisca.github.io/tracer/) allows you to debug OpenFisca computations. ([source](https://github.com/openfisca/tracer))\n\n- `npm run generate-missing-institutions-aides-velo` allows you to generate missing institutions for the package `aides-velo`.\n\n- `npm run test-definition-periods` allows you to valid the periods of openfisca requested variables.\n\n- `npm run evaluate-benefits \u003csimulationId\u003e` allows you to evaluate benefits with simulation id.\n\n- `node tools/geographical-benefits-details.js` allows you to get the relevant benefits for each commune.\n\n- `node tools/get-all-steps.js` allows you to get all the steps and substeps of a simulation.\n\n- `node tools/mjms.js` allows you to generate emails which contain the result of a simulation or survey.\n\n## NetlifyCMS development\n\nIt is possible to locally debug changes in NetlifyCMS configuration.\n\n- First, [contribuer/public/admin/config.yml#L15](https://github.com/betagouv/aides-jeunes/blob/master/contribuer/public/admin/config.yml#L15) must be uncommented;\n- `npx netlify-cms-proxy-server` should be ran from `.` and\n- `npm run dev` should be ran from `contribuer`.\n\nChanges made will be reflected locally instead of generating pull requests in production.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmes-aides%2Fsimulateur","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmes-aides%2Fsimulateur","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmes-aides%2Fsimulateur/lists"}