March 31st, 2011

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:

svn checkout http://ladistribution.net/svn/trunk/ ld-dev

Alternatively, you can also use our brand new Git repository:

git clonegit@github.com:ladistribution/ladistribution.git ld-dev

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 :)

chmod-R777 ld-dev

Now, execute the web installer, say you’re on localhost:

http://localhost/ld-dev/installer.php

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.

exportPATH=$PATH:/var/www/ld-dev/bin

Type ladis in the terminal to check that it works. It should output something like that:

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.

rm-rf my-application/.git

Now, to make it your own, edit the dist/manifest.xml file and change the “id” and “name” of the application.

<package><id>my-application</id><name>My Application!</name>
...

If you try http://localhost/ld-dev/my-application/ immediately it will not work. You have to register the application:

ladis register my-application

As seen before, in case you encounter permission issues. Fire:

sudochmod-R777

Build the package, share it with the world!

We’ll now build the package to distribute our web application:

cd my-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:

ladis package add-remote

Paste the Push URL, enter your credentials. And from now, pushing the package to the remote repository is that easy:

ladis package push

Conclusion

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 :)