Prototype Code du Travail Numérique
lionelB feat(frontend): add annuaire search (#357)
* feat(annuaire): bootstrap annuaire indexing with DIRRECTE

* refacto: use @cdt/css rather than an online version for docz

* feat(frontend): add adresse-api request for annuaire

* refactor suggester into a generic component

* feat: update support component

* documentSuggester pass event to onSelect

* add searchAnnuaireMethod

* updade getExcludeSources to always return string

* add annuaire facet

* add annuaire results

* review fix api

* review annuaire data

* fixup api

* fixup frontend

* feat(css): add css cards component

* feat(ui): add ui card component

* add API_ADDRESS to mock

* test(frontend): add a dedicated mock for fetch

* review frontend

* push should fail

* fix lint

* fix source in suggest

* fix lint

* review fix

* review fix boolean 💩
Latest commit dc7b5db Dec 10, 2018

README.md

Code du travail numérique

Build Status codecov

Ce repository regroupe les informations sur les projets du code du travail numérique.

Installation

# Install all the packages
$ yarn

Note: les fichiers d'environment seront créés au postinstall (see scripts/setup-env.sh) en fonction du NODE_ENV

Première instanciation

Pour (re-)initialiser les données du elasticsearch:

# Démarrez un elasticsearch
$ docker-compose up

#
# Attendez de voir le message
#
elasticsearch_1  | [20XX-YY-XXT00:00:00,000][INFO ][o.e.n.Node               ] [code-du-travail-data-elasticsearch-single-node] started

# > En parallèle dans un autre terminal <

# Lancez le script d'indexation
$ docker-compose run python pipenv run python /app/search/indexing/create_indexes.py

Usage

Local development

$ yarn dev

Build

# Build all the packages
$ yarn build

# Build the "<package-name>"
$ yarn workspace <package-name> build

# For example for "code-du-travail-frontend"
$ yarn workspace code-du-travail-frontend build

Test

# Run all the packages tests
$ yarn test

# Run the "<package-name>" tests
$ yarn workspace <package-name> test

# For example for "code-du-travail-frontend"
$ yarn workspace code-du-travail-frontend test

Prod

# copy and edit the sample environment file
$ cp .env.sample .env

# Use prod containers configs
$ cp docker-compose.override.prod.yml docker-compose.override.yml

# Run all the containers
$ docker-compose up --build -d

Architecture

                             +--------+
                             | kibana |
                             +--------+
                                 |
                                 |
     +--------+          +-------v--------+
     |        |          |                |
     |  data  +---------->  elastisearch  <----------+
     |        |          |                |          |
     +--------+          +----------------+          |
                                 |               +-------+
                                 |               |  APM  |
                             +-------+           +---^---+
                             |       |               |
                             |  API  +---------------+
                             |       |
                             +-------+
                                 |
                                 |
                                 |
                           +------------+
                           |            |
                           |  frontend  |
                           |            |
                           +------------+

URLs

Demos

Outils

Setup

  • ElasticSearch : docker-compose up
  • API : yarn api
  • FrontEnd : yarn frontend

Contributions

  • Travailler sur des features branches
  • Faire des commits conventionnels
  • Soumettre des PR sur la branche du sprint en cours