Vara dApp Patterns
This section documents the reusable patterns collected in the gear-foundation/vara-dapp-patterns repository.
The repository is organized around three practical layers of a Vara application:
| Area | Focus | Includes |
|---|---|---|
| Contracts | On-chain design and execution flow | factories, delayed self-messages, service wrappers, session-based delegation |
| Frontend | React integration and transaction UX | transaction preparation, execution hooks, verified sending, provider composition, signless and gasless UI flows |
| Backend | Trusted off-chain services around Vara programs | REST gateways, voucher servers, token-gated authentication |
Source Repository
All examples in this section are based on the public repository: gear-foundation/vara-dapp-patterns.
How to use these patterns
Use the contract patterns when the main question is how the program should store state, compose services, or schedule internal work.
Use the frontend patterns when you need predictable transaction orchestration in React, especially if your app prepares extrinsics in one place and executes them in another.
Use the backend patterns when your architecture includes trusted signers, voucher lifecycle management, REST APIs, or access-control services driven by on-chain state.