A micro framework for modern web apps built from the ground up on the shelf framework

Build Status Pub Version


A micro framework for modern web apps built from the ground up on the Shelf Framework.

Mojito is deliberately a very thin layer over several shelf packages and focuses on the overall experience of building an application.

The focus of Mojito is on modern rich web apps that have a clean separation of ui from services. As such it doesn't bundle any server side templating packages although these can be easily added.

The core architecture of Mojito is shelf itself. All components are existing pub packages that are built from the ground up as shelf components. This makes it super easy to take advantage of any new shelf based packages that come along in the future


Import and initialise

 import 'package:mojito/mojito.dart';
 final app = mojito.init();

Set up some global authentication. These will be applied to all routes.


Set up a proxy to pub serve to serve your ui in dev.


Set up a route and get the authenticated users name from the context. Note: Mojito makes the logged in user available in the current zone.

app.router..get('/hi', () {
  var auth = app.context.auth;
  var username = auth.map((authContext) =>
      .getOrElse(() => 'guest');

  return 'hello $username';

Start serving the app


Under the hood

Mojito bundles lots of existing shelf libraries and integrates them for easier use. These include:

More doco to come...