# danielquang07/veris architecture

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

- Interactive diagram: https://gitdiagram.com/danielquang07/veris
- Repository: https://github.com/danielquang07/veris

## Overview

Veris is a Solana Devnet DEX paired with Veris Shield and a Vietnamese-language scam-message analyzer. The main user flow is to connect a wallet, inspect a token or wallet—or submit a promotional message—then receive a risk report; risky tokens can be blocked before swap/liquidity signing, and reports can be saved on-chain. DEX transactions use Raydium CPMM, while Shield reads token and wallet data and the blacklist from Solana. The README documents the AI service integration and Anchor registry/detector as roadmap programs; source excerpts are partial, so uncertain internal links are omitted.

Main entry points: [`hooks/useTokenGuard.ts`](https://github.com/danielquang07/veris/blob/main/hooks/useTokenGuard.ts) (Pre-sign guard), [`app/page.tsx`](https://github.com/danielquang07/veris/blob/main/app/page.tsx) (DEX home), [`components/dex/SwapToken.tsx`](https://github.com/danielquang07/veris/blob/main/components/dex/SwapToken.tsx) (Token swap), [`components/dex/ProvideLiquidity.tsx`](https://github.com/danielquang07/veris/blob/main/components/dex/ProvideLiquidity.tsx) (Liquidity tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["DEX experience"]
  node_dex_home["DEX home<br/>[page.tsx]"]
  node_swap["Token swap<br/>[SwapToken.tsx]"]
  node_liquidity["Liquidity tools"]
end

subgraph group_shield["Veris Shield"]
  node_shield_page["Shield page<br/>[page.tsx]"]
  node_token_check["Token check API<br/>[route.ts]"]
  node_token_risk["Token risk checks<br/>[tokenRisk.ts]"]
  node_wallet_scan_ui["Wallet scanner<br/>[WalletScan.tsx]"]
  node_wallet_api["Wallet scan API<br/>[route.ts]"]
  node_wallet_logic["Wallet scan logic<br/>[walletScan.ts]"]
  node_guard["Pre-sign guard<br/>[useTokenGuard.ts]"]
  node_guard_modal["Risk decision modal"]
  node_token_report["Token report"]
end

subgraph group_ai["Message analysis"]
  node_message_page["Scam check page<br/>[page.tsx]"]
  node_analyze_api["Analyze API<br/>[route.ts]"]
  node_ai_service["AI service<br/>[main.py]"]
  node_analyzer["Risk analyzer<br/>[analyzer.py]"]
  node_result_card["Analysis report<br/>[ResultCard.tsx]"]
end

subgraph group_chain["Solana services"]
  node_raydium["Raydium CPMM<br/>[raydium.ts]"]
  node_blacklist["SCAMREG blacklist<br/>[blacklist.ts]"]
  node_evidence["Evidence memo builder<br/>[writeChain.ts]"]
end

subgraph group_programs["Anchor roadmap"]
  node_scam_program["Scam detector<br/>[instructions.rs]"]
  node_registry_program["Veris registry<br/>[instructions.rs]"]
end

node_trader(("Trader"))
node_solana[("Solana Devnet")]

node_trader -->|"opens DEX"| node_dex_home
node_trader -->|"opens Shield"| node_shield_page
node_dex_home -->|"offers swap"| node_swap
node_dex_home -->|"offers liquidity"| node_liquidity
node_swap -->|"checks token"| node_guard
node_liquidity -->|"checks token"| node_guard
node_guard -->|"requests check"| node_token_check
node_guard -->|"presents decision"| node_guard_modal
node_swap -->|"builds swap"| node_raydium
node_liquidity -->|"builds transactions"| node_raydium
node_raydium -->|"reads and submits"| node_solana
node_shield_page -->|"shows report"| node_token_report
node_shield_page -->|"offers wallet scan"| node_wallet_scan_ui
node_token_report -->|"builds evidence memo"| node_evidence
node_result_card -->|"builds evidence memo"| node_evidence
node_token_report -->|"writes report memo"| node_solana
node_result_card -->|"writes message memo"| node_solana
node_token_check -->|"checks token"| node_token_risk
node_token_risk -->|"reads blacklist"| node_blacklist
node_blacklist -->|"reads SCAMREG memos"| node_solana
node_wallet_scan_ui -->|"requests scan"| node_wallet_api
node_wallet_api -->|"scans holdings"| node_wallet_logic
node_wallet_api -->|"checks blacklist"| node_blacklist
node_wallet_scan_ui -->|"submits revoke"| node_solana
node_message_page -->|"submits message"| node_analyze_api
node_analyze_api -->|"proxies analysis"| node_ai_service
node_ai_service -->|"analyzes message"| node_analyzer
node_message_page -->|"shows result"| node_result_card
node_ai_service -->|"reads chain context"| node_solana
node_scam_program -.->|"roadmap deployment"| node_solana
node_registry_program -.->|"roadmap deployment"| node_solana

click node_dex_home "https://github.com/danielquang07/veris/blob/main/app/page.tsx"
click node_swap "https://github.com/danielquang07/veris/blob/main/components/dex/SwapToken.tsx"
click node_liquidity "https://github.com/danielquang07/veris/blob/main/components/dex/ProvideLiquidity.tsx"
click node_raydium "https://github.com/danielquang07/veris/blob/main/lib/raydium.ts"
click node_shield_page "https://github.com/danielquang07/veris/blob/main/app/shield/page.tsx"
click node_token_check "https://github.com/danielquang07/veris/blob/main/app/api/token-check/route.ts"
click node_token_risk "https://github.com/danielquang07/veris/blob/main/lib/tokenRisk.ts"
click node_blacklist "https://github.com/danielquang07/veris/blob/main/lib/blacklist.ts"
click node_wallet_scan_ui "https://github.com/danielquang07/veris/blob/main/components/shield/WalletScan.tsx"
click node_wallet_api "https://github.com/danielquang07/veris/blob/main/app/api/wallet-scan/route.ts"
click node_wallet_logic "https://github.com/danielquang07/veris/blob/main/lib/walletScan.ts"
click node_guard "https://github.com/danielquang07/veris/blob/main/hooks/useTokenGuard.ts"
click node_guard_modal "https://github.com/danielquang07/veris/blob/main/components/shield/TokenGuardModal.tsx"
click node_token_report "https://github.com/danielquang07/veris/blob/main/components/shield/TokenReportCard.tsx"
click node_message_page "https://github.com/danielquang07/veris/blob/main/app/check-scam/page.tsx"
click node_analyze_api "https://github.com/danielquang07/veris/blob/main/app/api/analyze/route.ts"
click node_ai_service "https://github.com/danielquang07/veris/blob/main/ai-service/main.py"
click node_analyzer "https://github.com/danielquang07/veris/blob/main/ai-service/analyzer.py"
click node_result_card "https://github.com/danielquang07/veris/blob/main/components/scam-check/ResultCard.tsx"
click node_evidence "https://github.com/danielquang07/veris/blob/main/lib/writeChain.ts"
click node_scam_program "https://github.com/danielquang07/veris/blob/main/anchor/programs/scam_detector/src/instructions.rs"
click node_registry_program "https://github.com/danielquang07/veris/blob/main/anchor/programs/veris_registry/src/instructions.rs"

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_dex_home,node_swap,node_liquidity toneBlue
class node_shield_page,node_token_check,node_token_risk,node_wallet_scan_ui,node_wallet_api,node_wallet_logic,node_guard,node_guard_modal,node_token_report,node_solana toneAmber
class node_message_page,node_analyze_api,node_ai_service,node_analyzer,node_result_card toneMint
class node_raydium,node_blacklist,node_evidence toneRose
class node_scam_program,node_registry_program,node_trader toneIndigo
```

## Components

### DEX experience

- [DEX home](https://github.com/danielquang07/veris/blob/main/app/page.tsx): `app/page.tsx`
- [Token swap](https://github.com/danielquang07/veris/blob/main/components/dex/SwapToken.tsx): `components/dex/SwapToken.tsx`
- [Liquidity tools](https://github.com/danielquang07/veris/blob/main/components/dex/ProvideLiquidity.tsx): `components/dex/ProvideLiquidity.tsx`

### Veris Shield

- [Shield page](https://github.com/danielquang07/veris/blob/main/app/shield/page.tsx): `app/shield/page.tsx`
- [Token check API](https://github.com/danielquang07/veris/blob/main/app/api/token-check/route.ts): `app/api/token-check/route.ts`
- [Token risk checks](https://github.com/danielquang07/veris/blob/main/lib/tokenRisk.ts): `lib/tokenRisk.ts`
- [Wallet scanner](https://github.com/danielquang07/veris/blob/main/components/shield/WalletScan.tsx): `components/shield/WalletScan.tsx`
- [Wallet scan API](https://github.com/danielquang07/veris/blob/main/app/api/wallet-scan/route.ts): `app/api/wallet-scan/route.ts`
- [Wallet scan logic](https://github.com/danielquang07/veris/blob/main/lib/walletScan.ts): `lib/walletScan.ts`
- [Pre-sign guard](https://github.com/danielquang07/veris/blob/main/hooks/useTokenGuard.ts): `hooks/useTokenGuard.ts`
- [Risk decision modal](https://github.com/danielquang07/veris/blob/main/components/shield/TokenGuardModal.tsx): `components/shield/TokenGuardModal.tsx`
- [Token report](https://github.com/danielquang07/veris/blob/main/components/shield/TokenReportCard.tsx): `components/shield/TokenReportCard.tsx`

### Message analysis

- [Scam check page](https://github.com/danielquang07/veris/blob/main/app/check-scam/page.tsx): `app/check-scam/page.tsx`
- [Analyze API](https://github.com/danielquang07/veris/blob/main/app/api/analyze/route.ts): `app/api/analyze/route.ts`
- [AI service](https://github.com/danielquang07/veris/blob/main/ai-service/main.py): `ai-service/main.py`
- [Risk analyzer](https://github.com/danielquang07/veris/blob/main/ai-service/analyzer.py): `ai-service/analyzer.py`
- [Analysis report](https://github.com/danielquang07/veris/blob/main/components/scam-check/ResultCard.tsx): `components/scam-check/ResultCard.tsx`

### Solana services

- [Raydium CPMM](https://github.com/danielquang07/veris/blob/main/lib/raydium.ts): `lib/raydium.ts`
- [SCAMREG blacklist](https://github.com/danielquang07/veris/blob/main/lib/blacklist.ts): `lib/blacklist.ts`
- [Evidence memo builder](https://github.com/danielquang07/veris/blob/main/lib/writeChain.ts): `lib/writeChain.ts`

### Anchor roadmap

- [Scam detector](https://github.com/danielquang07/veris/blob/main/anchor/programs/scam_detector/src/instructions.rs): `anchor/programs/scam_detector/src/instructions.rs`
- [Veris registry](https://github.com/danielquang07/veris/blob/main/anchor/programs/veris_registry/src/instructions.rs): `anchor/programs/veris_registry/src/instructions.rs`

### Other components

- **Trader**
- **Solana Devnet**

## Connections

- Trader → DEX home: opens DEX
- Trader → Shield page: opens Shield
- DEX home → Token swap: offers swap (evidence: `app/page.tsx`)
- DEX home → Liquidity tools: offers liquidity (evidence: `app/page.tsx`)
- Token swap → Pre-sign guard: checks token (evidence: `components/dex/SwapToken.tsx`)
- Liquidity tools → Pre-sign guard: checks token (evidence: `components/dex/ProvideLiquidity.tsx`)
- Pre-sign guard → Token check API: requests check (evidence: `hooks/useTokenGuard.ts`)
- Pre-sign guard → Risk decision modal: presents decision (evidence: `components/dex/SwapToken.tsx`)
- Token swap → Raydium CPMM: builds swap (evidence: `components/dex/SwapToken.tsx`)
- Liquidity tools → Raydium CPMM: builds transactions (evidence: `components/dex/ProvideLiquidity.tsx`)
- Raydium CPMM → Solana Devnet: reads and submits
- Shield page → Token report: shows report (evidence: `app/shield/page.tsx`)
- Shield page → Wallet scanner: offers wallet scan (evidence: `app/shield/page.tsx`)
- Token report → Evidence memo builder: builds evidence memo (evidence: `components/shield/TokenReportCard.tsx`)
- Analysis report → Evidence memo builder: builds evidence memo (evidence: `components/scam-check/ResultCard.tsx`)
- Token report → Solana Devnet: writes report memo
- Analysis report → Solana Devnet: writes message memo (evidence: `components/scam-check/ResultCard.tsx`)
- Token check API → Token risk checks: checks token (evidence: `app/api/token-check/route.ts`)
- Token risk checks → SCAMREG blacklist: reads blacklist (evidence: `lib/tokenRisk.ts`)
- SCAMREG blacklist → Solana Devnet: reads SCAMREG memos (evidence: `lib/blacklist.ts`)
- Wallet scanner → Wallet scan API: requests scan (evidence: `components/shield/WalletScan.tsx`)
- Wallet scan API → Wallet scan logic: scans holdings (evidence: `app/api/wallet-scan/route.ts`)
- Wallet scan API → SCAMREG blacklist: checks blacklist (evidence: `app/api/wallet-scan/route.ts`)
- Wallet scanner → Solana Devnet: submits revoke
- Scam check page → Analyze API: submits message
- Analyze API → AI service: proxies analysis
- AI service → Risk analyzer: analyzes message (evidence: `ai-service/main.py`)
- Scam check page → Analysis report: shows result (evidence: `app/check-scam/page.tsx`)
- AI service → Solana Devnet: reads chain context
- Scam detector → Solana Devnet: roadmap deployment
- Veris registry → Solana Devnet: roadmap deployment
