> ## Documentation Index
> Fetch the complete documentation index at: https://rain-sandbox-trial.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Platform Architecture

> The four layers every Rain product runs on: your tenant, compliance, customer records, and the ledger.

Rain is one platform with several products built on top of it, not a set of
separate services that happen to share a domain name. Every product you build
runs through the same shared architecture.

## The stack

The diagram below traces a single request from your tenant to the event it
triggers. Read it top to bottom.

<div className="wf-diagram">
  <div className="diagram-shell">
    <svg id="rain-platform-stack" role="img" aria-label="Rain platform architecture: your tenant and its subtenants pass through one verification and screening gate, then draw on one shared set of users and companies that every product uses, with all balance changes landing on a single double-entry ledger and every state change emitting a webhook event." viewBox="0 0 1080 712" width="1080" height="712" style={{width: "100%", height: "auto"}}><defs><marker id="arrow" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" className="marker-fill-default" /></marker><marker id="arrowSend" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" className="marker-fill-send" /></marker></defs><path d="M 540 108 L 540 144" fill="none" className="conn-default" stroke-width="1.7" marker-end="url(#arrow)" opacity="0.92" /><path d="M 540 212 L 540 248" fill="none" className="conn-default" stroke-width="1.7" marker-end="url(#arrow)" opacity="0.92" /><path d="M 540 316 C 540 343, 144 343, 144 370" fill="none" className="conn-default" stroke-width="1.7" marker-end="url(#arrow)" opacity="0.92" /><path d="M 540 316 C 540 343, 342 343, 342 370" fill="none" className="conn-default" stroke-width="1.7" marker-end="url(#arrow)" opacity="0.92" /><path d="M 540 316 L 540 370" fill="none" className="conn-default" stroke-width="1.7" marker-end="url(#arrow)" opacity="0.92" /><path d="M 540 316 C 540 343, 738 343, 738 370" fill="none" className="conn-default" stroke-width="1.7" marker-end="url(#arrow)" opacity="0.92" /><path d="M 540 316 C 540 343, 936 343, 936 370" fill="none" className="conn-default" stroke-width="1.7" marker-end="url(#arrow)" opacity="0.92" /><path d="M 144 438 C 144 469, 540 469, 540 500" fill="none" className="conn-default" stroke-width="1.7" marker-end="url(#arrow)" opacity="0.92" /><path d="M 342 438 C 342 469, 540 469, 540 500" fill="none" className="conn-default" stroke-width="1.7" marker-end="url(#arrow)" opacity="0.92" /><path d="M 540 438 L 540 500" fill="none" className="conn-default" stroke-width="1.7" marker-end="url(#arrow)" opacity="0.92" /><path d="M 738 438 C 738 469, 540 469, 540 500" fill="none" className="conn-default" stroke-width="1.7" marker-end="url(#arrow)" opacity="0.92" /><path d="M 936 438 C 936 469, 540 469, 540 500" fill="none" className="conn-default" stroke-width="1.7" marker-end="url(#arrow)" opacity="0.92" /><path d="M 540 568 L 540 604" fill="none" className="conn-send" stroke-width="1.7" stroke-dasharray="5 4" marker-end="url(#arrowSend)" opacity="0.92" /><foreignObject x="390" y="40" width="300" height="68"><div className="card ext"><span className="ct"><span className="tag">You</span><span className="lab">Your tenant and subtenants</span></span></div></foreignObject><foreignObject x="390" y="144" width="300" height="68"><div className="card cond"><span className="ct"><span className="tag">Gate</span><span className="lab">Verification and screening</span></span></div></foreignObject><foreignObject x="390" y="248" width="300" height="68"><div className="card action"><span className="ct"><span className="tag">Shared</span><span className="lab">Users and companies</span></span></div></foreignObject><foreignObject x="54" y="370" width="180" height="68"><div className="card action"><span className="ct"><span className="tag">Product</span><span className="lab">Cards</span></span></div></foreignObject><foreignObject x="252" y="370" width="180" height="68"><div className="card action"><span className="ct"><span className="tag">Product</span><span className="lab">Accounts and ramps</span></span></div></foreignObject><foreignObject x="450" y="370" width="180" height="68"><div className="card action"><span className="ct"><span className="tag">Product</span><span className="lab">Global payouts</span></span></div></foreignObject><foreignObject x="648" y="370" width="180" height="68"><div className="card action"><span className="ct"><span className="tag">Product</span><span className="lab">Wallets and collateral</span></span></div></foreignObject><foreignObject x="846" y="370" width="180" height="68"><div className="card action"><span className="ct"><span className="tag">Product</span><span className="lab">Rewards</span></span></div></foreignObject><foreignObject x="390" y="500" width="300" height="68"><div className="card action"><span className="ct"><span className="tag">Shared</span><span className="lab">One double-entry ledger</span></span></div></foreignObject><foreignObject x="390" y="604" width="300" height="68"><div className="card send"><span className="ct"><span className="tag">Rain sends</span><span className="lab">Webhook events</span></span></div></foreignObject></svg>
  </div>
</div>

## What each layer does

Each layer, and where it's documented:

| Layer                                               | What it holds                                                                   |
| :-------------------------------------------------- | :------------------------------------------------------------------------------ |
| [Your tenant](/docs/managing-subtenants)            | Your program, plus any subtenants running their own programs underneath yours.  |
| [Verification and screening](/docs/compliance)      | The gate. Nothing downstream unlocks until the relevant check passes.           |
| [Users and companies](/docs/customers-and-identity) | The customer records every product references. One record, many products.       |
| [Products](/docs/products-at-a-glance)              | Cards, accounts and ramps, global payouts, wallets and collateral, and rewards. |
| [Ledger](/docs/ledgering-system)                    | Double-entry accounting for every balance change, in accounts and books.        |
| [Webhook events](/docs/webhooks)                    | One event stream for every state change across every product.                   |

## Why Rain arranges the stack this way

Two choices in this architecture matter for how you build:

### Compliance sits above the products, not inside each one

Verification is a gate you pass through, not a feature of the cards product. That's why
the gate clears a customer for one capability and not another: it grants
access per capability. Cards KYC or KYB approval unlocks card issuance.
Payments verification unlocks money movement and virtual accounts. Clearing
one does not clear the other. See [Payments compliance](/docs/payments-compliance)
for how compliance gates the payments side.

### Every product shares one ledger, so they reconcile against each other

A card authorization and an inbound fiat deposit for the same customer land in the same
account, in different books. You reconcile once, against one source, rather than
stitching together per-product balances.

## What's next

<Columns cols={2}>
  <Card title="Understand customers and identity" icon="users" href="/docs/customers-and-identity">
    Tenants, companies, users, and how to map Rain records onto your own.
  </Card>

  <Card title="Compare products" icon="grid-2" href="/docs/products-at-a-glance">
    Pick which product to start with.
  </Card>

  <Card title="Read how compliance works" icon="shield-check" href="/docs/compliance">
    The two verification pipelines and what each one unlocks.
  </Card>

  <Card title="Read the ledgering system" icon="book" href="/docs/ledgering-system">
    Accounts, books, and how double-entry ledgering works at Rain.
  </Card>
</Columns>
