A small framework for structuring large scale Backbone applications
npm install vigorjsThe main goal of Vigorjs is to keep the application modular and separate gui components, data handling, and api communication.
- Class documentation
- Component
- ComponentBase.js
- ComponentView.js
- ComponentViewModel.js
- DataComms
- Subscription.js
- ProducerMapper.js
- ProducerManager.js
- Producer
- Producer.js
- IdProducer.js
- SubscriptionKeys.js
- Repository
- Repository.js
- ServiceRepository.js
- Services
- APIService.js
- EventBus
- EventBus.js
- EventKeys.js
Build lib dev mode with watch:
yarn dev
Run tests:
yarn test
Run tests with coverage:
yarn coverage
Generate documentation:
yarn docco

A simplified description of the responsibilities for each concept is as follows:
- A Component is the gui component presented to the end user in the form of a package containing one or multiple views, view-models, collections etc.
- A Component should be as simple, and easy to reuse. Main focus should be on rendering, handle user interaction etc.
- A Component should be served with data tailored for its needs.
- A Component subscribes to a Producer using a SubscriptionKey
- A Component should be able to live by them selves and be created anywhere within the application (avoid dependencies to other components)
###Producers
Producer.js,
IdProducer.js,
SubscriptionKeys.js
- A Producer is the link between a Component and a Repository
- A Producer is responsible for gathering data and tailor it for one or multiple Components from one or multiple Repositories
- A Producer produces data on only one SubscriptionKey (each producer only does one thing)
- A Producer produce new data on its SubscriptionKey everytime any relevant data changes.
- A Producer subscribes to one or more Repositories to be notified when data changes and then produces new data.
- A Producer subscribes to one or more Repositories to show interest in new data (start services)
- A Producer produces data that matches the format stated by the contract in the SubscriptionKey
- A Producer produces data in JSON format
###Repositories
Repository.js,
ServiceRepository.js
- A Repository is the link between a Producer and a Service
- A Repository is responsible for storing data of a specific type
- A Repository is responsible for triggering events whenever the stored data changes
- A Repository is responsible providing data to one or multiple Producers
###Services
APIService.js
- A Service is the link between one or multiple Repositories and an external API
- A Service requests data from an external API
- A Service is responsible for handling polling of data
- A Service should provide one or multiple Repositories with data by triggering events
###EventBus
EventBus.js,
EventKeys.js
- The EventBus is the communication link between components and other parts of a application
- By using EventKeys a component can send messages through the EventBus
- By using EventKeys a component can subscribe to messages from the EventBus
- Vigorjs is dependent on jQuery, Backbone and Underscore
- Vigorjs source files are written in ES6