# diigoosai/svdb architecture

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

- Interactive diagram: https://gitdiagram.com/diigoosai/svdb
- Repository: https://github.com/diigoosai/svdb

## Overview

##### Project type and purpose
- SVDB is an enterprise-grade, full-stack storage and verification platform combining a traditional database engine with blockchain security.
- Its purpose is to provide immutable data storage, cryptographic verification, and seamless Web2-to-Web3 integration via a blockchain bridge.

##### File structure
Top-level directories and their roles:
- svdb/api – REST API service (Python, Flask/FastAPI)
- svdb/blockchain_bridge – Web2↔Web3 bridge (transaction formatting, HSM integration)
- svdb/storage_engine – Core storage engine with Rust library + Python bindings
- svdb/integrations – Adapter framework for cloud storage (AWS, Azure, GCP, S3)
- svdb/admin_tools – Administrative and monitoring scripts (Python CLI)
- svdb/website – Web UI (Node.js / React)
- svdb/docs, tests, Dockerfile, docker-compose.yml, CI-CD workflows, env samples

Patterns and configurations:
- Layered separation (client/API, application services, core engine, infrastructure)
- Polyglot codebase: Python for orchestration/services, Rust for high-performance core
- Adapters plug into application layer (cloud, legacy)
- CI/CD via GitHub Actions, containerized via Docker Compose

##### README for additional insights
- The README defines four layers: Client Access, Application, Core, Infrastructure
- Core modules: Storage Engine (Rust/Python), Verification (hash chains, Merkle Trees), Blockchain Bridge (multi-chain, HSM)
- Application services: Auth, Query Engine, Cloud Storage Adapters
- Client layer: Web UI, REST API, SDK/CLI, Legacy System
- Infrastructure: Distributed storage backends, Admin/Monitoring tools, Blockchain networks

##### Final advice
- Related files: e.g., show “storage_engine” with sub-components (Rust lib.rs, Python svdb_core).
- Don’t omit the adapter framework under integrations.
- Docker/Docker Compose orchestration layer connecting services.
- Be detailed: show test harnesses and admin tools as supporting subprocesses under Infrastructure.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Client Access Layer"
        UI["Web UI"]:::client
        API["REST API Service"]:::client
        SDK["SDK/CLI"]:::client
        Legacy["Legacy Systems"]:::external
    end

    subgraph "Application Layer"
        Auth["Auth Service"]:::app
        Query["Query Engine"]:::app
        Adapter["Cloud Adapter Framework"]:::app
        Import["Import Tool"]:::app
    end

    subgraph "Core Layer"
        RustSE["Rust Storage Engine"]:::core
        PyBindings["Python Bindings"]:::core
        Verify["Verification Module"]:::core
        Bridge["Blockchain Bridge"]:::core
    end

    subgraph "Infrastructure Layer"
        Storage["Distributed File Storage"]:::infra
        Admin["Admin/Monitoring Tools"]:::infra
        Orchestration["Orchestration (Docker Compose)"]:::infra
        CICD["CI/CD Pipeline"]:::infra
        HSM["HSM"]:::external
        BCNet["Blockchain Networks (L1/L2)"]:::external
    end

    UI -->|HTTPS| API
    SDK -->|CLI| API
    Legacy -->|API Calls| API

    API -->|auth request| Auth
    Auth -->|auth token| Query
    Query -->|data ops| Adapter
    Query -->|data ops| PyBindings

    Adapter -->|cloud SDK| Storage
    PyBindings -->|FFI Calls| RustSE
    RustSE -->|store data| Storage
    RustSE -->|compute hashes| Verify
    Verify -->|build Merkle| Bridge
    Bridge -->|sign tx| HSM
    Bridge -->|RPC calls| BCNet

    Orchestration --> API
    Orchestration --> Auth
    Orchestration --> Query
    Orchestration --> Adapter
    Orchestration --> RustSE
    Orchestration --> Bridge

    CICD -->|CI/CD Pipeline| Orchestration

    click API "https://github.com/diigoosai/svdb/blob/main/svdb/api/app.py"
    click UI "https://github.com/diigoosai/svdb/tree/main/svdb/website/"
    click SDK "https://github.com/diigoosai/svdb/blob/main/svdb/storage_engine/python/svdb_core/__main__.py"
    click Adapter "https://github.com/diigoosai/svdb/tree/main/svdb/integrations/cloud_adapters/"
    click Adapter "https://github.com/diigoosai/svdb/blob/main/svdb/integrations/setup.py"
    click Import "https://github.com/diigoosai/svdb/blob/main/svdb/integrations/import_tool.py"
    click RustSE "https://github.com/diigoosai/svdb/blob/main/svdb/storage_engine/src/lib.rs"
    click PyBindings "https://github.com/diigoosai/svdb/tree/main/svdb/storage_engine/python/svdb_core/"
    click Verify "https://github.com/diigoosai/svdb/blob/main/svdb/verification/verification.py"
    click Bridge "https://github.com/diigoosai/svdb/blob/main/svdb/blockchain_bridge/bridge.py"
    click Storage "https://github.com/diigoosai/svdb/tree/main/svdb/data/data/"
    click Admin "https://github.com/diigoosai/svdb/tree/main/svdb/admin_tools/"
    click Orchestration "https://github.com/diigoosai/svdb/blob/main/svdb/docker-compose.yml"
    click CICD "https://github.com/diigoosai/svdb/blob/main/svdb/.github/workflows/ci-cd.yml"

    classDef client fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef app fill:#90EE90,stroke:#333,stroke-width:1px
    classDef core fill:#FFA500,stroke:#333,stroke-width:1px
    classDef infra fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef external fill:#CCCCCC,stroke:#333,stroke-width:1px
```
