Read the statement by Michael Teeuw here.
How to develop modules
-
I am aware of python core, nodejs and javascript. I am running magic mirror with the available third party apps at the magic mirror repository. Now I want to develop some other modules, so what are the other programming languages I need to know to develop magic mirror modules? Can someone please post a tutorial about how to develop the modules?
-
- https://github.com/MichMich/MagicMirror/blob/master/modules/README.md
- https://github.com/MichMich/MagicMirror/wiki/3rd-party-modules
You’d better start from modifying any simple 3rd-party-modules.
-
I’d second that.
For a quick overview:
The DOM (all visible elements) is based on
HTML
, styled withCSS
and usually filled with content and function byJava Script
. That’s all you need for basic modules.If you go further, you’ll need
Python
in case you have something connected to the Pi andnodeJS
for advanced modules with some backend code, like API calls, though some nodeJS knowledge will help you a lot to understand the whole structure in the first place.jQuery
can be a helpful Java Script library.
API calls usually deliverJSON
or – rarely –XML
, but both should be familiar if you know JS objects and arrays and HTML.As Sean said, playing around and manipulating existing modules should help you a lot. Go through the code, see if you understand the connections and find out what happens if you manipulate it.
Your most important tool when working in js-files is the browser console where you can print to with the
js codeMM codeconsole.log("show me the content of var x: " + x);
Log.info("show me the content of var x: " + x);
-
-
I wrote this 8 months ago and it may help someone. It’s meant to be used as a learning tool for beginner module creators.