System Design

My initial approach was to develop a JEE application with a relational database, a tried and true approach, but for a couple of reasons I’ve switched to using a micro-services approach employing Docker, Node.js, Express, Vue and Mongo as the principle technologies, sometimes referred to as MEVN. The initial system design is a first cut at developing and deploying micro services to handle RFID chip carried by each piece of rolling stock, model railroad inventory of rolling stock and a projects and purchases manager.
System Design
The components of the design are:

  • Micro Controllers using the Message Queuing Telemetry Transport (MQTT) protocol:
    • RFID Controller – processes RFID tags obtained from a RFID reader and then publishes the value
    • Turnout Controller – subscribes to turnout commands then to act on the command to cause the turnout to move. It then publishes the state of the turnout
    • Turnout Panel Controller – subscribes to turnout panel light commands and publishes turnout push button events.
    • IR Controller – (in planning) processes IR sensors and publishes their values
  • MQTT Broker – the MQTT broker, the heart of any publish/subscribe protocol, is responsible for receiving messages, filtering them, posting to designated topics and sending messages to clients subscribing to topics. The subscribers and publishers bridge the MQTT elements with the GUI applications:
    • ISRS – IoT Subscriber RFID Services subscribes to RFID tags and pushes them via a web-socket to the RSRM component
    • ISLS – (in planning) IoT Subscriber Location Services subscribes to topics that provide location information i.e. IR Sensors and RFID sensors
    • ISTS – IoT Subscriber Turnout Services subscribes to turnout switch closures and pushes them via a web-socket to the MRLM component
    • IPTS – IoT Publisher Turnout Services publishes turnout commands to a Turnout Controller
    • ISMS – IoT Subscriber Micro Services subscribes to micro controller startup information
    • ISTC – (in development) IoT Subscriber and Publisher Turnout Panel Controller subscribes to turnout contact messages, turnout command messages, turnout panel push button messages and publishes turnout contact messages and turnout panel light commands.
  • GUI applications that provide users access to RAILS
    • RSRM – the Rolling Stock RFID Manager allows a user to match a RFID value to a rolling stock road name and number
    • MRIM – the Model Railroad Inventory Manager allows a user to create, update and delete model railroad assets, such as rolling stock
    • MPPM – the Model Project and Purchase Manager allows a user to enter information about their projects and purchases
    • MRLM – the Model Railroad Layout Manager allows a user to enter information about their layout and control elements of it
  • Data Micro Services – components that handle data objects
    • MR Data – the document repository, MongoDB, to store complete lists of items such as rolling stock, industries (producers and consumers), track elements,turnouts, projects, purchases, etc.
    • RIDS – Railroad Inventory Data Services provides REST access to railroad inventory documents
    • PPDS – Project and Purchase Data Services provides REST access to model railroad projects and purchases documents
    • RLDS – Railroad Layout Data Services provides REST access to model railroad layout documents
    • MRFM – the Model Railroad File Manager allows the user to upload image files for the use by the MRIM component
    • Images – the file store for the images uploaded by MRFM component and used by the MRIM component