# How Towers works

> The two parts of Towers and how data moves between them.

A tower is a picture of a reinsurance program. Each rectangle is a layer: its **height is an amount** of loss and its **width is a share** of the risk. The grey area is what the cedant keeps.

Towers has an Engine API and a React drawing package. The API also derives Placement facts without drawing.

| Part | What it does | Where it runs |
| --- | --- | --- |
| **Towers API** | Takes a Program: [`POST /towers`](https://towers.vinsa.dev/docs/api/build-towers.md) works out geometry; [`POST /placements`](https://towers.vinsa.dev/docs/api/placements.md) derives firm totals, Support, gaps and pro rata Signed shares. [`POST /recoveries`](https://towers.vinsa.dev/docs/api/recoveries.md) estimates ceded and retained amounts for a year of Losses. | Our server. You call it with an API key. |
| **`@vinsa/towers`** | A React package that draws the `/towers` answer. Placement responses contain no geometry. | Your app, in the browser. |

## The path of a request

1. **Your server** collects a program's layers from your own system and sends them to the Towers API with your key.
2. **The Towers API** returns the towers: bands, blocks and their positions. It stores nothing.
3. **Your server** passes that response to your page.
4. **Your page** gives it to `<Towers />`, which draws it.

The API key is used in step 1 only. It never goes to the browser, so nobody viewing your portal can read it.

## What you need

- An API key. See [Get an API key](https://towers.vinsa.dev/docs/start/api-key.md).
- A server-side place to call the API from: a Next.js route, an Express endpoint, or any backend you already run.
- A React 18 or later app to draw in.

When you have those, the [Quickstart](https://towers.vinsa.dev/docs/start/quickstart.md) takes about ten minutes.
