# Contributing
We would love for you to contribute to the backoffice of [Code du travail numérique][link-cdtn] and
help make it even better than it is today!
- [Contribute](#contribute)
- [Prerequisites](#prerequisites)
- [Get Started](#get-started)
- [Standalone](#standalone)
- [Test](#test)
- [Scripts](#scripts)
- [Recommended IDE Settings](#recommended-ide-settings)
- [VS Code](#vs-code)
- [Known Issues](#known-issues)
- [Docker Compose](#docker-compose)
- [Jest Watch](#jest-watch)
- [Naming Guidelines](#naming-guidelines)
- [API-related methods](#api-related-methods)
- [React methods](#react-methods)
- [Redux states](#redux-states)
- [React variables](#react-variables)
- [Commit Message Guidelines](#commit-message-guidelines)
- [Revert](#revert)
- [Type](#type)
- [Scope](#scope)
- [Subject](#subject)
## Contribute
### Prerequisites
- Docker v19+
- Docker Compose v1.25+
- Node v12+
- Yarn v1.22+
You must be able to run `docker` and `docker-compose` [without `sudo`][link-docker-no-sudo].
### Get Started
```bash
git clone https://github.com/SocialGouv/code-du-travail-backoffice.git
cd code-du-travail-backoffice
yarn
yarn setup
yarn dev
```
The website should now be available at: http://localhost:3100.
5 sample users have been generated during setup:
- Administrator:
- Email: `doris@sea.com`
Mot de passe: `Azerty123`
- Regional Administrator:
- Email: `deb@sea.com`
Mot de passe: `Azerty123`
- Contributors:
- Email: `nemo@sea.com`
Mot de passe: `Azerty123`
- Email: `astrid@sea.com`
Mot de passe: `Azerty123`
- Email: `marin@sea.com`
Mot de passe: `Azerty123`
### Standalone
Standalone dev also runs [**ctdn-api**](https://github.com/SocialGouv/cdtn-api) locally:
First, change `CDTN_API_URL` value to `http://localhost:3300` in `.env` file.
Then run:
```sh
yarn dev:standalone
```
### Test
- All Tests: `yarn test`
- Lint Tests: `yarn test:lint`
- Type Tests: `yarn test:type`
- Unit Tests: `yarn test:unit`
- Unit Tests (watch): `yarn test:watch`
- E2E Tests: `yarn test:e2e`
to update Unite Tests snapshots, you can run `yarn test:update`.
### Scripts
This repository comes with multiple useful npm scripts (run via `yarn