# snoopysecurity/dvws-node architecture

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

- Interactive diagram: https://gitdiagram.com/snoopysecurity/dvws-node
- Repository: https://github.com/snoopysecurity/dvws-node

## Overview

##### Main Components

a) Client Layer:
- Static Web Frontend (in /public directory)
- Multiple HTML interfaces (admin, notes, search, upload interfaces)
- Client-side JavaScript components (passgen.js, receiver.js, userdisplay.js)

b) API/Service Layer:
- REST API endpoints (via Express.js routes)
- GraphQL API (/graphql directory)
- SOAP Web Service (soapserver directory)
- XML-RPC Service (rpc_server.js)
- Swagger API documentation (swagger.js)

c) Application Core:
- Controllers layer (/controllers)
- Models layer (/models)
- Authentication/Authorization system
- File storage system

d) Data Layer:
- MongoDB (NoSQL database)
- MySQL database
- File Storage System (/public/uploads)

##### Component Relationships

- Client → API Layer (HTTP/HTTPS requests)
- API Layer → Controllers (internal routing)
- Controllers → Models (data access)
- Models → Databases (data persistence)

##### Specific Elements

a) Entry Points:
- HTTP/HTTPS endpoints
- GraphQL endpoint
- SOAP endpoint
- XML-RPC endpoint

b) Security Components:
- JWT handling
- Authentication flow
- Access control points
- File upload handlers

**[Client Layer]**
- ↓ HTTP/HTTPS
**[API Gateway/Router]**
- ↓
**[Service Layer]**
- REST Controllers
- GraphQL Resolver
- SOAP Service
- XML-RPC Service
- ↓
**[Application Core]**
- Business Logic
- Models
- Security Controls
- ↓
**[Data Layer]**
- MongoDB
- MySQL
- File Storage

##### Important Notes

- Vulnerable components with warning symbols
- Security flow markers showing authentication/authorization paths
- A section showing the intentionally vulnerable areas
- Notes about the security testing endpoints

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Frontend["Static Frontend"]:::frontend
        HTMLInt["HTML Interfaces"]:::frontend
        ClientJS["Client JavaScript"]:::frontend
    end

    subgraph APIGateway["API Gateway"]
        REST["REST API"]:::api
        GraphQL["GraphQL Service"]:::api
        SOAP["SOAP Service"]:::api
        XMLRPC["XML-RPC Service"]:::api
        Swagger["API Documentation"]:::api
    end

    subgraph AppCore["Application Core"]
        Controllers["Controllers Layer"]:::core
        Models["Models Layer"]:::core
        Auth["Authentication System"]:::security
        Utils["Utilities"]:::core
        Config["Configuration"]:::core
    end

    subgraph Features["Feature Components"]
        direction TB
        Notebook["Notebook Feature"]:::feature
        Passphrase["Passphrase Feature"]:::feature
        Storage["Storage Feature"]:::feature
    end

    subgraph DataLayer["Data Layer"]
        MongoDB[(MongoDB)]:::database
        MySQL[(MySQL)]:::database
        FileStorage["File Storage"]:::storage
    end

    %% Connections
    Frontend --> APIGateway
    HTMLInt --> APIGateway
    ClientJS --> APIGateway

    APIGateway --> AppCore
    AppCore --> Features
    Features --> DataLayer
    AppCore --> DataLayer

    %% Click Events
    click Frontend "https://github.com/snoopysecurity/dvws-node/tree/master/public/"
    click HTMLInt "https://github.com/snoopysecurity/dvws-node/blob/master/public/*.html"
    click ClientJS "https://github.com/snoopysecurity/dvws-node/tree/master/public/static/"
    click REST "https://github.com/snoopysecurity/dvws-node/tree/master/routes/"
    click GraphQL "https://github.com/snoopysecurity/dvws-node/blob/master/graphql/schema.js"
    click SOAP "https://github.com/snoopysecurity/dvws-node/blob/master/soapserver/dvwsuserservice.js"
    click XMLRPC "https://github.com/snoopysecurity/dvws-node/blob/master/rpc_server.js"
    click Swagger "https://github.com/snoopysecurity/dvws-node/blob/master/swagger.js"
    click Controllers "https://github.com/snoopysecurity/dvws-node/tree/master/controllers/"
    click Models "https://github.com/snoopysecurity/dvws-node/tree/master/models/"
    click Utils "https://github.com/snoopysecurity/dvws-node/blob/master/utils.js"
    click Config "https://github.com/snoopysecurity/dvws-node/blob/master/config.xml"
    click FileStorage "https://github.com/snoopysecurity/dvws-node/tree/master/public/uploads/"
    click Auth "https://github.com/snoopysecurity/dvws-node/blob/master/controllers/users.js"
    click Notebook "https://github.com/snoopysecurity/dvws-node/blob/master/controllers/notebook.js"
    click Passphrase "https://github.com/snoopysecurity/dvws-node/blob/master/controllers/passphrase.js"
    click Storage "https://github.com/snoopysecurity/dvws-node/blob/master/controllers/storage.js"

    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:#fff
    classDef api fill:#2ecc71,stroke:#27ae60,color:#fff
    classDef core fill:#f1c40f,stroke:#f39c12,color:#000
    classDef security fill:#9b59b6,stroke:#8e44ad,color:#fff
    classDef database fill:#e74c3c,stroke:#c0392b,color:#fff
    classDef storage fill:#e67e22,stroke:#d35400,color:#fff
    classDef feature fill:#1abc9c,stroke:#16a085,color:#fff

    %% Legend
    subgraph Legend
        Frontend_L["Frontend Components"]:::frontend
        API_L["API Services"]:::api
        Core_L["Core Components"]:::core
        Security_L["Security Components"]:::security
        Database_L["Databases"]:::database
        Storage_L["Storage"]:::storage
        Feature_L["Features"]:::feature
    end
```
