5
TOGAF Architecture
WMJ Ismail edited this page 2026-07-06 08:36:10 +02:00
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FalahOS TOGAF Architecture — Layer by Layer

flowchart TB
    %% Styles
    classDef business fill:#78350f,stroke:#fbbf24,stroke-width:2
    classDef data fill:#4c1d95,stroke:#a78bfa,stroke-width:2
    classDef app fill:#083344,stroke:#22d3ee,stroke-width:2
    classDef tech fill:#064e3b,stroke:#34d399,stroke-width:2
    classDef ext fill:#1e293b,stroke:#94a3b8,stroke-width:1.5
    classDef product fill:#881337,stroke:#fb7185,stroke-width:1.5

    %% ═══════════════════════════════════════════════════
    %% L1 — BUSINESS ARCHITECTURE
    %% ═══════════════════════════════════════════════════
    subgraph BIZ["L1 — Business Architecture"]
        direction TB

        VISION["Vision: Shariah-compliant digital economy platform (Falah OS v1.3)"]
        MISSION["Mission: Democratise Islamic finance, halal certification, inheritance planning"]

        subgraph PRODUCTS["Products & Modules"]
            P1["Faraid Tokenisation — Islamic inheritance automation (Solidity + Foundry)"]
            P2["Halal Certification — ASEAN halal monitoring & certification"]
            P3["Falah Mobile — Islamic lifestyle app (Next.js)"]
            P4["Islamic Finance Education — Courses, newsletter, content"]
            P5["FLH Token Wallet — Falah utility token (in development)"]
            P6["Falah Souq — Halal marketplace (in development)"]
        end

        subgraph CHANNELS["Channels"]
            C1["ummah.falahos.my — Community portal (WordPress)"]
            C2["my.falahos.my — Monetisation subdomain"]
            C3["falahos.my — Mobile app frontend (Next.js)"]
            C4["Telegram — @FalahOS_opsbot (DM + Ops Chat)"]
            C5["WhatsApp — +6013-225 0691 (Baileys bridge)"]
            C6["git.falahos.my — Gitea (source control + wiki)"]
            C7["GitHub (maifors) — Public mirror + faraid-sandbox"]
        end

        subgraph REVENUE["Revenue"]
            R1["EDD — Digital product sales (RM0RM299)"]
            R2["PayPal Standard (wanjauhari@me.com)"]
            R3["MemberPress — Paid memberships"]
            R4["Tutor LMS — Course fees"]
            R5["MailPoet — Newsletter subscribers"]
        end
    end

    %% ═══════════════════════════════════════════════════
    %% L2 — DATA ARCHITECTURE
    %% ═══════════════════════════════════════════════════
    subgraph DATA["L2 — Data Architecture"]

        DB1[("PostgreSQL 16 (Swarm) — Main app database\nfalah-mobile, Casdoor, services")]
        DB2[("PostgreSQL (Synology) — Casdoor DB, Mattermost DB\nHalal Monitor PostGIS, Umbrel stack DBs")]
        DB3[("MySQL (cPanel) — WordPress DB\nposts, users, orders, members, courses")]
        DB4[("Redis 7 (Swarm + Synology) — Cache layer\nsessions, queues, real-time")]
        DB5[("Garage S3 (Synology) — Object storage\nfiles, backups, assets")]
        DB6[("Memcached (Synology) — Distributed cache")]
        DB7[("Meilisearch (Synology) — Full-text search (Karakeep)")]

        subgraph CONTENT["Content Library"]
            CT1["AI-generated blog posts (12 SEO)"]
            CT2["EDD products (7 descriptions)"]
            CT3["MailPoet sequences (10 emails)"]
            CT4["Lead magnet — Islamic Finance Starter Guide"]
            CT5["Faraid whitepapers (ASSJ, v2, 8-paper synthesis)"]
            CT6["Newsletter editions (Falah Letter)"]
        end

        subgraph CODE["Code & Config"]
            GC1["Gitea repos: falah-os-master, falah-mobile, war-room, cpanel-db-backups, falahmobile-content, hermes-cpanel-agent"]
            GC2["GitHub repos: faraid-sandbox, falah-umbrel, falah-extension, falah-os-sdk, falah-mobile-staging"]
            GC3["Agent states: Hermes memory + sessions, OpenClaw config, Odysseus state"]
            GC4["Stack files: /opt/falah-os/swarm/ (falah-stack.yml, gitea-stack.yml)"]
        end
    end

    %% ═══════════════════════════════════════════════════
    %% L3 — APPLICATION ARCHITECTURE
    %% ═══════════════════════════════════════════════════
    subgraph APP["L3 — Application Architecture"]
        direction TB

        subgraph SWARM_SERVICES["Docker Swarm Services (Synology Mgr + Contabo Worker)"]
            S1["Traefik v2 — Reverse proxy, TLS termination"]
            S2["Gitea 1.26 — git.falahos.my (:3080)"]
            S3["Casdoor — auth.falahos.my (Identity Provider)"]
            S4["falah-mobile — Next.js (falahos.my)"]
            S5["falah-mobile-staging — Staging environment"]
            S6["PostgreSQL 16 — Main app DB"]
            S7["Redis 7 — Cache layer"]
        end

        subgraph SYNO_STANDALONE["Synology Standalone Containers"]
            SY1["Falah Umbrel: wallet, app, ramz, ummahid, istore, mocknet, carbon, faraid, halal, redis, api-gateway, postgres"]
            SY2["Halal Monitor: postgrest + postgis gateway"]
            SY3["Karakeep: bookmarking + meilisearch + chrome"]
            SY4["Mattermost: team chat + db"]
            SY5["Gitea Runners x3: CI/CD execution"]
            SY6["Falah services: desktop, backend, UI, tunnel, auto-healer, dns-healer"]
            SY7["Garage S3: Object storage"]
            SY8["Portainer / Dockge x2 / Watchtower / Linkstack / Affine / iStore / Identity-layer"]
            SY9["Faraid-anvil: Foundry (blockchain dev)"]
        end

        subgraph CPANEL_WP["cPanel / WordPress"]
            WP1["WordPress — ummah.falahos.my"]
            WP2["WordPress — my.falahos.my"]
            WPP["Plugins: EDD, MailPoet, bbPress, GamiPress, Tutor LMS\nfalah-wallet, falah-souq, nur-ai-coach, islamic-tools"]
        end

        subgraph AGENTS["AI Agents"]
            A1["Hermes Agent (Contabo) — Orchestrator / skills / tools / MCP / cron"]
            A2["Odysseus (Mac Mini :7860) — API gateway, AI chat, email, docs, research"]
            A3["Pi (Mac Mini :4747) — AI assistant"]
            A4["OpenHand (Mac Mini :3000) — Autonomous coding agent"]
            A5["OpenClaw (Mac Mini :3100) — Model provider proxy"]
            A6["Claude Code (Mac Mini CLI) — Coding assistant"]
            A7["openclaw (MBA :18789) — MCP gateway, WhatsApp routing"]
            A8["Hermes MBA — Fallback agent + cron scheduler"]
        end

        subgraph INFRA_APPS["Infrastructure"]
            I1["FalahOS Relay (Contabo :8088) — Telegram message bus"]
            I2["Cloudflare — DNS / WAF / CDN / tunnel"]
            I3["Traefik — Internal routing + TLS"]
            I4["falah-auto-healer — Hourly health recovery"]
            I5["falah-dns-healer — DNS recovery script"]
            I6["Komodo — GitOps deployment manager"]
            I7["MCP Servers — UI/UX Tester, Browser tools"]
        end
    end

    %% ═══════════════════════════════════════════════════
    %% L4 — TECHNOLOGY ARCHITECTURE
    %% ═══════════════════════════════════════════════════
    subgraph TECH["L4 — Technology Architecture"]
        direction TB

        subgraph NODES["Physical / Virtual Nodes"]
            N1["Synology DS3617xs — DSM 6.2.3\n8GB RAM, 4x volumes (890G+443G+855G)\nTailscale 100.126.73.29"]
            N2["Contabo VPS — Ubuntu 24.04\n6 vCPU / 16GB / 400GB SSD\nPublic: 13.140.161.244"]
            N3["RoketServer cPanel — Shared hosting\n64.20.37.43, Imunify360"]
            N4["Mac Mini — macOS 12.7.6\n8GB RAM\nTailscale 100.72.2.115"]
            N5["MacBook Air — macOS\nTailscale 100.76.3.26"]
        end

        subgraph NETWORK["Network"]
            NW1["Tailscale Mesh VPN — 100.x.x.x range (all nodes)"]
            NW2["Cloudflare — DNS proxy + WAF + CDN"]
            NW3["Docker Swarm Overlay — Synology ↔ Contabo"]
            NW4["SSH Tunnel — Contabo :17860 ↔ Mac Mini :7860"]
            NW5["Imunify360 — cPanel security (blocks datacenter IPs)"]
            NW6["Traefik v2 — Internal service routing"]
        end

        subgraph RUNTIME["Runtime / Software Stack"]
            RT1["Docker (Synology) — Swarm manager + standalone containers"]
            RT2["Docker (Contabo) — Swarm worker node"]
            RT3["Python 3.11 / Node.js 22 / PHP 8.x / Nginx"]
            RT4["PostgreSQL 16 / MySQL 8 / Redis 7"]
            RT5["Solidity + Foundry (Faraid blockchain)"]
            RT6["Hermes CLI + Gateway / OpenClaw / OpenHand CLI"]
        end

        subgraph CI_CD["CI / CD Pipeline"]
            CI1["Gitea Actions — 3x act_runner (Synology)"]
            CI2["Komodo — GitOps stack deploys (webhook → Docker Swarm)"]
            CI3["cPanel Git — WordPress deployment via Git API"]
            CI4["Auto-healer — Hourly health recovery cron"]
            CI5["Daily agent crons — Wiki sync, board sync, health checks"]
        end
    end

    %% ═══════════════════════════════════════════════════
    %% CROSS-LAYER CONNECTIONS
    %% ═══════════════════════════════════════════════════

    %% Business → Data
    P1 -.->|"data in"| GC1
    R1 -.->|"feeds"| DB3
    C4 -.->|"messages"| A1

    %% Data → Application
    DB1 -.->|"persists"| S4
    DB3 -.->|"persists"| WP1
    GC2 -.->|"CI/CD"| CI1

    %% Application → Technology
    S1 -.->|"runs on"| N1
    S2 -.->|"runs on"| N1
    A1 -.->|"runs on"| N2
    A2 -.->|"runs on"| N4
    A7 -.->|"runs on"| N5
    WP1 -.->|"runs on"| N3

    CI1 -.->|"executes on"| N1
    NW1 -.->|"connects"| N2
    NW1 -.->|"connects"| N4
    NW1 -.->|"connects"| N5
    NW1 -.->|"connects"| N1

    %% Assign classes
    class P1,P2,P3,P4,P5,P6 product
    class R1,R2,R3,R4,R5 business
    class C1,C2,C3,C4,C5,C6,C7 business
    class DB1,DB2,DB3,DB4,DB5,DB6,DB7 data
    class S1,S2,S3,S4,S5,S6,S7 app
    class SY1,SY2,SY3,SY4,SY5,SY6,SY7,SY8,SY9 app
    class WP1,WP2,WPP app
    class A1,A2,A3,A4,A5,A6,A7,A8 app
    class I1,I2,I3,I4,I5,I6,I7 app
    class N1,N2,N3,N4,N5 tech
    class NW1,NW2,NW3,NW4,NW5,NW6 tech
    class RT1,RT2,RT3,RT4,RT5,RT6 tech
    class CI1,CI2,CI3,CI4,CI5 tech
    class VISION,MISSION business

