Architecture Overview
Veylent is a monorepo containing four main components, managed by Nx.
veylent/
├── apps/
│ ├── desktop/ Tauri 2 (Rust + React) desktop app
│ ├── api/ NestJS backend server
│ ├── web/ Verification web app (React + Vite)
│ ├── verify/ Mobile verification app (Expo)
│ └── docs/ This documentation (Docusaurus)
├── libs/
│ └── shared/
│ ├── types/ Shared TypeScript types (signing record, API results)
│ └── crypto/ Record decryption and scan check (verifyAnchor)
└── contracts/ Solidity smart contracts (Hardhat)
Data Flow
Communication Protocols
| Path | Protocol | Data |
|---|---|---|
| Desktop -> API | HTTPS POST | Anchor ID, composite hash, previous anchor ID, encrypted payload |
| API -> Blockchain | JSON-RPC | anchorDocument transaction; anchorBlock and event lookups |
| API -> Database | Prisma/SQL | Anchor record (anchor ID, tx hash, encrypted payload) |
| Phone -> Web App | HTTPS GET | Verification URL from QR |
| Web App / Mobile / Desktop -> API | HTTPS GET | Verification query by anchor ID |
The verification query only needs the server's database for the encrypted payload. The on-chain part (block, composite hash, previous anchor ID, timestamp) can be read directly from the contract by anyone.
Technology Stack
| Component | Technology | Why |
|---|---|---|
| Desktop frontend | React 19, TypeScript | Component model, ecosystem |
| Desktop backend | Rust (Tauri 2) | PDF manipulation, cryptography, security |
| API server | NestJS, TypeScript | Structured backend, validation, modules |
| Database | PostgreSQL (Prisma) | Relational data, migrations |
| Blockchain | Ethereum-compatible (Hardhat for dev) | Smart contracts, public verifiability |
| Verification web | React, Vite | Lightweight, fast loading for mobile |
| Monorepo | Nx 22 | Task orchestration, caching, dependencies |