# pareto-xyz/tutela-app architecture

> Architecture diagram of the GitHub repository pareto-xyz/tutela-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pareto-xyz/tutela-app
- Repository: https://github.com/pareto-xyz/tutela-app

## Overview

Tutela is an Ethereum and Tornado Cash anonymity-analysis product. Its user workflow accepts an address or ENS name, serves search results and reveal details through Flask, and presents affiliation and anonymity information in the web UI. The analysis capabilities include Ethereum deposit-address reuse and Diff2Vec, plus Tornado Cash transaction-linking heuristics; the README describes BigQuery as a transaction source and PostgreSQL-backed web storage. The tree and excerpts support the web request path, but not detailed wiring among batch analysis, live updates, and data uploads, so those links are omitted or marked unverified.

Main entry points: [`webapp/app/models.py`](https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/models.py) (Analysis records), [`webapp/app/static/jsx/transaction/index.jsx`](https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/static/jsx/transaction/index.jsx) (Transaction reveals), [`webapp/app/static/jsx/components/AddressSearchBar.jsx`](https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/static/jsx/components/AddressSearchBar.jsx) (Address search), [`webapp/app/views.py`](https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/views.py) (Flask search API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_search["Address search"]
  node_address_ui["Address results<br/>[index.jsx]"]
  node_tx_ui["Transaction reveals<br/>[index.jsx]"]
  node_query_info["Query summary<br/>[QueryInfo.jsx]"]
  node_reveal_timeline["Reveal timeline"]
  node_web_utils["API client utilities<br/>[utils.js]"]
end

subgraph group_api["Search and storage"]
  node_flask["Flask search API<br/>[views.py]"]
  node_app_utils["Search data helpers<br/>[utils.py]"]
  node_models[("Analysis records<br/>[models.py]")]
  node_uploads["Analysis data uploads"]
end

subgraph group_eth["Ethereum analysis"]
  node_deposit["Deposit reuse clustering<br/>[deposit.py]"]
  node_loader["Transaction loader<br/>[loader.py]"]
  node_diff_graph["Diff2Vec graph<br/>[graph.py]"]
  node_diff_walk["Diff2Vec walks<br/>[euler.py]"]
  node_diff_embed["Diff2Vec embeddings<br/>[word2vec.py]"]
end

subgraph group_tornado["Tornado analysis"]
  node_tc_data["Tornado transaction data<br/>[data.py]"]
  node_tc_heuristics["Tornado reveal heuristics<br/>[heuristic.py]"]
end

subgraph group_live["Live analysis"]
  node_live_deposit["Live deposit reuse"]
  node_live_tornado["Live Tornado heuristics"]
end

node_user(("Address seeker"))
node_bigquery[("BigQuery")]
node_postgres[("PostgreSQL")]

node_user -->|"enters address"| node_search
node_search -->|"validates input"| node_web_utils
node_search -->|"checks pool"| node_flask
node_address_ui -->|"renders"| node_search
node_tx_ui -->|"renders"| node_search
node_tx_ui -->|"builds API request"| node_web_utils
node_tx_ui -->|"requests reveals"| node_flask
node_address_ui -.->|"requests results"| node_flask
node_address_ui -->|"renders summary"| node_query_info
node_tx_ui -->|"renders summary"| node_query_info
node_tx_ui -->|"renders timeline"| node_reveal_timeline
node_flask -->|"queries records"| node_models
node_flask -->|"uses helpers"| node_app_utils
node_models -->|"stores records"| node_postgres
node_uploads -.->|"loads analysis data"| node_models
node_bigquery -.->|"provides transactions"| node_loader
node_loader -->|"supplies chunks"| node_deposit
node_diff_graph -->|"supports walks"| node_diff_walk
node_tc_data -.->|"supports heuristics"| node_tc_heuristics
node_bigquery -.->|"provides transactions"| node_tc_data
node_live_deposit -.->|"reads transactions"| node_bigquery
node_live_tornado -.->|"reads transactions"| node_bigquery
node_deposit -.->|"feeds clustering results"| node_models
node_diff_embed -.->|"feeds embeddings"| node_models
node_tc_heuristics -.->|"feeds reveal records"| node_models

click node_search "https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/static/jsx/components/AddressSearchBar.jsx"
click node_address_ui "https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/static/jsx/address/index.jsx"
click node_tx_ui "https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/static/jsx/transaction/index.jsx"
click node_query_info "https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/static/jsx/address/QueryInfo.jsx"
click node_reveal_timeline "https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/static/jsx/transaction/RevealsTimeline.jsx"
click node_web_utils "https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/static/js/utils.js"
click node_flask "https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/views.py"
click node_app_utils "https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/utils.py"
click node_models "https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/models.py"
click node_uploads "https://github.com/pareto-xyz/tutela-app/tree/main/webapp/db_utils"
click node_deposit "https://github.com/pareto-xyz/tutela-app/blob/main/src/cluster/deposit.py"
click node_loader "https://github.com/pareto-xyz/tutela-app/blob/main/src/utils/loader.py"
click node_diff_graph "https://github.com/pareto-xyz/tutela-app/blob/main/src/diff2vec/graph.py"
click node_diff_walk "https://github.com/pareto-xyz/tutela-app/blob/main/src/diff2vec/euler.py"
click node_diff_embed "https://github.com/pareto-xyz/tutela-app/blob/main/src/diff2vec/word2vec.py"
click node_tc_data "https://github.com/pareto-xyz/tutela-app/blob/main/src/tcash/data.py"
click node_tc_heuristics "https://github.com/pareto-xyz/tutela-app/blob/main/src/tcash/heuristic.py"
click node_live_deposit "https://github.com/pareto-xyz/tutela-app/tree/main/live/depositreuse"
click node_live_tornado "https://github.com/pareto-xyz/tutela-app/tree/main/live/tornadocash"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_search,node_address_ui,node_tx_ui,node_query_info,node_reveal_timeline,node_web_utils toneBlue
class node_flask,node_app_utils,node_models,node_uploads,node_bigquery,node_postgres toneAmber
class node_deposit,node_loader,node_diff_graph,node_diff_walk,node_diff_embed toneMint
class node_tc_data,node_tc_heuristics toneRose
class node_live_deposit,node_live_tornado,node_user toneIndigo
```

## Components

### Web experience

- [Address search](https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/static/jsx/components/AddressSearchBar.jsx): `webapp/app/static/jsx/components/AddressSearchBar.jsx`
- [Address results](https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/static/jsx/address/index.jsx): `webapp/app/static/jsx/address/index.jsx`
- [Transaction reveals](https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/static/jsx/transaction/index.jsx): `webapp/app/static/jsx/transaction/index.jsx`
- [Query summary](https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/static/jsx/address/QueryInfo.jsx): `webapp/app/static/jsx/address/QueryInfo.jsx`
- [Reveal timeline](https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/static/jsx/transaction/RevealsTimeline.jsx): `webapp/app/static/jsx/transaction/RevealsTimeline.jsx`
- [API client utilities](https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/static/js/utils.js): `webapp/app/static/js/utils.js`

### Search and storage

- [Flask search API](https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/views.py): `webapp/app/views.py`
- [Search data helpers](https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/utils.py): `webapp/app/utils.py`
- [Analysis records](https://github.com/pareto-xyz/tutela-app/blob/main/webapp/app/models.py): `webapp/app/models.py`
- [Analysis data uploads](https://github.com/pareto-xyz/tutela-app/tree/main/webapp/db_utils): `webapp/db_utils`

### Ethereum analysis

- [Deposit reuse clustering](https://github.com/pareto-xyz/tutela-app/blob/main/src/cluster/deposit.py): `src/cluster/deposit.py`
- [Transaction loader](https://github.com/pareto-xyz/tutela-app/blob/main/src/utils/loader.py): `src/utils/loader.py`
- [Diff2Vec graph](https://github.com/pareto-xyz/tutela-app/blob/main/src/diff2vec/graph.py): `src/diff2vec/graph.py`
- [Diff2Vec walks](https://github.com/pareto-xyz/tutela-app/blob/main/src/diff2vec/euler.py): `src/diff2vec/euler.py`
- [Diff2Vec embeddings](https://github.com/pareto-xyz/tutela-app/blob/main/src/diff2vec/word2vec.py): `src/diff2vec/word2vec.py`

### Tornado analysis

- [Tornado transaction data](https://github.com/pareto-xyz/tutela-app/blob/main/src/tcash/data.py): `src/tcash/data.py`
- [Tornado reveal heuristics](https://github.com/pareto-xyz/tutela-app/blob/main/src/tcash/heuristic.py): `src/tcash/heuristic.py`

### Live analysis

- [Live deposit reuse](https://github.com/pareto-xyz/tutela-app/tree/main/live/depositreuse): `live/depositreuse`
- [Live Tornado heuristics](https://github.com/pareto-xyz/tutela-app/tree/main/live/tornadocash): `live/tornadocash`

### Other components

- **Address seeker**
- **BigQuery**
- **PostgreSQL**

## Connections

- Address seeker → Address search: enters address
- Address search → API client utilities: validates input (evidence: `webapp/app/static/jsx/components/AddressSearchBar.jsx`)
- Address search → Flask search API: checks pool (evidence: `webapp/app/static/jsx/components/AddressSearchBar.jsx`)
- Address results → Address search: renders (evidence: `webapp/app/static/jsx/address/index.jsx`)
- Transaction reveals → Address search: renders (evidence: `webapp/app/static/jsx/transaction/index.jsx`)
- Transaction reveals → API client utilities: builds API request (evidence: `webapp/app/static/jsx/transaction/index.jsx`)
- Transaction reveals → Flask search API: requests reveals (evidence: `webapp/app/static/jsx/transaction/index.jsx`)
- Address results → Flask search API: requests results
- Address results → Query summary: renders summary (evidence: `webapp/app/static/jsx/address/index.jsx`)
- Transaction reveals → Query summary: renders summary (evidence: `webapp/app/static/jsx/transaction/index.jsx`)
- Transaction reveals → Reveal timeline: renders timeline (evidence: `webapp/app/static/jsx/transaction/index.jsx`)
- Flask search API → Analysis records: queries records (evidence: `webapp/app/views.py`)
- Flask search API → Search data helpers: uses helpers (evidence: `webapp/app/views.py`)
- Analysis records → PostgreSQL: stores records
- Analysis data uploads → Analysis records: loads analysis data (evidence: `webapp/db_utils/get_dist.py`)
- BigQuery → Transaction loader: provides transactions
- Transaction loader → Deposit reuse clustering: supplies chunks (evidence: `src/cluster/deposit.py`)
- Diff2Vec graph → Diff2Vec walks: supports walks (evidence: `src/diff2vec/euler.py`)
- Tornado transaction data → Tornado reveal heuristics: supports heuristics
- BigQuery → Tornado transaction data: provides transactions
- Live deposit reuse → BigQuery: reads transactions
- Live Tornado heuristics → BigQuery: reads transactions
- Deposit reuse clustering → Analysis records: feeds clustering results
- Diff2Vec embeddings → Analysis records: feeds embeddings
- Tornado reveal heuristics → Analysis records: feeds reveal records