Layer-by-Layer Breakdown

🏢 L1 — Business Architecture

Strategy, governance, products, and revenue.

Area Details
Vision Shariah-compliant digital economy platform (Falah OS v1.3)
Products Faraid Tokenisation, Halal Certification, Falah Mobile, Islamic finance education, FLH Wallet, Falah Souq
Channels ummah.falahos.my (WordPress), falahos.my (Next.js), Telegram, WhatsApp, Gitea, GitHub
Revenue EDD digital products + PayPal Standard + MemberPress + Tutor LMS courses + MailPoet newsletter
Audience Muslim professionals seeking Islamic finance, halal, inheritance solutions

🗄️ L2 — Data Architecture

How data is stored, managed, and flows.

Data Store Type Host Purpose
PostgreSQL 16 Relational Swarm (Synology) App DB, Casdoor, Mattermost, Umbrel stack
PostgreSQL 16 Relational Swarm (Synology) Casdoor auth DB, Halal Monitor PostGIS
MySQL 8 Relational cPanel (RoketServer) WordPress (posts, users, orders, courses)
Redis 7 Cache Swarm + Synology Session cache, queues, real-time
Garage S3 Object Synology File storage, backups, assets
Meilisearch Search Synology Full-text (Karakeep)
Gitea Git Swarm (Synology) Source code, wiki, CI/CD artifacts
GitHub Git External Public mirror, faraid-sandbox

