Coming from React or Vue and nothing makes sense? Read Mental model first: five minutes on where computed, watch, lifecycle hooks and data loading went.This page takes you from an empty folder to a running, reactive $mol app. It should take about fifteen minutes. Every snippet below is real, working code — copy it as-is.You will write the component in plain TypeScript. $mol also has a shorter format for describing components, view.tree, and you will meet it on the next page. Nothing here needs it: a $mol component is an ordinary class either way.
Node.js 18+ and git. That is the whole list.You do not install a global CLI or generate boilerplate you have to understand later. $mol apps live inside the MAM workspace, which already knows how to build and serve them.
MAM is the build tool and module registry for $mol. Clone it and install once:1gitclonehttps://github.com/hyoo-ru/mam.git./mam2cdmam3npminstall4npmstartnpmstart launches the dev server on http://localhost:9080/. It watches your files and rebuilds automatically — leave it running in its own terminal.
A $mol app is just a folder. Pick a namespace (yours, e.g. my) and a name (hello):1mkdir-pmy/helloOne rule to remember: underscores in a component name are folder separators. $my_hello lives in my/hello/, $my_hello_form would live in my/hello/form/. Module folder names never contain an underscore.Now add two files inside my/hello/.
1<!doctype html>2<htmlmol_view_root>3<head>4<metacharset="utf-8"/>5<metaname="viewport"content="width=device-width, initial-scale=1"/>6</head>7<bodymol_view_root>8<divmol_view_root="$my_hello"></div>9<scriptsrc="web.js"></script>10</body>11</html>The mol_view_root="$my_hello" attribute mounts your component when the page loads.