Skip to content

Latest commit

 

History

History
116 lines (75 loc) · 4.26 KB

README-dev.md

File metadata and controls

116 lines (75 loc) · 4.26 KB

Code du travail numérique - dev

Build Status codecov FOSSA Status



schema



URLs

Demos

Installation

Make sure you're using NodeJS 12+.

# Install all the packages
yarn
yarn build

Note: environment file can be created using scripts/setup-env.js) according to NODE_ENV, default to dev

Dev

Packages

Package description
code-du-travail-api NodeJS koa API
code-du-travail-data Elastic indexing scripts
code-du-travail-frontend Next.js frontend application
react-ui React components and styleguide
react-fiches-service-public React components for fiches service-public.fr

Frontend

Run the frontend with our online latest API :

API_URL=https://api-master-code-travail.dev.fabrique.social.gouv.fr/api/v1 yarn workspace @cdt/frontend dev

If you need to work on both frontend and api, don't provide API_URL as it will fallback to http://localhost:1337/api/v1

yarn workspace @cdt/frontend dev

The React components are defined in the react-ui package and showcased here: https://socialgouv-react-ui.netlify.com

Backend

To run the NodeJS API, you need an Elasticsearch instance.

The provided docker-compose.yml provide all the environment.

We recommend using the docker-compose.override.dev.yml config for local development. Copy/paste and rename the docker-compose.override.dev.yml to docker-compose.override.yml (more information on the docker-compose documentation).

cp docker-compose.override.dev.yml docker-compose.override.yml

To fill your ElasticSearch, you'll need to a local cdtn-admin endpoint :

Then you can launch services using docker-compose

# start elasticsearch
docker-compose up elasticsearch

# Launch indexing script : fill ElasticSearch
yarn workspace @cdt/data start:dev

# Start API in dev mode : runs on http://localhost:1337
yarn workspace @cdt/api dev

Howto

To launch a local tf-serve instance, you can report to the README of our serving-ml project

You can also read the packages readme

Contributions

Issues

License

FOSSA Status