📱 L3 — Application Architecture

All applications, agents, and services.

Category Components Location
Swarm Services Traefik, Gitea, Casdoor, falah-mobile, staging, PostgreSQL, Redis Synology (mgr) + Contabo (worker)
Synology Standalone Umbrel stack (9 containers), Halal Monitor (3), Karakeep (3), Mattermost (2), Gitea Runners (3), Garage S3, Portainer, Dockge (2), Watchtower, Falah services (7), Linkstack, Affine, iStore, Identity-layer, Auth, Faraid-anvil Synology NAS
WordPress ummah.falahos.my + my.falahos.my — EDD, MailPoet, bbPress, GamiPress, Tutor LMS, falah-wallet, falah-souq, nur-ai-coach, islamic-tools cPanel (RoketServer)
AI Agents Hermes (Contabo), Odysseus (Mac Mini :7860), Pi (:4747), OpenHand (:3000), OpenClaw (:3100), Claude Code, openclaw MCP (MBA :18789) Contabo / Mac Mini / MBA
Infrastructure FalahOS Relay, Cloudflare, Traefik, auto-healer, dns-healer, Komodo, MCP servers Various

⚙️ L4 — Technology Architecture

Hardware, network, runtime, and CI/CD.

Node Spec Role
Synology DS3617xs DSM 6.2.3, 8GB RAM, 4 volumes (2.6TB total), Tailscale 100.126.73.29 Swarm Manager — runs ALL production containers
Contabo VPS Ubuntu 24.04, 6 vCPU / 16GB / 400GB SSD, 13.140.161.244 Swarm Worker + Edge node / Hermes
RoketServer cPanel Shared hosting, Imunify360, 64.20.37.43 WordPress host
Mac Mini macOS 12.7.6, 8GB RAM, 100.72.2.115 Agent host (Odysseus, Pi, OpenHand, OpenClaw, Claude)
MacBook Air macOS, 100.76.3.26 Agent host (openclaw MCP, hermes cron, pi, opencode)
Network Details
Tailscale Mesh All nodes connected via mesh VPN (100.x.x.x range)
Docker Swarm Overlay Synology (manager) ↔ Contabo (worker)
Cloudflare DNS proxied, WAF, CDN, cloudflared tunnels
SSH Tunnel Contabo :17860 → Mac Mini :7860 (ComfyUI)
CI/CD Details
Gitea Actions 3x act_runner on Synology — runs CI/CD pipelines
Komodo GitOps deployment manager (webhook → Docker Swarm deploy)
cPanel Git WordPress deployment via Git API
Auto-healer Hourly health check + auto-recovery on Contabo
Agent crons Daily 9am: wiki compile, board sync, comprehensive health checks

Architecture Principles

# Principle Rationale
1 Synology is core Docker Swarm manager + 40+ containers — single point of infrastructure
2 Hybrid orchestration Swarm for production services, standalone for specialised containers
3 Tailscale mesh Zero exposed ports — all inter-node traffic via encrypted mesh VPN
4 Agent-driven ops AI agents handle CI/CD, health monitoring, content, wiki sync autonomously
5 Defence in depth Cloudflare WAF → Imunify360 → Traefik → Tailscale ACLs
6 Multi-agent fleet 8+ specialised agents (Hermes, Odysseus, Pi, OpenHand, OpenClaw, Claude) each with defined role
7 Progressive monetisation Free content → Lead magnet → Digital products → Memberships → Courses

📐 Excalidraw Diagram

An interactive hand-drawn version of this TOGAF architecture is available as an Excalidraw file:

📄 Download: FalahOS-TOGAF-Architecture.excalidraw (interactive, drag-and-drop onto excalidraw.com)
🖼️ View inline: FalahOS-TOGAF-Architecture.svg (rendered SVG, dark theme)