# @yemaya/api

Yemaya API Gateway - RESTful and gRPC services for the creative studio

Backend service. See the `Dockerfile` / `docker-compose.yml` in the repo for
production-like local runs, or use the dev script below for in-process
iteration.

## Scripts

| Command                 | Definition                              |
| ----------------------- | --------------------------------------- |
| `pnpm build`            | tsup                                    |
| `pnpm dev`              | tsx watch src/index.ts                  |
| `pnpm start`            | node dist/index.js                      |
| `pnpm test`             | vitest run                              |
| `pnpm test:watch`       | vitest                                  |
| `pnpm test:coverage`    | vitest run --coverage                   |
| `pnpm typecheck`        | tsc --noEmit -p tsconfig.typecheck.json |
| `pnpm lint`             | eslint src/                             |
| `pnpm lint:fix`         | eslint src/ --fix                       |
| `pnpm format`           | prettier --write src/                   |
| `pnpm format:check`     | prettier --check src/                   |
| `pnpm clean`            | rimraf dist coverage                    |
| `pnpm openapi:generate` | tsx scripts/generate-openapi.ts         |
| `pnpm openapi:validate` | tsx scripts/validate-openapi.ts         |
| `pnpm codegen`          | tsx scripts/codegen.ts                  |

## Layout

- `__tests__/`
- `openapi/`
- `scripts/`
- `src/`
- `tests/`

## Working on this package

The fastest local loop is via Nx:

```bash
pnpm nx test yemaya-api
pnpm nx lint yemaya-api
pnpm nx build yemaya-api
```

When Nx is unhappy (usually because another worktree has duplicate project
names), bypass it with the underlying tools from this directory:

```bash
npx tsc --noEmit
npx vitest run
```

See the [root README](../../../README.md) for monorepo-wide conventions (catalog
deps, commit format, git workflow). See the
[Contributor Guide](../../../docs/CONTRIBUTING.md) for the full PR workflow.
