MagicMirror² v2.8.0 is available! For more information about this release, check out this topic.

I need an explanation of how the magic mirror system works



  • hi, I am writing about magic mirrors, and I need to explain how the system flow of the magic mirror works? what is the platform? the database? how to exchange data from requests to appear on the user interface? can anyone help me?



  • @aljosie sure… MM is what is called a Single Page Web application. it operates just like any other web page…
    https://en.wikipedia.org/wiki/Single-page_application

    javascript, html, etc…

    Now, Mitch has done an outstanding job of designing the structure so that multiple pieces of code (modules) can be added in a structured way…

    a module has two parts…

    1. the web UI part (created web content to be injected into the web page)
    2. the integration part (connects to everything NOT UI to get/set data for the web component

    the two parts run inside the browser web page, and talk to each other via a socket connection.

    he also designed a methodology for modules to communicate with each other. Notifications

    Node and Angular are the dynamic runtime of the application, providing mechanisms to allow for long running tasks (get some api content which may take seconds) to not hang up the rest of the system

    there is no database … everything is configured in flat files…

    the web UI component of the module gets called to get its content contribution to the web page at its getDom() method…

    Mitch designed in multiple ‘areas’ of the web page… and u must target your modules content to one of those…
    top, bottom, left, right. center and more. thus you have some starting control over where your content goes.

    if u comment out all the modules, the page will be blank



  • @sdetweil thank you bro…



  • @sdetweil no database there? thats mean magic mirror as server and client too?



  • @aljosie correct… all in one…

    you can also access the server from a remote system using the same web url address (if permitted)

    some MM implementations also have a single use mode… server only (no ui locally) or client only (no server, just access server).

    MM has all of that



  • @sdetweil can u give me link of module for turn on/off light with this smart mirror



  • @aljosie sorry… missed ‘this mirror’

    again, using what technology

    PIR (Pi Infrared sensor), camera, voice, ?
    does your monitor support electronic on/off. (mine dont)

    but did u mean room lights? again, these need to be electronically controlled…
    what technology? hue, insteon, wifi (lots of different apis there)



  • @sdetweil i’m wanna control light room (turn on/off) with voice comand and i want the comand show on the magic mirror interface, can help me?



  • This post is deleted!


  • @sdetweil and i want only my voice can execute the comand, and i’m using the beardboard, light indicator and relay for this project, so this project just like for home automation system controlling the light room with voice.