# hemanth18gowda01-byte/demo architecture

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

- Interactive diagram: https://gitdiagram.com/hemanth18gowda01-byte/demo
- Repository: https://github.com/hemanth18gowda01-byte/demo

## Overview

BEL Digital Asset combines DID-based identity and access management, encrypted identity/document handling, and blockchain asset lifecycle and marketplace features. The principal workflow runs from a wallet-connected frontend through API or contract calls: users authenticate, manage private identity data or assets, and can list or buy NFTs using stablecoins. The graph preserves these distinct paths and the smart-account layer. Some route and contract implementations were not sampled, so their links reflect documented capabilities and visible frontend calls rather than assumed internal call chains.

Main entry points: [`frontend/js/contracts.js`](https://github.com/hemanth18gowda01-byte/demo/blob/main/frontend/js/contracts.js) (Wallet and contracts), [`backend/main.py`](https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/main.py) (FastAPI app), [`frontend/dashboard.html`](https://github.com/hemanth18gowda01-byte/demo/blob/main/frontend/dashboard.html) (Dashboard pages), [`frontend/js/assets.js`](https://github.com/hemanth18gowda01-byte/demo/blob/main/frontend/js/assets.js) (Asset UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web frontend"]
  node_dashboard["Dashboard pages<br/>[dashboard.html]"]
  node_identity_ui["Identity UI<br/>[identity.js]"]
  node_assets_ui["Asset UI<br/>[assets.js]"]
  node_market_ui["Marketplace UI<br/>[marketplace.js]"]
  node_access_ui["Access UI<br/>[access.js]"]
  node_wallet_client["Wallet and contracts<br/>[contracts.js]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_backend["Identity backend"]
  node_api["FastAPI app<br/>[main.py]"]
  node_auth["Wallet authentication<br/>[auth.py]"]
  node_secure_identity["Secure identity routes<br/>[secure_identity.py]"]
  node_identity_routes["Identity routes<br/>[identity.py]"]
  node_access_routes["Access routes<br/>[access.py]"]
  node_verification["Verification routes<br/>[verification.py]"]
  node_asset_routes["Asset routes<br/>[assets.py]"]
  node_encryption["Data encryption<br/>[encryption.py]"]
  node_blockchain_service["Blockchain service<br/>[blockchain.py]"]
  node_zk_service["ZK service<br/>[zk.py]"]
end

subgraph group_contracts["On-chain system"]
  node_access_contract["Access control<br/>[AccessControl.sol]"]
  node_identity_contract["Identity registry"]
  node_nft_contract["Asset NFT<br/>[AssetNFT.sol]"]
  node_market_contract["NFT marketplace"]
  node_verifier_contract["ZK verifier<br/>[ZKVerifier.sol]"]
  node_stablecoin_contract["Stablecoin transactions"]
  node_smart_account["Smart account<br/>[SmartAccount.sol]"]
end

subgraph group_state["Private state"]
  node_db[("SQLite identity store<br/>[database.py]")]
end

node_user(("User"))
node_wallet["Wallet provider"]
node_ethereum["Sepolia network"]
node_usdc["USDC token"]

node_user -->|"uses"| node_dashboard
node_dashboard -->|"opens identity"| node_identity_ui
node_dashboard -->|"opens assets"| node_assets_ui
node_dashboard -->|"opens marketplace"| node_market_ui
node_dashboard -->|"opens access"| node_access_ui
node_identity_ui -->|"requests API"| node_api_client
node_assets_ui -->|"saves metadata"| node_api_client
node_api_client -->|"sends requests"| node_api
node_api -->|"mounts auth"| node_auth
node_api -->|"mounts routes"| node_secure_identity
node_api -->|"mounts routes"| node_identity_routes
node_api -->|"mounts routes"| node_access_routes
node_api -->|"mounts routes"| node_verification
node_api -->|"mounts routes"| node_asset_routes
node_auth -->|"stores challenges"| node_db
node_auth -->|"verifies signature"| node_wallet
node_secure_identity -->|"checks session"| node_auth
node_secure_identity -->|"encrypts data"| node_encryption
node_secure_identity -->|"reads and writes"| node_db
node_asset_routes -->|"reads asset"| node_blockchain_service
node_asset_routes -->|"returns metadata"| node_api_client
node_identity_ui -->|"connects wallet"| node_wallet_client
node_assets_ui -->|"submits transactions"| node_wallet_client
node_market_ui -->|"submits transactions"| node_wallet_client
node_access_ui -->|"submits transactions"| node_wallet_client
node_wallet_client -->|"requests signatures"| node_wallet
node_wallet_client -->|"reads and sends"| node_ethereum
node_wallet_client -->|"calls contract"| node_identity_contract
node_wallet_client -->|"calls contract"| node_access_contract
node_assets_ui -->|"mints and manages"| node_nft_contract
node_market_ui -->|"lists and buys"| node_market_contract
node_market_ui -->|"checks and approves"| node_usdc
node_market_contract -->|"settles trade"| node_usdc
node_market_contract -->|"transfers NFT"| node_nft_contract
node_ethereum -->|"executes"| node_verifier_contract
node_ethereum -->|"executes"| node_stablecoin_contract
node_ethereum -->|"executes"| node_smart_account
node_verification -->|"verifies proof"| node_zk_service

click node_dashboard "https://github.com/hemanth18gowda01-byte/demo/blob/main/frontend/dashboard.html"
click node_identity_ui "https://github.com/hemanth18gowda01-byte/demo/blob/main/frontend/js/identity.js"
click node_assets_ui "https://github.com/hemanth18gowda01-byte/demo/blob/main/frontend/js/assets.js"
click node_market_ui "https://github.com/hemanth18gowda01-byte/demo/blob/main/frontend/js/marketplace.js"
click node_access_ui "https://github.com/hemanth18gowda01-byte/demo/blob/main/frontend/js/access.js"
click node_wallet_client "https://github.com/hemanth18gowda01-byte/demo/blob/main/frontend/js/contracts.js"
click node_api_client "https://github.com/hemanth18gowda01-byte/demo/blob/main/frontend/js/api.js"
click node_api "https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/main.py"
click node_auth "https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/services/auth.py"
click node_secure_identity "https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/routes/secure_identity.py"
click node_identity_routes "https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/routes/identity.py"
click node_access_routes "https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/routes/access.py"
click node_verification "https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/routes/verification.py"
click node_asset_routes "https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/routes/assets.py"
click node_encryption "https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/services/encryption.py"
click node_blockchain_service "https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/services/blockchain.py"
click node_zk_service "https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/services/zk.py"
click node_db "https://github.com/hemanth18gowda01-byte/demo/blob/main/database/database.py"
click node_access_contract "https://github.com/hemanth18gowda01-byte/demo/blob/main/src/AccessControl.sol"
click node_identity_contract "https://github.com/hemanth18gowda01-byte/demo/blob/main/src/IdentityRegistry.sol"
click node_nft_contract "https://github.com/hemanth18gowda01-byte/demo/blob/main/src/AssetNFT.sol"
click node_market_contract "https://github.com/hemanth18gowda01-byte/demo/blob/main/src/AssetMarketplace.sol"
click node_verifier_contract "https://github.com/hemanth18gowda01-byte/demo/blob/main/src/ZKVerifier.sol"
click node_stablecoin_contract "https://github.com/hemanth18gowda01-byte/demo/blob/main/src/StableCoinTransaction.sol"
click node_smart_account "https://github.com/hemanth18gowda01-byte/demo/blob/main/src/accountAbstraction/SmartAccount.sol"

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_dashboard,node_identity_ui,node_assets_ui,node_market_ui,node_access_ui,node_wallet_client,node_api_client,node_user toneBlue
class node_api,node_auth,node_secure_identity,node_identity_routes,node_access_routes,node_verification,node_asset_routes,node_encryption,node_blockchain_service,node_zk_service toneAmber
class node_access_contract,node_identity_contract,node_nft_contract,node_market_contract,node_verifier_contract,node_stablecoin_contract,node_smart_account toneMint
class node_db toneRose
class node_wallet,node_ethereum,node_usdc toneIndigo
```

## Components

### Web frontend

- [Dashboard pages](https://github.com/hemanth18gowda01-byte/demo/blob/main/frontend/dashboard.html): `frontend/dashboard.html`
- [Identity UI](https://github.com/hemanth18gowda01-byte/demo/blob/main/frontend/js/identity.js): `frontend/js/identity.js`
- [Asset UI](https://github.com/hemanth18gowda01-byte/demo/blob/main/frontend/js/assets.js): `frontend/js/assets.js`
- [Marketplace UI](https://github.com/hemanth18gowda01-byte/demo/blob/main/frontend/js/marketplace.js): `frontend/js/marketplace.js`
- [Access UI](https://github.com/hemanth18gowda01-byte/demo/blob/main/frontend/js/access.js): `frontend/js/access.js`
- [Wallet and contracts](https://github.com/hemanth18gowda01-byte/demo/blob/main/frontend/js/contracts.js): `frontend/js/contracts.js`
- [API client](https://github.com/hemanth18gowda01-byte/demo/blob/main/frontend/js/api.js): `frontend/js/api.js`

### Identity backend

- [FastAPI app](https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/main.py): `backend/main.py`
- [Wallet authentication](https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/services/auth.py): `backend/services/auth.py`
- [Secure identity routes](https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/routes/secure_identity.py): `backend/routes/secure_identity.py`
- [Identity routes](https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/routes/identity.py): `backend/routes/identity.py`
- [Access routes](https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/routes/access.py): `backend/routes/access.py`
- [Verification routes](https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/routes/verification.py): `backend/routes/verification.py`
- [Asset routes](https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/routes/assets.py): `backend/routes/assets.py`
- [Data encryption](https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/services/encryption.py): `backend/services/encryption.py`
- [Blockchain service](https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/services/blockchain.py): `backend/services/blockchain.py`
- [ZK service](https://github.com/hemanth18gowda01-byte/demo/blob/main/backend/services/zk.py): `backend/services/zk.py`

### On-chain system

- [Access control](https://github.com/hemanth18gowda01-byte/demo/blob/main/src/AccessControl.sol): `src/AccessControl.sol`
- [Identity registry](https://github.com/hemanth18gowda01-byte/demo/blob/main/src/IdentityRegistry.sol): `src/IdentityRegistry.sol`
- [Asset NFT](https://github.com/hemanth18gowda01-byte/demo/blob/main/src/AssetNFT.sol): `src/AssetNFT.sol`
- [NFT marketplace](https://github.com/hemanth18gowda01-byte/demo/blob/main/src/AssetMarketplace.sol): `src/AssetMarketplace.sol`
- [ZK verifier](https://github.com/hemanth18gowda01-byte/demo/blob/main/src/ZKVerifier.sol): `src/ZKVerifier.sol`
- [Stablecoin transactions](https://github.com/hemanth18gowda01-byte/demo/blob/main/src/StableCoinTransaction.sol): `src/StableCoinTransaction.sol`
- [Smart account](https://github.com/hemanth18gowda01-byte/demo/blob/main/src/accountAbstraction/SmartAccount.sol): `src/accountAbstraction/SmartAccount.sol`

### Private state

- [SQLite identity store](https://github.com/hemanth18gowda01-byte/demo/blob/main/database/database.py): `database/database.py`

### Other components

- **User**
- **Wallet provider**
- **Sepolia network**
- **USDC token**

## Connections

- User → Dashboard pages: uses
- Dashboard pages → Identity UI: opens identity
- Dashboard pages → Asset UI: opens assets
- Dashboard pages → Marketplace UI: opens marketplace
- Dashboard pages → Access UI: opens access
- Identity UI → API client: requests API
- Asset UI → API client: saves metadata
- API client → FastAPI app: sends requests
- FastAPI app → Wallet authentication: mounts auth
- FastAPI app → Secure identity routes: mounts routes
- FastAPI app → Identity routes: mounts routes
- FastAPI app → Access routes: mounts routes
- FastAPI app → Verification routes: mounts routes
- FastAPI app → Asset routes: mounts routes
- Wallet authentication → SQLite identity store: stores challenges
- Wallet authentication → Wallet provider: verifies signature
- Secure identity routes → Wallet authentication: checks session
- Secure identity routes → Data encryption: encrypts data
- Secure identity routes → SQLite identity store: reads and writes
- Asset routes → Blockchain service: reads asset
- Asset routes → API client: returns metadata
- Identity UI → Wallet and contracts: connects wallet
- Asset UI → Wallet and contracts: submits transactions
- Marketplace UI → Wallet and contracts: submits transactions
- Access UI → Wallet and contracts: submits transactions
- Wallet and contracts → Wallet provider: requests signatures
- Wallet and contracts → Sepolia network: reads and sends
- Wallet and contracts → Identity registry: calls contract
- Wallet and contracts → Access control: calls contract
- Asset UI → Asset NFT: mints and manages
- Marketplace UI → NFT marketplace: lists and buys
- Marketplace UI → USDC token: checks and approves
- NFT marketplace → USDC token: settles trade
- NFT marketplace → Asset NFT: transfers NFT
- Sepolia network → ZK verifier: executes
- Sepolia network → Stablecoin transactions: executes
- Sepolia network → Smart account: executes
- Verification routes → ZK service: verifies proof
