A tiny, yet powerful (and beautiful) framework for JS applications


Meet Ladybug.js

Create awesome apps in minutes


Routing

Implement Single Page Apps (SPAs) easily with the built-in hash-based router

Modular

Create modules by extending the base module class and keep your app logic in order

Facebook integration

Build Facebook apps in just minutes with the optional, integrated Facebook support

Templates

Full template support thanks to Underscore.js

API-Ready

Connect easily with your existing Dragonfly APIs thanks to the built-in functionality

Free and open source

Being MIT-licensed and completely open source, you can help us to make it even more awesome!

With an easy set-up

Include Ladybug in your project

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/underscore.min.js"></script>
<script type="text/javascript" src="js/ladybug.min.js"></script>

Add your markup with some sweet templates

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Ladybug Demo</title>
  </head>
  <body>
    <!-- Base markup -->
    <section>
      <div class="container">
        <div id="client">
          <!--  -->
        </div>
      </div>
    </section>
    <!-- Templates -->
    <script type="text/template" id="page-home">
      <h1>Hello World!</h1>
    </script>
  </body>
</html>

Create your application object

AppSample = Ladybug.Application.extend({
  init: function(options) {
    var obj = this;
    // Call parent's constructor
    obj._super(options);
  },
  onDomReady: function() {
    var obj = this;
    // Start the router
    obj.router.start();
  }
});

Create a basic module

ModuleHome = Ladybug.Module.extend({
  init: function(options) {
    var obj = this;
    // Call parent's constructor
    obj._super(options);
  },
  onDomReady: function(params) {
    // Bind events and stuff
  },
  onRender: function(params) {
    var obj = this;
    app.element.html( obj.templates.page() );
  },
  onPrepareTemplates: function(params) {
    var obj = this;
    obj.templates.page = Ladybug.Utils.compileTemplate('#page-home');
  }
});

Crank it up

var app;
app = new AppSample({
  element: '#client'
});
app.registerModule('home', new ModuleHome);

And that's it. You now have a running Ladybug.js App!

Getting started

To get started, download the zip file.

Once you have it extract the files, configure your instance and you'll be ready to create amazing things.

Download now View documentation

Contributing

If you want to help, simply fork the repo.

Add your awesome features or fix those pesky bugs and create a pull-request.

We'll review your changes and do our best to include them in the next release.

Troubleshooting

If you find something that is not working as it should, open an issue and we'll try to fix it as soon as possible.

Please include as much info as possible.

View in GitHub