---
# System prepended metadata

title: mPOS & NewPOS / Architecture diagram
tags: [' mPOS', NewPOS]

---

---
tags: NewPOS, mPOS
---

# mPOS & NewPOS / Architecture diagram

New (With Dock)

```plantuml
@startuml d2
skinparam rectangle {
    ' BorderColor Blue
    BorderColor<<New POS>> blue
    BorderThickness<<New POS>> 4
    RoundCorner<<New POS>> 4
}
frame TK {
    
    
    ' circle " " as fromMposPWA
    
    
    rectangle HQ as hq {
        circle " " as toExternalAPI
        circle " " as toAD
        circle " " as toMPosPWAServer
        circle " " as toNewPOSPWAServer
        circle " " as toIDCMQTTBroker
        
        rectangle IT{
          'node "mPOS API" as 
          node "mPOS API (97)" as rpi_dev_api_broker
          
        }
        
        node "IDC" as idc {
            component "mPOS PWA\nServer" as mpos_pwa_server
            component "New POS PWA\nServer" as newpos_pwa_server
            component "MQTT Broker" as idc_mqtt_broker
        }
        
        'rpi_dev_api_broker .. idc_mqtt_broker
        ' node "Dev Server\nrpi:10.1.62.97" as 97 {
        '     component "MQTT Broker" as 97_mqtt_broker   
        ' }

        node "TKAPI" as tkapi
        node "Wish API" as wishapi
        node "Payment \nRouter" as pr
        node "AD\n(NTP)" as ad

        idc_mqtt_broker ~~ rpi_dev_api_broker

        mpos_pwa_server <-- toMPosPWAServer
        newpos_pwa_server <-- toNewPOSPWAServer

        pr <-- toExternalAPI
        tkapi <-- toExternalAPI
        wishapi <-- toExternalAPI
        ad <-- toAD
        idc_mqtt_broker ~~ toIDCMQTTBroker
    }

    rectangle "Store" as store {
        
        rectangle "New POS" as newpos<<New POS>>{
            'node "New POS client\n(iPad)" as newpos_ipad {
            '    component "PWA\nClient" as newpos_pwa_client
            '}
            node "Dock RPi" as rpi_newpos {
                component "MQTT Broker" as rpi_newpos_broker
                
                rectangle "Peripheral Services" {
                    ' component "MQTTChannel" as service_mqtt
                    component "Service Directory" as servicedir
                    component "Printer Service" as printer_service
                    component "EDC Service" as edc_service
                    component "HID Service" as hid_service
                    component "Dock Service" as dock_service
                    
                    servicedir -* dock_service
                    dock_service -- printer_service
                    dock_service -- edc_service
                    dock_service -- hid_service
                    'dock_service -- printer_service
                }
                rpi_newpos_broker ~~ dock_service
                rpi_newpos_broker ~~ servicedir
                ' servicedir -- servicedir_printer
                ' servicedir -- servicedir_dock
                
            }

            node "Receipt Printer" as dock_receipt_printer
            node "Barcode Reader" as codereader
            node "EDC Terminal" as edc
            'newpos_pwa_client ~~ rpi_newpos_broker 
            printer_service --> dock_receipt_printer
            edc_service <--> edc
            hid_service <--> codereader
        }        
        
        node "mPOS/NewPOS client\n(iPad)" as mpos_client {
            component "mPOS PWA\nClient" as mpos_pwa_client
        }

        node "API Server (API RPi)" as rpi_api {
            interface "nginx" as rpi_api_nginx
            component "mPOS API" as rpi_api_apiserver
            component "MQTT Broker" as rpi_api_broker
            component "Printer Service" as rpi_api_printersvc

            rpi_api_nginx -l-> rpi_api_apiserver

            rpi_api_apiserver ~~ rpi_api_broker
            rpi_api_broker ~~ rpi_api_printersvc
        }
        
        node "mPOS Receipt Printer" as mpos_receipt_printer
        database SC as scdb

        circle " " as fromAPIRPi
        circle " " as fromMposAPI
        circle " " as fromMposPWAClient
        'circle " " as fromNewPOSPWAClient
        circle " " as fromAPIMQTTBroker
        fromAPIRPi --- rpi_api    
        fromMposAPI --- rpi_api_apiserver
        fromMposPWAClient -- mpos_pwa_client
        'fromNewPOSPWAClient --- newpos_pwa_client
        fromAPIMQTTBroker ~~~~ rpi_api_broker
        rpi_api_apiserver --> scdb
        ' scdb <-- rpi_api_apiserver
        ' rpi_api_broker ~~~ mpos_pwa_client
        mpos_pwa_client ~~ rpi_api_broker
        mpos_pwa_client ~~~ rpi_newpos_broker 
        rpi_api_broker ~~ rpi_newpos_broker 

        rpi_api_printersvc --> mpos_receipt_printer

        mpos_pwa_client -> rpi_api_nginx
        'newpos_pwa_client -> rpi_api_nginx
        ' mpos_pwa_client --> rpi_api_apiserver
        ' newpos_pwa_client -> rpi_api_apiserver 
    }

    'circle " " as fromPRtoBank
    'fromPRtoBank -- pr

    toExternalAPI -- fromMposAPI
    toAD -- fromAPIRPi

    toMPosPWAServer -- fromMposPWAClient
    'toNewPOSPWAServer -- fromNewPOSPWAClient
    toNewPOSPWAServer -- fromMposPWAClient
    toIDCMQTTBroker ~~ fromAPIMQTTBroker
}

cloud Bank as bank
bank <- mpos_pwa_client
'bank <-- newpos_pwa_client
'fromPRtoBank --> bank

@enduml

```

---
OLD (Only mPOS)
```plantuml

frame TK {


    circle " " as fromMposAPI

    rectangle HQ as hq {
        node "IDC" as idc {
            component "mPOS PWA" as pwa
        }
        node "Payment \nRouter" as pr
        node "TKAPI" as tkapi
        node "Wish API" as wishapi
        node AD as ad
    }

    rectangle "Store" as store {
        node "mPOS Server" as rpi {
            component "mPOS API" as mposapi
            component "MQTT Broker" as broker
            component "Printer Service" as printerService
        }
        node "mPOS PWA" as ipad
        node "mPOS Printer" as printer
        database SC as scdb
    }
    

}
cloud Bank as bank

fromMposAPI --- mposapi  
'mposapi -- fromMposAPI


'fromMposAPI --> pr
'fromMposAPI --> tkapi
'fromMposAPI --> wishapi


pr <-- fromMposAPI
tkapi <-- fromMposAPI
wishapi <-- fromMposAPI
ad <-- rpi
'rpi ---> ad

mposapi -> scdb
'scdb <-- mposapi 

mposapi ~~ broker
broker ~~ printerService
ipad ~~ broker 


printerService --> printer

pwa <-- ipad
'ipad --> pwa
mposapi <-- ipad 

bank <-- ipad
bank <-- pr





```

-----
