LaxarJS helps to create maintainable AngularJS apps by assembling them from small, isolated parts. Think of it as middleware for your web client.
Find out why you would use LaxarJS and if it's the right tool for you. Then, explore the core concepts and browse the manuals in the documentation.
Have a look at the LaxarJS homepage for demos and more information.
The following is a very minimal getting started guide. It helps you to set up your first LaxarJS application and to create your first LaxarJS widget.
The node package manager npm is required to get started with LaxarJS. First we use it to obtain some basic development tools (grunt-cli and grunt-init), as well as templates for the main LaxarJS artifact types:
npm install -g grunt-cli grunt-init
git clone https://github.com/LaxarJS/grunt-init-laxar-application.git ~/.grunt-init/laxar-application
git clone https://github.com/LaxarJS/grunt-init-laxar-widget.git ~/.grunt-init/laxar-widget
git clone https://github.com/LaxarJS/grunt-init-laxar-activity.git ~/.grunt-init/laxar-activity
Note that, depending on your workstation setup, you might have to use sudo
when running npm install
with the -g
option.
Make sure that your PATH
includes the .../node_modules/bin
directory.
For additional information and troubleshooting, consult the documentation of npm
and grunt-init
respectively.
The scaffolding tool grunt-init
can now be used to create artifacts from the LaxarJS templates:
mkdir tryout
cd tryout
grunt-init laxar-application
npm install
npm start
Visit your empty application at https://localhost:8000/debug.html.
Press Ctrl-C
to stop the server for now.
Create a widget which simply displays Hello, world!:
mkdir -p includes/widgets/tryout/my_first_widget
cd includes/widgets/tryout/my_first_widget
grunt-init laxar-widget
Add some widget-HTML:
echo '<h1>Hello, world!</h1>' > default.theme/my_first_widget.html
Reference the widget from your page:
cd -
echo '{
"layout": "one_column",
"areas": {
"activities": [ ],
"header": [ ],
"content": [
{
"widget": "tryout/my_first_widget"
}
],
"footer": [ ]
}
}
' > application/pages/page1.json
npm start
See your widget in action at https://localhost:8000/debug.html
First, stop the development server using Ctrl-C
.
grunt optimize
npm start
Now your production-ready application can be visited at https://localhost:8000/index.html.
You can also use grunt dist
to get a zip archive containing the application without development server and build tools.
Have fun developing your first LaxarJS application.
Make sure to have a look at the manuals and and check out the demo applications on the LaxarJS website.