# S3 and DynamoDB in the cloud

> Run the Kanbus API inside your own application, store issues in S3 with a DynamoDB catalog, and render the board with the same components the console uses.

Canonical: https://kanb.us/ways-to-run/s3-and-dynamodb.html

## How it works

`kanbus-api` is a small HTTP service that reuses Kanbus's models, configuration and workflow rules. In the cloud it runs on Lambda behind API Gateway, keeps each issue as an object in S3 laid out exactly like a checkout, and keeps a catalog in DynamoDB so boards and filters stay fast. Your application renders the board with `@kanbus/ui`, the same React components the console is built from.

Writes are safe under concurrency: every change carries the revision it was based on, a stale revision is refused, and a retried request replays its original result instead of applying twice.

## Where it fits

Use it when a board belongs inside a product of your own, such as a CRM, a support desk or a client portal, and your users should never see a repository. Your app decides the issue types, statuses and custom fields; the API has no domain-specific routes.

:::warning{title="Preview: an application backend, not a CLI mode"}
The CLI and the local console do not read from S3 yet, so a board lives either in files or behind the API. The API also refuses parent links, dependencies and hierarchical types for now, and projects that use policies or hooks. A single storage setting that every Kanbus client understands is planned.
:::

## Set it up

:::step-list
:::step
**Try it locally** against a folder of files. The local server binds to `127.0.0.1` only.

```bash
cd services/kanbus-api
KANBUS_BACKEND=file KANBUS_ROOT=./board KANBUS_NAMESPACE=acme/support \
  KANBUS_LOCAL_TOKEN=a-local-token-of-16-or-more-chars \
  cargo run --bin kanbus-api-local
```
:::
:::step
**Add it to your app's backend.** The service composes into an existing Amplify Gen 2 backend; the Amplify guide in the service folder covers the stack, the S3 bucket, the DynamoDB table and the API route.
:::
:::step
**Point the Lambda at your storage** with `KANBUS_BACKEND=s3`, `KANBUS_OBJECT_BUCKET`, `KANBUS_CATALOG_TABLE`, `KANBUS_NAMESPACE` and the Cognito group allowed to use it.
:::
:::step
**Render the board** in your app with `@kanbus/ui`, reading and writing through the API.
:::
:::

[Read the API guide](https://github.com/AnthusAI/Kanbus/tree/main/services/kanbus-api) [Read the Amplify guide](https://github.com/AnthusAI/Kanbus/blob/main/services/kanbus-api/AMPLIFY.md)
