# Vyriy Preset API

Calm cloud-ready API service built as a Yarn workspace.

Published: 2026-06-04
Tags: vyriy, preset, api, cli
Source: https://vyriy.dev/examples/vyriy-preset-api/

---

# Vyriy Preset - API

Calm cloud-ready API service built as a Yarn workspace.

## Create this example

```bash
npm create vyriy@latest
```

Choose the `api` preset.

The repository currently contains one runtime workspace:

- `workspaces/api` - HTTP API entry point based on `@vyriy/server` and `@vyriy/handler`.

## Requirements

- Node.js `>=24.0.0`
- Yarn `4.16.0`

## Usage

Install dependencies:

```bash
yarn install
```

Start the API:

```bash
yarn start
```

Build the API bundle:

```bash
yarn build
```

Run all project checks:

```bash
yarn check
```

## Scripts

- `yarn start` - start all workspace services.
- `yarn start:api` - run the API from `workspaces/api/index.ts`.
- `yarn build` - build all project outputs.
- `yarn build:api` - create the production API bundle in `dist/api`.
- `yarn test` - run Jest tests.
- `yarn lint` - run TypeScript, Prettier, and ESLint validation.
- `yarn storybook` - start Storybook documentation.

## Project Structure

- `workspaces/api` - API source, tests, build script, and workspace README.
- `.storybook` - Storybook configuration for MDX documentation and stories.
- `doc.mdx` - root Storybook documentation page backed by this README.
- `dist` - generated production output.

## Development

Keep public behavior documented in the relevant workspace README and covered by
matching tests. For API changes, start with `workspaces/api/index.ts` and keep
`workspaces/api/index.test.ts` aligned with the request/response contract.

## Project Guidance

These articles describe the development approach behind this preset and provide practical guidance for evolving a project on top of it:

- [Calm Development Environment: Node.js, Corepack, Yarn and Static Preview](https://vyriy.dev/blog/calm-development-setup/) - how to keep the local development environment predictable and easy to reproduce.
- [Storybook as Project Documentation](https://vyriy.dev/blog/storybook-as-project-documentation/) - how to use Storybook as living project documentation and a component playground.
