这是indexloc提供的服务,不要输入任何密码
Skip to content

VamsiVempati/odo

 
 

Repository files navigation

Odo - whatever you want it to be

A Nodejs framework for creating awesome things.

Status and current work on Trello

Goals

  1. Easy to install, use, modify, adapt and refactor
  2. Modular and lightweight components that are useful independently
  3. Strong cohesion where things change at the same rate, loose coupling where things change at a different rate
  4. Few concepts needed in any one area of the code to keep mental effort of development low

Techniques

Get started

Fork odo example

Overview

There are two types of code in Odo: infrastructure and plugins.

Infrastructure

Tools, frameworks and techniques make up the odo infrastructure. Using existing 3rd party frameworks and libraries is prioritised over custom development. Where existing frameworks are not available small independent utilities have been written.

The goal of any infrastructure code is to accomplish one goal, do it well and have few touch points with any other code.

Plugins

Plugins are independent features of the application loosely coupled to other plugins to make up the whole application. Usually plugins communicate through a combination of dependency injection and events.

Backend plugins can run in three contexts: web, domain and projection. This technique allows the web code, database logic, and validation rules for a particular piece of information to exist in the same codebase but run in three different contexts. Having all aspects in the same codebase increases speed of development and still provides good decoupling between concepts.

Frontend plugins are registered by backend code. They have the ability to register themselves against several hooks - most importantly single page application routes through durandal.

Backend infrastructure

Require.js

All of odo uses require.js to pull together plugins and components. In the backend node.js's require function is passed into require to include npm modules.

Express

The root component to requirejs into your web application to setup an express website. Web plugins are given an opportunity to register against different parts of express to define routes and extend the express system.

Config

A component to requirejs into your code to access the top level configuration json file. Use that file to store environment specific settings and other pieces of information you don't want in source control.

Eventstore

A component to requirejs into your application to setup and connect to an eventstore. Exposes an extend method to add methods and properties to an aggregate object to support event sourcing and the CQRS pattern. Uses the eventstore library.

Hub

A component to requirejs into your application to create a CQRS hub that is connected to redis. Bind event listers through the exported receive method and bind command handlers through the exported handle method. Use send and publish to send commands and publish events.

Plugin

A component to help load other plugins. Provides web, domain and projection methods that call the same named method on an array of plugins passed to it's constructor.

Backend plugins

Messaging

Provides a sendcommand endpoint to make it easy to create commands from the web.

Bower

An express plugin to host the /bower_components directory so anything you've installed with bower is available to the web. Also provides the inject library to the front end for UI composition.

Durandal

An express plugin to host the contents of /odo/durandal/public to the web so the custom durandal components can be used by your odo durandal application. This includes dialogs, wizards and many extensions to the durandal system.

Passport authentication - local, google, facebook and twitter

An express plugin that provides urls and methods to authenticate a user with passport and passport plugins. Custom local, twitter, facebook and google passport plugins have been provided.

Technologies

Developed alongside Odo

Back end

Front end

About

Nodejs and durandaljs framework.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CoffeeScript 95.3%
  • CSS 4.7%