# dappros/ethora architecture

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

- Interactive diagram: https://gitdiagram.com/dappros/ethora
- Repository: https://github.com/dappros/ethora

## Overview

##### Project Type and Purpose
- Ethora is a full-stack, mono-repo “super app” engine combining:
- Mobile client (React Native iOS/Android)
- Web client (React.js and Next.js)
- REST API and self-hosted server (Node.js/TypeScript)
- XMPP-based real-time chat server (ejabberd under the hood)
- Ethereum smart contracts (Hardhat)
- Bots framework (Node.js scaffolding for XMPP bots)
- App‐builder UI (web interface for low-code app generation)
- Purpose: provide a low-code, customizable platform for wallets, social chat, gamification, digital assets (ERC-20/1155 NFTs), bots, push notifications, and more.

##### File Structure Analysis
- Top-level directories:
- api/ – wrapper for Dappros Platform API (swagger, pushes, chats)
- bots/ – sample bots and bot template for XMPP interactions
- client-reactnative/ – full React Native mobile app
- client-web/ & client-web-install/ – React.js web app and an installable / builder UI
- ethereum-contracts/ – Hardhat Ethereum smart contracts
- ethora-polygon-server/ & ethora-polygon-next/ – Polygon integration server and Next.js front end
- xmpp-web-debug/ – debug UI for XMPP chat server
- Configuration, build, and deployment files:
- .github/workflows – CI for Docker images
- Dockerfile/docker-compose in client-web, ethora-polygon-server
- Hardhat config, tsconfig.json, package.json at each service

##### Key README Insights
- Architecture components: mobile, web, blockchain network, API wrapper, caching, XMPP messaging (ejabberd), bots
- Technology stack: React/React Native, Node.js/TypeScript, Web3.js, MongoDB, Cassandra, JWT, AWS, ChatGPT integration
- Deployment options: cloud backend (Dappros Platform), AWS Marketplace self-hosted, Docker Hub images

## Diagram (Mermaid)

```mermaid
graph TD
    %% Clients
    subgraph "Clients"
        MRN["Mobile React Native App"]:::frontend
        WEBSPA["Web React.js SPA"]:::frontend
        APPBUILDER["Next.js App Builder UI"]:::frontend
        XMPPDEBUG["XMPP Debug UI"]:::frontend
        POLYFRONT["Polygon Frontend (Next.js)"]:::frontend
    end

    %% Backend Services
    subgraph "Backend Services"
        API["REST API Layer (Node.js + Swagger)"]:::backend
        POLYSERVER["Polygon Integration Server"]:::backend
        XMPP["ejabberd XMPP Server"]:::backend
    end

    %% Bots Framework
    subgraph "Bots Framework"
        BOTS["Bots Framework"]:::backend
    end

    %% Blockchain Layer
    subgraph "Blockchain Layer"
        CONTRACTS["Smart Contracts (Hardhat)"]:::blockchain
        ETHNET["Ethereum Network"]:::external
        IPFS["IPFS / S3 Storage"]:::external
    end

    %% Data Stores
    subgraph "Data Stores"
        MONGO["MongoDB"]:::database
        CAS["Apache Cassandra"]:::database
        REDIS["Redis / Kafka"]:::database
    end

    %% Push Notifications
    subgraph "Push Notifications"
        PUSH["Firebase / APNs"]:::external
    end

    %% External AI API
    subgraph "External Services"
        OPENAI["OpenAI ChatGPT API"]:::external
    end

    %% CI/CD
    subgraph "CI/CD Pipelines"
        WORKFLOW["GitHub Actions Workflow"]:::backend
        DOCKERWEB["Web Client Docker-Compose"]:::backend
        DOCKERFILEWEB["Web Client Dockerfile"]:::backend
        DOCKERPOLY["Polygon Server Docker-Compose"]:::backend
    end

    %% Client to API & Chat
    MRN -->|"HTTPS"| API
    WEBSPA -->|"HTTPS"| API
    APPBUILDER -->|"HTTPS"| API
    POLYFRONT -->|"HTTPS"| API

    MRN -->|"WebSocket/TCP"| XMPP
    WEBSPA -->|"WebSocket/TCP"| XMPP
    XMPPDEBUG -->|"WebSocket/TCP"| XMPP

    %% Polygon Frontend to Polygon Server
    POLYFRONT -->|"HTTPS"| POLYSERVER

    %% API to Data Stores
    API -->|"read/write"| MONGO
    API -->|"read/write"| CAS
    API -->|"cache"| REDIS

    %% XMPP to Cassandra
    XMPP -->|"presence/chat storage"| CAS

    %% API to Blockchain
    API -.->|"Web3.js"| CONTRACTS
    CONTRACTS -.->|"deployed via Hardhat"| ETHNET
    CONTRACTS -->|"store metadata"| IPFS

    %% API and XMPP to Push
    API -->|"push"| PUSH
    XMPP -->|"push"| PUSH

    %% Bots interactions
    BOTS -->|"XMPP Client"| XMPP
    BOTS -->|"HTTP"| OPENAI

    %% CI/CD flows
    APPBUILDER -->|"triggers"| WORKFLOW
    WORKFLOW -->|"build & push"| DOCKERWEB
    WORKFLOW -->|"build & push"| DOCKERPOLY

    %% Polygon Server to Data Stores
    POLYSERVER -->|"read/write"| MONGO

    %% Click Events
    click MRN "https://github.com/dappros/ethora/tree/main/client-reactnative/"
    click WEBSPA "https://github.com/dappros/ethora/tree/main/client-web/"
    click APPBUILDER "https://github.com/dappros/ethora/tree/main/client-web-install/"
    click XMPPDEBUG "https://github.com/dappros/ethora/tree/main/xmpp-web-debug/"
    click API "https://github.com/dappros/ethora/tree/main/api/"
    click BOTS "https://github.com/dappros/ethora/tree/main/bots/"
    click CONTRACTS "https://github.com/dappros/ethora/tree/main/ethereum-contracts/"
    click POLYSERVER "https://github.com/dappros/ethora/tree/main/ethora-polygon-server/"
    click POLYFRONT "https://github.com/dappros/ethora/tree/main/ethora-polygon-next/"
    click WORKFLOW "https://github.com/dappros/ethora/blob/main/.github/workflows/pushClientWebToDockerHub.yml"
    click DOCKERWEB "https://github.com/dappros/ethora/blob/main/client-web/docker-compose.yml"
    click DOCKERFILEWEB "https://github.com/dappros/ethora/tree/main/client-web/dockerfolder/Dockerfile"
    click DOCKERPOLY "https://github.com/dappros/ethora/blob/main/ethora-polygon-server/docker-compose.yml"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366d6,stroke-width:1px
    classDef backend fill:#E6F4EA,stroke:#22863A,stroke-width:1px
    classDef database fill:#FFF5B1,stroke:#DB9B00,stroke-width:1px
    classDef blockchain fill:#F0E6FF,stroke:#6F42C1,stroke-width:1px
    classDef external fill:#FFF0F6,stroke:#D52750,stroke-width:1px
```
