websemble
Desktop application MVC framework
it offers the following features:
- Based on web technology. Built on top of Electron
- File system storage service with a REST API
- Web component support
- i18n support with i18next
- View template support with Handlebars
Installation
cd myprojectnpm install websemble
Getting started
First let's create a view to display, the Index view.
mkdir -p frontend/component/view/Index
In the index folder create a Controller.js file and a View.html file. The content should be:
{ this;} moduleexports = IndexController;
Hello World!
Next we will create the App component.
mkdir -p frontend/component/core/App
As with the view component, we have to create a Controller and a View file for the App.
{ this; scope;} moduleexports = AppController;
The resoleveAppReady funtion call lets the other components know that the app has finished initializing. You may want to call this method after assets are loaded, for example.
Next create the app.js file in the root with the following content:
var Websemble = ;var app = ;
Make sure that the value for the main attribute in the package.json configuration file is "app.js".
The last file we need to create is the index.html in the root.
websemble
You will need electron to run your application:
npm install electron-prebuilt
To run your application, just type:
./node_modules/.bin/electron .
Dig deeper
We have developed a very handy tool to generate boiler plate code for your websemble application. Checkout the Yeoman websemble generator.
For information about the motivation and architecture behind websemble, have a look at the project's wiki.
To learn about making desktop applications with html5, head to the Electron website. This is the framework on top of which websemble is built.