# amand4ngol/pyusd-hub architecture

> Architecture diagram of the GitHub repository amand4ngol/pyusd-hub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amand4ngol/pyusd-hub
- Repository: https://github.com/amand4ngol/pyusd-hub

## Overview

PYUSD Hub is a Flutter non-custodial ETH/PYUSD wallet combined with blockchain analytics. The documented user journey is to enter the app, manage or inspect a wallet, then use transaction, network, and tracing tools; AI analysis and PYUSD City are complementary features. The tree identifies distinct UI, provider, and service layers. The README documents GCP RPC, Gemini, and Etherscan integrations, but sampled source does not show their exact call wiring, so uncertain links are omitted.

Main entry points: [`lib/main.dart`](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/main.dart) (Flutter app), [`lib/screens/geminiai/service/gemini_service.dart`](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/geminiai/service/gemini_service.dart) (Gemini analysis), [`lib/services/gcp_rpc_service.dart`](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/services/gcp_rpc_service.dart) (GCP RPC access), [`lib/services/rpc_call_service.dart`](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/services/rpc_call_service.dart) (RPC calls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["App shell"]
  node_app["Flutter app<br/>[main.dart]"]
  node_routes["Navigation<br/>[app_routes.dart]"]
  node_network_state["Network state"]
end

subgraph group_wallet["Wallet and transfers"]
  node_auth["Wallet onboarding<br/>[auth_provider.dart]"]
  node_wallet_service["Wallet service"]
  node_wallet_screen["Wallet overview<br/>[wallet_screen.dart]"]
  node_wallet_data["Wallet data"]
  node_transactions["Send and receive"]
  node_transaction_views["Transaction screens<br/>[send_screen.dart]"]
  node_tx_details["Transaction details"]
end

subgraph group_analytics["Blockchain analytics"]
  node_rpc["GCP RPC access"]
  node_rpc_calls["RPC calls"]
  node_network_service["Network service"]
  node_congestion["Congestion analytics"]
  node_trace["Transaction tracing"]
  node_mev["MEV analysis"]
end

subgraph group_intelligence["AI and discovery"]
  node_insights["Market insights"]
  node_market["Market service"]
  node_gemini["Gemini analysis"]
  node_news["News discovery<br/>[news_service.dart]"]
end

subgraph group_experience["Supporting experiences"]
  node_city["PYUSD City"]
  node_notifications["Notifications"]
end

node_user(("Wallet user"))
node_gemini_api(("Google Gemini"))
node_gcp(("GCP blockchain RPC"))

node_user -->|"opens"| node_app
node_app -->|"routes through"| node_routes
node_user -->|"creates or imports"| node_auth
node_user -->|"views wallet"| node_wallet_screen
node_user -->|"sends or receives"| node_transaction_views
node_user -->|"inspects transfer"| node_tx_details
node_user -->|"views network"| node_congestion
node_user -->|"traces activity"| node_trace
node_user -->|"checks MEV"| node_mev
node_user -->|"explores insights"| node_insights
node_user -->|"requests analysis"| node_gemini
node_user -->|"browses news"| node_news
node_user -->|"opens visualization"| node_city
node_gemini -.->|"analyzes with"| node_gemini_api
node_rpc -.->|"calls RPC"| node_gcp
node_rpc_calls -.->|"calls RPC"| node_gcp

click node_app "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/main.dart"
click node_routes "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/routes/app_routes.dart"
click node_network_state "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/providers/network_provider.dart"
click node_auth "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/authentication/provider/auth_provider.dart"
click node_wallet_service "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/authentication/services/wallet_service.dart"
click node_wallet_screen "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/wallet/view/wallet_screen.dart"
click node_wallet_data "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/wallet/provider/walletscreen_provider.dart"
click node_transactions "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/transactions/provider/transaction_provider.dart"
click node_transaction_views "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/transactions/view/send_transaction/send_screen.dart"
click node_tx_details "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/transactions/view/transaction_details/transaction_detail_screen.dart"
click node_rpc "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/services/gcp_rpc_service.dart"
click node_rpc_calls "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/services/rpc_call_service.dart"
click node_network_service "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/services/network_service.dart"
click node_congestion "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/networkcongestion/provider/network_congestion_provider.dart"
click node_trace "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/trace/provider/trace_provider.dart"
click node_mev "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/trace/provider/mev_analysis_provider.dart"
click node_insights "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/insights/provider/insights_provider.dart"
click node_market "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/services/market_service.dart"
click node_gemini "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/geminiai/service/gemini_service.dart"
click node_news "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/news/service/news_service.dart"
click node_city "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/pyusdcity/view/pyusd_city_screen.dart"
click node_notifications "https://github.com/amand4ngol/pyusd-hub/blob/main/lib/services/notification_service.dart"

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_app,node_routes,node_network_state,node_user toneBlue
class node_auth,node_wallet_service,node_wallet_screen,node_wallet_data,node_transactions,node_transaction_views,node_tx_details toneAmber
class node_rpc,node_rpc_calls,node_network_service,node_congestion,node_trace,node_mev toneMint
class node_insights,node_market,node_gemini,node_news toneRose
class node_city,node_notifications,node_gemini_api,node_gcp toneIndigo
```

## Components

### App shell

- [Flutter app](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/main.dart): `lib/main.dart`
- [Navigation](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/routes/app_routes.dart): `lib/routes/app_routes.dart`
- [Network state](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/providers/network_provider.dart): `lib/providers/network_provider.dart`

### Wallet and transfers

- [Wallet onboarding](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/authentication/provider/auth_provider.dart): `lib/screens/authentication/provider/auth_provider.dart`
- [Wallet service](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/authentication/services/wallet_service.dart): `lib/screens/authentication/services/wallet_service.dart`
- [Wallet overview](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/wallet/view/wallet_screen.dart): `lib/screens/wallet/view/wallet_screen.dart`
- [Wallet data](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/wallet/provider/walletscreen_provider.dart): `lib/screens/wallet/provider/walletscreen_provider.dart`
- [Send and receive](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/transactions/provider/transaction_provider.dart): `lib/screens/transactions/provider/transaction_provider.dart`
- [Transaction screens](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/transactions/view/send_transaction/send_screen.dart): `lib/screens/transactions/view/send_transaction/send_screen.dart`
- [Transaction details](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/transactions/view/transaction_details/transaction_detail_screen.dart): `lib/screens/transactions/view/transaction_details/transaction_detail_screen.dart`

### Blockchain analytics

- [GCP RPC access](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/services/gcp_rpc_service.dart): `lib/services/gcp_rpc_service.dart`
- [RPC calls](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/services/rpc_call_service.dart): `lib/services/rpc_call_service.dart`
- [Network service](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/services/network_service.dart): `lib/services/network_service.dart`
- [Congestion analytics](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/networkcongestion/provider/network_congestion_provider.dart): `lib/screens/networkcongestion/provider/network_congestion_provider.dart`
- [Transaction tracing](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/trace/provider/trace_provider.dart): `lib/screens/trace/provider/trace_provider.dart`
- [MEV analysis](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/trace/provider/mev_analysis_provider.dart): `lib/screens/trace/provider/mev_analysis_provider.dart`

### AI and discovery

- [Market insights](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/insights/provider/insights_provider.dart): `lib/screens/insights/provider/insights_provider.dart`
- [Market service](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/services/market_service.dart): `lib/services/market_service.dart`
- [Gemini analysis](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/geminiai/service/gemini_service.dart): `lib/screens/geminiai/service/gemini_service.dart`
- [News discovery](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/news/service/news_service.dart): `lib/screens/news/service/news_service.dart`

### Supporting experiences

- [PYUSD City](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/screens/pyusdcity/view/pyusd_city_screen.dart): `lib/screens/pyusdcity/view/pyusd_city_screen.dart`
- [Notifications](https://github.com/amand4ngol/pyusd-hub/blob/main/lib/services/notification_service.dart): `lib/services/notification_service.dart`

### Other components

- **Wallet user**
- **Google Gemini**
- **GCP blockchain RPC**

## Connections

- Wallet user → Flutter app: opens
- Flutter app → Navigation: routes through
- Wallet user → Wallet onboarding: creates or imports
- Wallet user → Wallet overview: views wallet
- Wallet user → Transaction screens: sends or receives
- Wallet user → Transaction details: inspects transfer
- Wallet user → Congestion analytics: views network
- Wallet user → Transaction tracing: traces activity
- Wallet user → MEV analysis: checks MEV
- Wallet user → Market insights: explores insights
- Wallet user → Gemini analysis: requests analysis
- Wallet user → News discovery: browses news
- Wallet user → PYUSD City: opens visualization
- Gemini analysis → Google Gemini: analyzes with
- GCP RPC access → GCP blockchain RPC: calls RPC
- RPC calls → GCP blockchain RPC: calls RPC
