Scala + Lift + MongoDB = SLiM Stack

253 views
Skip to first unread message

philip

unread,
Dec 15, 2010, 10:11:02 AM12/15/10
to Lift
Hi All,

I put together an implementation of the SLiM Stack idea as described
by Brian Knapp here: http://programminggeek.com/ so the idea is not
mine, but I can see its a good idea so implemented it.

The SLiM Stack is similar to LAMP, WAMP and MAMP, SLiM = Scala + Lift
+ MongoDB. It is the combination and distribution of these
technology's together.

The goals of this project are as follows:
a) Make it as easy as possible for a beginner, a PHP programmer, a
Java programmer or manager without much time on their hands to get
started with Liftweb and MongoDB on Windows to evaluate the
technology. This is aimed at the total beginner only.
b) Give many "simple" examples for common development use cases to
allow developers to accomplish the simple and common tasks of form
entry, validation, displaying data from the database.
c) To add code generators for common use cases, construction of forms,
database tables, validation, etc, i.e. as seam-gen does for SEAM
Framework. So a complete beginner could make a simple website using
this technology stack in a few hours. To have RAD development using
this technology stack.

This is an open source project, Apache 2. I'm looking for
contributions if anyone wants to help. Especially in the area of:
a) Lots of simple example code using Liftweb and MongoDB, simple means
- as simple as possible that can be explained easily.
b) Articles for the website, or on your blog or website.
b) The usual, development, bug fixing etc.

The first executable is available here, download here:
http://code.google.com/p/slim-stack/downloads/list
Google project here:
http://code.google.com/p/slim-stack/
The website will be here (nothing there yet, one or two days time).
http://www.getslimstack.net/
The source code is in the installer at the moment, so you have it if
you downlaod the exe.

What does it do? It starts a Java program which starts up MongoDB,
Liftweb and RockMongo-(to allow users to admin the database). Liftweb
is started via SBT, so when you change a Liftweb Scala file or html
template file it re-deploys and re-starts jetty so that a development
cycle like PHP can be done. The user can change a file and 5 to 10
seconds later see the result by refreshing the browser. If you put
JRebel jar file in the jrebel directory, it uses JRebel to speed up
the re-deployment so the change-view-change cycle is faster.
Note that when a user changes a file a refreshing progress bar appears
on the top right of the users screen to show the user that SLiM Stack
is refreshing so the user knows when to refresh the browser as the
cycle is not as fast as it is for a PHP developer.

How to use it? Install it, run it, it places a small program running
on the windows taskbar on bottom right. Click on the icon and it shows
the window, here you can start and stop either MongoDB, SBT (Liftweb)
and PHP for the RockMongo. On the top row is Liftweb port 8080, click
on the browser button after it has started up and you can browse the
site. Included is a simple example which allows you to add pets to a
table in MongoDB.

Why do this? LAMP, MAMP, WAMP are all very successful, why? anyone
could download PHP, Mysql and Apache and set them up themselves, but
it takes at least a hour minimum to get LAMP set up first time
yourself and most users get stuck. The same problem exists with
Liftweb and MongoDB, to get started with Liftweb, first you must get
Scala, get Liftweb, get an IDE, work out how to set it up, run a few
scala examples, wow a lot of time invested just to explore the
technology and hit lots of bumps on the way. Maybe your an I.T.
manager, you heard its good stuff BUT you just don't have the time to
do all of this.

Why write an email here? I want to get some feedback before I put the
website up and let others know about it since this influences the
image of Liftweb. Any questions or comments please reply.
I have not tested it on any other computer than my own, so maybe it
doesn't work at all for other people, let me know. Its a real hack
together as SBT doesn't have an API and I programmed in Java, not
Scala.

References:
RockMongo http://code.google.com/p/rock-php/wiki/rock_mongo
Default user for RockMongo is admin admin

Regards, Philip

Timothy Perrett

unread,
Dec 15, 2010, 12:31:12 PM12/15/10
to Lift
Philip,

This is a great initiative - I haven't tried it yet, but it sounds
great. Kudos :-)

Cheers, Tim

On Dec 15, 3:11 pm, philip <philip14...@gmail.com> wrote:
> Hi All,
>
> I put together an implementation of the SLiM Stack idea as described
> by Brian Knapp here:http://programminggeek.com/so the idea is not
> The website will be here (nothing there yet, one or two days time).http://www.getslimstack.net/
> RockMongohttp://code.google.com/p/rock-php/wiki/rock_mongo

philip

unread,
Dec 15, 2010, 9:03:54 PM12/15/10
to Lift
Here is a screenshot.
http://www.getslimstack.net/slimstackrunning.jpg

