> For the complete documentation index, see [llms.txt](https://docs.builtbydao.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.builtbydao.com/developers/architecture.md).

# Architecture

Built By DAO has three coordinated layers:

```mermaid
flowchart LR
    U["Member, investor, and operator views"]
    A["React + Express application"]
    D[("PostgreSQL on the Lightsail application instance")]
    C["Versioned contracts and selected network"]
    M["Validated ABI and address manifest"]
    I["Idempotent, reorg-aware indexer"]

    U --> A
    A <--> D
    M --> A
    A <--> C
    C --> I --> D
```

## Responsibility boundaries

| Layer               | Owns                                                                                                         |
| ------------------- | ------------------------------------------------------------------------------------------------------------ |
| Dashboard           | Workflow, evidence, scoped authorization, human-readable state, notifications, and transaction orchestration |
| PostgreSQL          | Off-chain operational records, projections, indexed events, lifecycle state, and reconciliation evidence     |
| versioned contracts | Token supply, contract roles, proposal state, privileged on-chain mutation, balances, and emitted facts      |

PostgreSQL is self-hosted on the Lightsail application instance. It is not a separate managed database service.

## Consistency model

The dashboard distinguishes user intent from confirmed chain state. A prepared or broadcast transaction is not a confirmed mutation. Indexed events are processed idempotently and reconciled against the chain so retries and reorgs do not duplicate rewards, votes, rent accrual, or treasury actions.

## Authorization model

Every privileged journey is checked twice:

1. the application verifies persona, organization, project/property scope, and lifecycle state;
2. the selected contract verifies the calling address, role, proposal state, and policy boundary.

An application administrator is not automatically a contract administrator. Views explain why an action is unavailable instead of hiding authorization failures behind a generic error.

## EQTBLT provenance

* `WORK` follows approved contribution evidence and the authorized reward lifecycle.
* `RENT` follows the property schedule and the rate stamped into the active lease.
* The property schedule selects 5–15% based on economics and demand: lower for high-demand/high-cost properties, 10% standard, and higher for rural, lease-up, or lower-demand properties.
* Contracts preserve the source fact only. Professional classification and reporting remain off-chain.

The contract system uses stable account identity, coordinated recovery, a shared task-payment registry, and receipt-specific Treasury source accounting. See [Developer Overview](/developers/developers.md) and the [contract catalog](/developers/contracts.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.builtbydao.com/developers/architecture.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
