In our previous blog post, we explained why La Distribution was a perfect platform to code simple web applications. Now, we’ll explain you how to start coding and distributing your first application with the Limonade framework.
Given that you are a seasoned web developer, it should not be difficult. And if you’re not, hey, are you sure you want to do this? :)
Setup La Distribution development environment
If you want to start hacking around La Distribution, we first recommend to setup a local copy from SVN and configure our command line utility. This what we’ll call from now “La Distribution development environment”.
First checkout La Distribution SVN repository:
Alternatively, you can also use our brand new Git repository:
Then update permissions:
As a web developer, I believe you know that working around user permissions and web server permissions can be a bit messy. In this tutorial, for the sake of simplicity and because we’re not working on real web server, we’ll fire chmod 777. If you know better, well, do it :)
Now, execute the web installer, say you’re on localhost:
Follow on screen instructions, create the first user, eventually register a MySQL database connection, and you’re done.
Now, we’ll make the ladis command line utility available from the terminal.
To do that, you can add La Distribution /bin/ directory to your PATH. Be careful, the following code is just an example, modify it to match your system. And, it’s an absolute path.
Type ladis in the terminal to check that it works. It should output something like that:
# site: /var/www/ld-dev/
La Distribution 'edge'
Copyright (c) 2009-2011 h6e.net / François Hodierne (http://h6e.net/)
Licensed under the GPL and MIT licences.
Create a web application using Limonade
In this tutorial, we’ll grab it directly from the command line.
We’ll delete the .git folder because we just wanted to export this project, not actually track it. We’ll later version control again if needed.
Now, to make it your own, edit the dist/manifest.xml file and change the “id” and “name” of the application.
If you try http://localhost/ld-dev/my-application/ immediately it will not work. You have to register the application:
As seen before, in case you encounter permission issues. Fire:
Build the package, share it with the world!
We’ll now build the package to distribute our web application:
ladis package build
my-application.zip is now created.
To make it available to other users, you should push it to a public La Distribution repository. This repository should be hosted on a public server, accessible to others.
It’s easy, go on any public La Distribution installation under your control (ie: not localhost). Sign in, go in Settings, then Repositories. There, create a new local repository, name it “apps” for instance.
Click on Manage, and upload the .zip.
It’s online! Now you can pass your repository Public URL to your friends so that they can install your application.
Of course, you can also automatize the publication from the command line. In the web panel, copy the repository “Push URL”. Then register it locally:
Paste the Push URL, enter your credentials. And from now, pushing the package to the remote repository is that easy:
It was a bit technical but not that difficult, uh?
We’re now waiting for your apps!
Don’t hesitate to start simple apps, make it available to others and share them with a Git repository. People may be interested and help you bring your application to the next level. Speaking for me, I’m pretty sure I’ll do :)