Prototype Code du Travail Numérique

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 --rm 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




Release policy

Auto

Trigger a custom build on Travis (in the "More options" right menu) on the master branch with a custom config:

env:
  global:
    - RELEASE=true

Manual

You need an Github token to release.

#
# Bump, push to git and publish to npm
$ yarn lerna version

#
# Publish the tag change log on the Github Release
$ CONVENTIONAL_GITHUB_RELEASER_TOKEN==************ npx conventional-github-releaser -p angular

#
# You might want to add a Gif to your release to make it groovy ;)

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