Hosted by Three Crickets

Diligence
Web Framework
For Prudence and MongoDB

Diligence logo: sleeping monkey

Diligence

Diligence is a collection of ready-to-use code to help you tackle much of the dreary work required for building massively multi-user web applications. It relies on and fully embraces Prudence and MongoDB, two platforms designed from the ground-up for REST-friendly scalability. With Diligence you can quickly get users logging in, accessing data based on permissions, subscribing to email notifications, shopping and paying you, interacting with each other, and managing their own content on your site. It lets you cleanly integrate with third party technologies and services, from Ext JS and Sencha Touch to Facebook.

Download button

Dive In

Diligence's design principles are minimalism (no dependencies beyond Prudence and MongoDB) and hackability. With JavaScript on the server, in the database and on the client, you never have to switch programming paradigms, and can even share code among platforms.

Though an effort has been made for the code to be immediately usable, you are encouraged to mix, match, cut, paste and otherwise make Diligence work best for you. This is especially easy due to JavaScript's dynamism and closures on the one hand, and MongoDB's ability to accept any JavaScript-compatible data structure on the other.

The developers are battle-tested web developers and admins tired of bloated "automagical" frameworks, which seem to do a lot out of the box but are very difficult to hack, and can't scale well without heavy ... well, hacking. Diligence is ready both for massive scale and for your butcher knife. Go at it!

Don't forget to check out MongoVision, a Prudence-based MongoDB admin tool that can make your Diligence experience even tastier.

Drop-In Features

High-level features ready to drop into any web application.

  • Blog: compose documents from the Documents Service into a blog, syndicate via the Syndication Service to RSS/ATOM, embed comments using the Discussion Feature, plus Trackback support (about)
  • Console: execute server-side code, watch logs, and save programs for later... on the web -- how have you survived this far without this awesome debugging tool? (about)
  • Contact Us: let users ask questions, report bugs, etc. (CAPTCHA-protected for anonymous users) (about)
  • Discussion: manage complete forums, or just attach threaded comments to blogs, wikis, etc. (about)
  • Registration: let users create logins for themselves, with CAPTCHA and expirable email-based confirmation (about)
  • SEO: keep search engines happy via robust sitemap.xml and robots.txt generation, with support for very large sitemaps divided into many compressed files (about)
  • Shopping Cart: let users save lists of items, manipulate them, and eventually check out with PayPal or Google Checkout (todo)
  • Wiki: compose documents from the Documents Service with full-page HTML templates editable according to fine-grained permissions from the Authorization Service, and embed comments using the Discussion Feature (about)

Application Services

The bread and butter of any web application.

  • Assets: use client-side caching to the max by automatically changing assets URLs when their file contents change (about)
  • Authentication: user logins with random salt password encryption, plus support for external authentication via Facebook, Windows Live, Twitter and OpenID (the latter tested with Google, Yahoo, Myspace and LiveJournal) (about)
  • Authorization: fine-grained, cascading, inheritable, cached permissions by user and group (about)
  • Backup: high-performance, multithreaded, flexible backup of your MongoDB data (about)
  • Cache: general-purpose expirable MongoDB-backed caches, with support for function decorators to cache any return value (about)
  • Documents: editable markup-rendered HTML documents with site-wide revision control; useful building blocks for wikis, blogs, CMS, etc. (about)
  • Events: synchronous, asynchronous and distributed event system (about)
  • Internationalization: use cached, localized, inheritable text packs from MongoDB or file; native support for right-to-left languages (about)
  • Linkback: a clean implementation of Trackback and Pingback, useful for blogs and wikis (about)
  • Nonces: expirable number-used-once generator (about)
  • Notification: massive-scale subscription and broadcasting, with support for digests; pluggable delivery services (email, MongoDB-based inboxes, IM, SMS, etc.); integrates with Authentication Service to use each user's personal perferences (about)
  • Progress: keeps track of asynchronous processes; milestones along the way to process completion; useful for anything that would require the user to "please wait" or come back later (searches, interaction with external services, mail delivery tracking, forum moderation, etc.) (about)
  • RPC: lets you export plain-old JavaScript functions via XML-RPC and JSON-RPC (about)
  • REST: flexible RESTful resource routing over Prudence's strong foundation, with support for innovative Document-Resource Mapping (DRM, not ORM!) to automatically attach a collection of MongoDB documents or sub-documents to a URI-space (about)
  • Search: uses Lucene to cleanly integrate textual search into your applications (about)
  • Serials: unique serial integer generator (about)
  • Syndication: produce Atom/RSS feeds (about)

Integrations

Web Services

Clean-room implementations written in 100% JavaScript over the standard Prudence API with no external dependencies.

Client Frameworks

Client-side JavaScript meets server-side JavaScript meets db-side JavaScript in a sexy ménage à trois.

  • Ext JS and Sencha Touch: back Ext JS grid (about), tree (about) and chart (about) widgets directly from MongoDB, with support for all REST operations, paging and metadata; implicit support of MongoDB's extended JSON notation; AJAX forms (about); clean, intuitive support for Ext Direct (about)
  • Highcharts: backend support for Highcharts exporting module (downloading and printing, rasters and PDFs)

Foundation Libraries

Until now, Rhino lacked a standard library. Now has arrived.

  • Calendar: safe operations and arithmetic
  • Cryptography: encryption, decryption, hashing
  • Files: includes fast memory-mapped files, grep, tail in any encoding
  • Iterators: generic iterators for large series of entries, compatible with MongoDB cursors (about)
  • JSON: fast, robust conversion to and from JSON with support for MongoDB's extended JSON notations and human-readable, nicely indented JSON; written in 100% Java to work directly with Rhino's native types for best performance (using MongoDB Rhino)
  • JVM: convert between JavaScript and JVM data types
  • Localization: format and parse dates, times and currency
  • Lucene: high-performance indexing and searching of textual data, with support for search term highlighting (using Lucene) (about)
  • Mail: send SMTP mail, with support for mixed media messages and message templates (using JavaMail)
  • MongoDB: fast, extra robust MongoDB driver that uses JavaScript data types directly, with native support for MongoDB's extended JSON notations (using MongoDB Rhino and MongoDB Java driver)
  • Objects: lots of useful manipulations of JavaScript objects, arrays and strings
  • Rhino: filling in some platform gaps, such as getting the current stack trace
  • SVG: render SVG into PNG, JPEG or PDF (using Batik)
  • Templates: powerful and flexible string interpolation (about)
  • Validation: server- and client-side, with the same code!
  • XML: parse, generate, prettify and build using a flexible extended JSON notation that can be stored as-is in MongoDB

HTML Galore

  • HTML Builder: use a flexible extended JSON notation that can be stored as-is in MongoDB; integrated with the Internationalization Service, including smart support for right-to-left languages
  • HTML Markup: extensible rendering of Textile, Confluence, MediaWiki, Trac, TWiki and Markdown markup into HTML (using Mylyn WikiText and pegdown) (about)
  • HTML Parsing: parse and query HTML on the server with a jQuery-like language (using jsoup)

Prudence Sugar

  • Blocks: enhance Prudence's HTML templates (about)
  • Lazy: lazy, thread-safe construction of global services via a straightforward DSL (about)
  • Logging: adds templating and lots of shortcuts to Prudence's logging API (about)
  • Resources: powerful wrapper over Prudence's REST client, supports JSON, XML, web-forms, property sheets, and unserialized object passing for internal access (about); includes a single API for HTML and AJAX forms, integrated with the validation library (about)
  • Tasks: a single API to start asynchronous Prudence tasks, whether in-process or distributed in the Prudence cluster (about)