# @dataset.sh/studio

`@dataset.sh/studio` is a interface of a local (or global) dataset.sh project.

```text
# health check
GET /api/health

# content of datasets.json
GET /api/datasets.json

# get dataset meta data by version
GET /api/dataset/:categoryName/:datasetName/version/:versionHex/meta.json

# get readme by version
GET /api/dataset/:categoryName/:datasetName/version/:versionHex/readme.md

# list dataset collections by version
GET /api/dataset/:categoryName/:datasetName/version/:versionHex/collection

# get type annotation of a collection by dataset version
GET /api/dataset/:categoryName/:datasetName/version/:versionHex/collection/:collName/type

# get data sample of a collection by dataset tag
GET /api/dataset/:categoryName/:datasetName/tag/:tagName/collection/:collName/sample


# get the version reference of that tag {"version": "1a2b3c4d..."}
GET /api/dataset/:categoryName/:datasetName/tag/:tagName

# get dataset meta data by tag
GET /api/dataset/:categoryName/:datasetName/tag/:tagName/meta.json

# get readme by tag
GET /api/dataset/:categoryName/:datasetName/tag/:tagName/readme.md

# list dataset collections by tag
GET /api/dataset/:categoryName/:datasetName/tag/:tagName/collection

# get type annotation of a collection by dataset tag
GET /api/dataset/:categoryName/:datasetName/tag/:tagName/collection/:collName/type

# get data sample of a collection by dataset tag
GET /api/dataset/:categoryName/:datasetName/tag/:tagName/collection/:collName/sample
```


### Web UI

The studio bundles the SPA from `apps/web`. Running `pnpm --filter @dataset.sh/studio build` automatically builds the React app, copies the output into `dist/public`, and ships it with the CLI so visiting the server root serves the UI. During development you can run `pnpm --filter web dev` for live reloads.

### Commands

```shell
# view current project
npx @dataset.sh/studio -p 3112 -h 127.0.0.1 start
```

```shell
# view global project
npx @dataset.sh/studio -p 3112 -h 127.0.0.1 -g start
```

### Configs

```shell
# if AUTH_KEY is set, dataset APIs require HTTP Basic auth.
# value can be either "password" (user defaults to "dataset")
# or "username:password" for custom credentials.
AUTH_KEY=

# override the project root (defaults to current working directory)
DSH_STUDIO_PROJECT_DIR=
```
 
