Lym is a manager for static frontend modules. It uses HandleBars for markup, Sass for style and RequireJS to load Javascript. It supports module self-configuration so you can use one without having to look in its code.

Try it

This site is built with Lym - you can build it locally to see how it works.

  1. Install lym with npm install -g lym (requires NodeJs and Git)
  2. Clone the source code from github
  3. Open a console in the root of your cloned project.
  4. Run npm install
  5. Run node setup to fetch the frontend modules for the site
  6. Run lym build to compile the site.
  7. Serve the contents of /dev with your webserver of choice

More detailed instructions are on Github.

Project structure

  • The modules to build this site are placed in /dev/__components.
  • Modules named gloo-* are reusable, and each is available via Github, for example gloo-imageOverlay.
  • The modules named site-gloo-* live in this project only, and most customize corresponding gloo-* modules. You can organize your modules any way you want though.

Why static?

Not all sites need to be "dynamic" - sometimes static is more than adequate to get the job done. Static is perfect for smaller sites that don't feed off a live database backend. It's also perfect for creating prototypes, and for managing templated HTML which could be passed on to a dynamic system like a CMS.

Why modular?

Resusing frontend code has always been tricky because of the difficulty defining the boundaries of what to share. There are several methods out there, Lym takes a fairly simple approach by forcing you to nest everything your module is, under a single folder, including how to fetch and build it. It supports intermodule dependency, Git-as-storage, semantic versioning, and automation.

Why these frameworks?

Lym uses Handlebars, Sass and RequireJS because sometimes you need specifics to get something done. Lym could have used other frameworks, or could have tried to support every framework, but then it would probably never have been finished.