# vynect/venom architecture

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

- Interactive diagram: https://gitdiagram.com/vynect/venom
- Repository: https://github.com/vynect/venom

## Overview

##### Project type and purpose
- From the README, Venom is a WhatsApp-automation engine that has now been rebranded as “ERA CONNECT™,” moving to a freemium/commercial model.
- It is effectively a full-stack, message-relay platform providing APIs or SDKs to send, receive, and process WhatsApp messages at scale, with a web-based dashboard and licensing/payment integration for PRO features.

##### (minimal) file structure
- The repository currently contains only a LICENSE and README.md, which implies that the code has been factored into a new private codebase under the ERA CONNECT™ brand.
- We will reconstruct the likely high-level folder layout of the production codebase:
- backend/ (API server, business logic, message engine)
- connector/ (WhatsApp session managers, client drivers)
- frontend/ (React/Vue dashboard for users and admins)
- common/ (shared models, utilities, config)
- scripts/ (deployment, build, migrations)
- infra/ (Kubernetes manifests, Terraform, Dockerfiles)

##### Readme insights
- The transition to a freemium model indicates the addition of licensing checks, rate limiting, multi-tenant session support, payment gateway integration, and metrics.
- Security and stability are emphasized—expect authentication, authorization, auditing, secure key management, horizontal scaling.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Swimlanes
    subgraph "User Interface" 
        direction TB
        WebDashboard["Web Dashboard"]:::frontend
        SDKClients["SDK Clients"]:::frontend
    end

    subgraph "API & Control Plane"
        direction TB
        APIGateway["API Gateway\n(JWT/OAuth2, Rate Limiting)"]:::business
        LicensingService["Licensing Service\n(Free vs PRO)"]:::business
        MessagingEngine["Messaging Engine"]:::business
        SessionManager["Session Manager"]:::business
        MessageRouter["Message Router"]:::business
    end

    subgraph "Connectors"
        direction TB
        WAConnector["WhatsApp Connector\n(Puppeteer/API)"]:::business
    end

    subgraph "Data Layer"
        direction TB
        SQLDB[(PostgreSQL)]:::datastore
        RedisCache[(Redis Cache\nPub/Sub)]:::datastore
    end

    subgraph "External Services"
        direction TB
        PaymentGateway["Payment Gateway\n(Stripe/PayPal)"]:::external
        AuthProvider["Auth Provider\n(Auth0/LDAP/OIDC)"]:::external
        Monitoring["Monitoring & Logging\n(Prometheus/Grafana/ELK)"]:::external
    end

    %% Flows
    WebDashboard -->|HTTPS/JSON| APIGateway
    SDKClients -->|HTTPS/JSON| APIGateway
    APIGateway -->|gRPC/REST| LicensingService
    APIGateway -->|gRPC/REST| MessagingEngine

    MessagingEngine --> SessionManager
    MessagingEngine --> MessageRouter
    SessionManager --> WAConnector
    MessageRouter --> WAConnector
    WAConnector -->|WebSocket/JSON| MessageRouter
    MessageRouter -->|Events| WebDashboard

    LicensingService --> SQLDB
    MessagingEngine --> SQLDB
    SessionManager --> RedisCache
    MessageRouter --> RedisCache

    PaymentGateway -->|Webhooks| LicensingService
    AuthProvider -->|OAuth2| APIGateway
    MessagingEngine -->|Metrics| Monitoring
    APIGateway -->|Logs| Monitoring

    %% Click events
    ProjectOverview["Project Documentation / Overview"]:::docs
    LicensingInformation["Licensing Information"]:::docs

    click ProjectOverview "https://github.com/vynect/venom/blob/master/README.md"
    click LicensingInformation "https://github.com/vynect/venom/tree/master/LICENSE"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366D6,color:#0366D6;
    classDef business fill:#E6FFEA,stroke:#28A745,color:#28A745;
    classDef datastore fill:#FFF4E6,stroke:#FF8C00,color:#FF8C00;
    classDef external fill:#F3E6FF,stroke:#6F42C1,color:#6F42C1;
    classDef docs fill:#EEEEEE,stroke:#666666,color:#333333;
```