On Dec 16, 1:31 am, Timothy Perrett <timo...@getintheloop.eu> wrote:
> Philip,
>
> This is a great initiative - I haven't tried it yet, but it sounds
> great. Kudos :-)
>
> Cheers, Tim
>
> On Dec 15, 3:11 pm, philip <philip14...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi All,
>
> > I put together an implementation of the SLiM Stack idea as described
> > by Brian Knapp here:http://programminggeek.com/sothe idea is not

David Pollak

unread,
Dec 15, 2010, 10:31:22 PM12/15/10
to lif...@googlegroups.com
This is awesomely excellent.

The only suggestion I have is to host the project at GitHub... that makes it much easier for folks to fork it, play with it, etc.


--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

Patrick Boos

unread,
Dec 15, 2010, 11:47:44 PM12/15/10
to lif...@googlegroups.com
This sounds really great! Missing the LIKE button! ;-)
Keep going! Will love to see as well SLiM for Linux and Mac :)

Malcolm

unread,
Dec 16, 2010, 11:48:46 AM12/16/10
to Lift
While Lift is a far better framework in many respects - these guys
(http://www.playframework.org/documentation/1.1/firstapp) have done a
fantastic job of bring a great Out-Of-Box experience to their
framework (while taking a lot of pages from the Rails book).

So, I am excited to see you taking on this task. Getting potential
users (who may know little about Scala AND Lift) to have a really
positive first experience is an important undertaking.


Just my two cents.

Regards,
Malcolm

On Dec 15, 10:11 am, philip <philip14...@gmail.com> wrote:
> Hi All,
>
> I put together an implementation of the SLiM Stack idea as described
> by Brian Knapp here:http://programminggeek.com/so the idea is not
> The website will be here (nothing there yet, one or two days time).http://www.getslimstack.net/
> RockMongohttp://code.google.com/p/rock-php/wiki/rock_mongo

Andy Czerwonka

unread,
Dec 16, 2010, 12:21:32 PM12/16/10
to lif...@googlegroups.com
We're got the same thing here.

Malcolm

unread,
Dec 16, 2010, 12:50:15 PM12/16/10
to Lift
The chat application is also a great example project (with very clear
instructions as you say) and tackles a harder (comet / ajax and
Actors) problem.

But, my point was it would also be good to have a example (like this
one http://www.playframework.org/documentation/1.1/guide1) that
tackles a set of very common programmer use-cases (authentication,
forms, navigation, data model, deployment) - (in steps 1 - 12) . Lift
has all these capabilities (and many more) so I suppose it is more a
matter of having a complete example and docs to demonstrate the common
cases and to some degree, the *easy* stuff. In the spirit of open
source, it may even make sense to profile the same example as Play, to
show the distinctions between Scala, Lift, View-First vs MVC-style
frameworks to show where Lift really shines.

Copied from (http://www.playframework.org/documentation/1.1/home)

Starting up the project
A first iteration of the data model
Building the first screen
The comments page
Setting up a Captcha
Add tagging support
A basic admin area using CRUD
Adding authentication
Creating a custom editor area
Completing the application tests
Preparing for production
Internationalisation and localisation

On Dec 16, 12:21 pm, Andy Czerwonka <andy.czerwo...@gmail.com> wrote:
> We're got the same thing here <http://liftweb.net/getting_started>.

David Pollak

unread,
Dec 16, 2010, 12:56:19 PM12/16/10
to lif...@googlegroups.com
On Thu, Dec 16, 2010 at 9:50 AM, Malcolm <malsmi...@gmail.com> wrote:
The chat application is also a great example project (with very clear
instructions as you say) and tackles a harder (comet / ajax and
Actors) problem.

But, my point was it would also be good to have a example (like this
one http://www.playframework.org/documentation/1.1/guide1) that
tackles a set of very common programmer use-cases (authentication,
forms, navigation, data model, deployment) - (in steps 1 - 12) .  Lift
has all these capabilities (and many more) so I suppose it is more a
matter of having a complete example and docs to demonstrate the common
cases and to some degree, the *easy* stuff.  In the spirit of open
source, it may even make sense to profile the same example as Play, to
show the distinctions between Scala, Lift, View-First vs MVC-style
frameworks to show where Lift really shines.

We had a todo list as a starting example: http://old.liftweb.net/docs/getting_started/mod_master.html

It covered many of the topics in the Play start-up guide and we got pissed on for a wide variety of things (maven, mapper [oh, you can *ONLY* use mapper with Lift], etc.) so we scaled it back.

I'm looking to cover a variety of getting started examples in Simply Lift (http://simply.liftweb.net).  You can see the first chapter.  The second and third are enhancements.  The forth covers wiring.  Then, and only then, will I get to something like the ToDo example (although I may do a multi-user to do using SproutCore as the front end).

In terms of the Play documentation, personally I do not like it at all.  The fact that it takes 12 steps to do a simple app in Play seems like a lose rather than a win.
 

Copied from (http://www.playframework.org/documentation/1.1/home)

Starting up the project
A first iteration of the data model
Building the first screen
The comments page
Setting up a Captcha
Add tagging support
A basic admin area using CRUD
Adding authentication
Creating a custom editor area
Completing the application tests
Preparing for production
Internationalisation and localisation

On Dec 16, 12:21 pm, Andy Czerwonka <andy.czerwo...@gmail.com> wrote:
> We're got the same thing here <http://liftweb.net/getting_started>.
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.

philip

unread,
Dec 16, 2010, 10:09:20 PM12/16/10
to Lift

Thanks for all the suggestions - I'm still putting together the
website but a preview is here at the moment
http://www.getslimstack.net/preview/

I'll post the code to github shortly.
I agree that Play Framework gives a very easy hand-holding tutorial
but verbose and more code than Liftweb and many disadvantages compared
to Lift, and Liftweb is clearly more powerful. For people
understanding Liftweb this is obvious but for people outside its not
so clear, especially when they are time poor, hopefully Slimstack will
move more people towards Liftweb.
The chat example shows some of that power, but the chat application is
not a average use case for web developers, mostly they do forms and
showing data from the database and online shop and wizard/page by page
type forms. Well, thats boring and average, thats what we do most of
the time for customers, those boring business use cases that customers
ask for which could be done in PHP, but I don't want to do it in PHP
of course, I had to do a wordpress website recently for a customer and
wanted to bang my head on the desk repeatedly from the insanity of it.
I want my customers to ask for Liftweb websites.

You are very welcome to create any new tutorial and or code examples
using MongoDB or not using the DB that are VERY simple and using the
very latest code style of Liftweb, with your attribution I'll put it
on getslimstack.net or link to your blog. I consider most of the
tutorials written so far to be intermediate to hard. I agree with
Malcolm's step by step, super easy tutorial method, ie:

Starting up the project
A first iteration of the data model
Building the first screen
The comments page
Setting up a Captcha
Add tagging support
A basic admin area using CRUD
Adding authentication
Creating a custom editor area
Completing the application tests
Preparing for production
Internationalisation and localisation

Thanks!

On Dec 17, 1:56 am, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> On Thu, Dec 16, 2010 at 9:50 AM, Malcolm <malsmith3...@gmail.com> wrote:
> > The chat application is also a great example project (with very clear
> > instructions as you say) and tackles a harder (comet / ajax and
> > Actors) problem.
>
> > But, my point was it would also be good to have a example (like this
> > onehttp://www.playframework.org/documentation/1.1/guide1) that
> > liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com >
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890

Paul Dale

unread,
Dec 16, 2010, 10:14:53 PM12/16/10
to lif...@googlegroups.com
We had a todo list as a starting example: http://old.liftweb.net/docs/getting_started/mod_master.html

It covered many of the topics in the Play start-up guide and we got pissed on for a wide variety of things (maven, mapper [oh, you can *ONLY* use mapper with Lift], etc.) so we scaled it back.

My take is that we need a 'lift in two hours' version.

Something between canned examples and 'go read one of the books' that covers the zen of lift.

You probably won't get to the 'aha' moment in 15 minutes. There are so many questions because so many things you expect to need to do aren't there. You jump from A to Z and you're left wonder but,but,but how do I do B ... Y? And it takes a while to realize that you just don't have to any more.

Lift is clearly not for the short-attention span crowd. You need to steep in it's goodness for a while before it seeps in to you. As such, no point in really marketing to them. 

Paul
 

Andy Czerwonka

unread,
Dec 17, 2010, 12:38:32 PM12/17/10
to lif...@googlegroups.com
Excellent comment.

Sephiroth

unread,
Dec 17, 2010, 2:52:06 PM12/17/10
to Lift
Awesome tool. Will definitely use it :D

David Pollak

unread,
Dec 17, 2010, 6:59:26 PM12/17/10
to lif...@googlegroups.com
On Thu, Dec 16, 2010 at 7:14 PM, Paul Dale <paul...@gmail.com> wrote:


We had a todo list as a starting example: http://old.liftweb.net/docs/getting_started/mod_master.html

It covered many of the topics in the Play start-up guide and we got pissed on for a wide variety of things (maven, mapper [oh, you can *ONLY* use mapper with Lift], etc.) so we scaled it back.

My take is that we need a 'lift in two hours' version.

I think that's what Pocket Change is supposed to be http://exploring.liftweb.net/master/index-2.html#toc-Chapter-2.
 

Something between canned examples and 'go read one of the books' that covers the zen of lift.

You probably won't get to the 'aha' moment in 15 minutes. There are so many questions because so many things you expect to need to do aren't there. You jump from A to Z and you're left wonder but,but,but how do I do B ... Y? And it takes a while to realize that you just don't have to any more.

Lift is clearly not for the short-attention span crowd. You need to steep in it's goodness for a while before it seeps in to you. As such, no point in really marketing to them. 

Paul
 

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.

philip

unread,
Dec 18, 2010, 2:43:07 AM12/18/10
to Lift
A small note, this SLiM Stack isn't the best way to work with these
technologies, its just a convenient way, you can set up your IDE with
SBT and it works mostly the same but better for some cases.

philip

unread,
Dec 18, 2010, 2:43:13 AM12/18/10
to Lift
Nice example.

On Dec 18, 7:59 am, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> On Thu, Dec 16, 2010 at 7:14 PM, Paul Dale <paul.d...@gmail.com> wrote:
>
> > We had a todo list as a starting example:
> >>http://old.liftweb.net/docs/getting_started/mod_master.html
>
> >> It covered many of the topics in the Play start-up guide and we got pissed
> >> on for a wide variety of things (maven, mapper [oh, you can *ONLY* use
> >> mapper with Lift], etc.) so we scaled it back.
>
> > My take is that we need a 'lift in two hours' version.
>
> I think that's what Pocket Change is supposed to behttp://exploring.liftweb.net/master/index-2.html#toc-Chapter-2.
>
>
>
>
>
>
>
>
>
>
>
> > Something between canned examples and 'go read one of the books' that
> > covers the zen of lift.
>
> > You probably won't get to the 'aha' moment in 15 minutes. There are so many
> > questions because so many things you expect to need to do aren't there. You
> > jump from A to Z and you're left wonder but,but,but how do I do B ... Y? And
> > it takes a while to realize that you just don't have to any more.
>
> > Lift is clearly not for the short-attention span crowd. You need to steep
> > in it's goodness for a while before it seeps in to you. As such, no point in
> > really marketing to them.
>
> > Paul
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lif...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com >
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890

David Pollak

unread,
Dec 18, 2010, 11:31:31 AM12/18/10
to lif...@googlegroups.com


On Fri, Dec 17, 2010 at 11:43 PM, philip <phili...@gmail.com> wrote:
Nice example.

Maybe you can adapt Pocket Change to Record/MongoDB.  That would reinforce the example as a starting point for Lift.
 
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890

philip

unread,
Dec 19, 2010, 11:49:42 AM12/19/10
to Lift
Hi David,

Yes good idea, I will try to adapt Pocket Change.

Made the site go live - http://www.getslimstack.net/
Added example document - http://www.getslimstack.net/example1.php
If you feel like editing or correcting my errors in example
documentation, feel free.

Thanks!

On Dec 19, 12:31 am, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> > <liftweb%2Bunsu...@googlegroups.com<liftweb%252Bunsubscribe@googlegroup s.com>>

David Pollak

unread,
Dec 19, 2010, 12:32:32 PM12/19/10
to lif...@googlegroups.com
On Sun, Dec 19, 2010 at 8:49 AM, philip <phili...@gmail.com> wrote:
Hi David,

Yes good idea, I will try to adapt Pocket Change.

Made the site go live - http://www.getslimstack.net/
Added example document - http://www.getslimstack.net/example1.php

Hmmm.... a php site to promote Lift?  How about using a Lift site?  You can use Hoisted as the CMS (https://github.com/dpp/hoisted) an example of a hoisted site is http://liftweb.net (content at https://github.com/lift/cms_site )

Note that Hoisted allows standard Lift snippets within the markup as well as standard XHTML.
 
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890

philip

unread,
Dec 19, 2010, 8:04:06 PM12/19/10
to Lift
Thats a good point! for the immediate moment I'll remove the .php
extension with .htaccess.

On Dec 20, 1:32 am, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> On Sun, Dec 19, 2010 at 8:49 AM, philip <philip14...@gmail.com> wrote:
> > Hi David,
>
> > Yes good idea, I will try to adapt Pocket Change.
>
> > Made the site go live -http://www.getslimstack.net/
> > Added example document -http://www.getslimstack.net/example1.php
> > > > <liftweb%2Bunsu...@googlegroups.com<liftweb%252Bunsubscribe@googlegroup s.com>
Reply all
Reply to author
Forward
0 new messages