> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Project Structure

> A Stateful Actor project is one module that exports two things — the actor class and a fetch handler — wired together by an [[actors]] binding in telnyx.toml.

A Stateful Actor project ships from **one module that exports two things**, wired
together by a binding declared in `telnyx.toml`.

## Two Exports

One module exports the **actor class** and a **`fetch` handler** — an ordinary
Edge Compute function that calls the actor through a binding on `env`. The deploy
pipeline routes each export to the right runtime.

```ts theme={null}
import { type ActorNamespace, type ActorStub } from "@telnyx/edge-runtime";
import { Account } from "./account";
export { Account };

type AccountStub = ActorStub & Pick<Account, "debit">;
interface AccountNamespace extends ActorNamespace {
  idFromName(name: string): AccountStub;
}
interface Env { ACCOUNT: AccountNamespace }

export default {
  async fetch(req: Request, env: Env): Promise<Response> {
    const acct = new URL(req.url).pathname.slice(1);      // /acct_123
    const { amount } = (await req.json()) as { amount: number };
    const result = await env.ACCOUNT.idFromName(acct).debit(amount);
    return Response.json(result);
  },
};
```

## The Binding

`env.ACCOUNT` is declared in `telnyx.toml` as an `[[actors]]` entry — `binding` is the
property on `env`, `type` is the class to instantiate per name:

```toml theme={null}
name = "account-svc"
main = "src/index.ts"

[[actors]]
binding = "ACCOUNT"   # the property on env — your handle
type    = "Account"   # the class to instantiate per name
```

See the [Runtime API](/docs/edge-compute/stateful-actors/api-reference) for the full
`telnyx.toml` actor block.

The [Quick Start](/docs/edge-compute/stateful-actors/quick-start) builds and deploys
exactly this shape — the `Account` actor plus its `fetch` handler — end to end.

## Next Steps

* [Shared actors](/docs/edge-compute/stateful-actors/shared-actors) — reach one actor type from multiple functions
* [Addressing](/docs/edge-compute/stateful-actors/concepts/addressing) — naming and routing instances
* [Runtime API](/docs/edge-compute/stateful-actors/api-reference) — the binding surface
