Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,38 @@ Once your pull request is created, a Sekoia.io reviewer will take responsibility

## Test locally

### Back
### Set up

This project is managed by [mise-en-place](https://mise.jdx.dev/). Please refer to the [Getting Started](https://mise.jdx.dev/getting-started.html) to install this tool.

This project is managed by `uv` that should be installed first before you can test locally the doc. Please refer to the [“Installing uv”](https://docs.astral.sh/uv/getting-started/installation/) documentation to install this tool.
After having installed mise-en-place, set up the project:

```shell
$ mise run install
```

### Back

The service relies on the [MkDocs](https://www.mkdocs.org/) Python framework helped by [MkDocs-Material](https://squidfunk.github.io/mkdocs-material/). To serve the documentation on the port `8000` of your computer, you should create a Python virtual environment, install the few requirements detailed in `pyproject.toml` and trigger the execution of the MkDocs server:
The service relies on the [MkDocs](https://www.mkdocs.org/) Python framework helped by [MkDocs-Material](https://squidfunk.github.io/mkdocs-material/). To serve the documentation on the port `8000` of your computer, you should trigger the execution of the MkDocs server:

```shell
$ uv run mkdocs serve --strict
$ mise run doc:serve
```

### Front

The front end is placed in `./lib/openapi-viewer`. You need node and yarn installed.
To serve the doc locally, you need to load the back end service upper.
The front end is placed in `./lib/openapi-viewer`. To serve the doc locally, you need to load the back end service upper.

Install yarn
Start the back:

```shell
$ npm install yarn -g
$ mise run doc:serve
```

Launch the front
In another shell, Launch the front

```shell
$ yarn install
$ yarn start
$ mise run openapi:dev
```

Go to http://127.0.0.1:8080/developer/api/
Expand Down
45 changes: 45 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[tools]
node = "22"
python = "3.14"
uv = "0.11.8"
yarn = "1.22.22"

[settings]
python.uv_venv_auto = "create|source"

[env]
OPENAPI_VIEWER_DIR = "lib/openapi-viewer"

[tasks.install]
description = "Setup the project"
run = '''
uv sync
yarn --cwd ${OPENAPI_VIEWER_DIR} install
'''

[tasks."doc:serve"]
description = "Serve the documentation"
run = "uv run mkdocs serve -s"

[tasks."doc:check"]
description = "Validate the documentation"
run = "uv run mkdocs build -s"

[tasks."doc:dev"]
description = "Start the documentation server"
run = "uv run mkdocs serve --watch docs"

[tasks."openapi:dev"]
description = "Serve the OpenAPI viewer"
run = "yarn run start"
dir = "{{env.OPENAPI_VIEWER_DIR}}"

[tasks."openapi:build"]
description = "Build the OpenAPI viewer"
run = "yarn run build"
dir = "{{env.OPENAPI_VIEWER_DIR}}"

[tasks."openapi:check"]
description = "Validate the OpenAPI viewer"
run = "yarn run lint"
dir = "{{env.OPENAPI_VIEWER_DIR}}"