Docs - Swagger UI
=================
This application provides a centralized registry of The Orchard microservice documentation.

This application consists of three main parts:

1. A registry of The Orchard microservices. This is in `registry.json`.
2. `scripts/` directory, which contains a python utility script to aggregate all the swagger documentation based on the contents of `registry.json` into `docs/` directory.
3. An express.js application to serve the `swagger-ui-dist` project and the aggregated documentation in `docs/`

## Updating the registry
To update the registry, add a new record in `registry.json`:

```json
{
  "name": "name of the application, no whitespace please",
  "repo": "repo owner/repo name",
  "path": "path to the file within the root directory of the repo
}
```

## Running
### Scripts to fetch docs

```sh
cd scripts/
pyvenv env
source env/bin/activate
pip install -r requirements.txt
python spec_scraper.py
```

### Frontend application, using Docker
Starting from root directory:

```sh
docker build -t theorchard/docs-swagger-ui .
docker run -p <PORT>:3000 -d theorchard/docs-swagger-ui
```

In your web browser, go to `http://<DOCKER_IP>:<PORT>`

### Frontend application, without Docker
Starting from root directory:

```sh
yarn install
yarn start
```

In your web browser, go to `http://localhost:3000`
