Lapis, an OpenResty web framework

811 views
Skip to first unread message

leaf corcoran

unread,
Apr 26, 2013, 2:55:41 PM4/26/13
to openre...@googlegroups.com
Hello everyone,

I've just released a web framework I've been building the past few months that runs on top of OpenResty. I'd love some feedback! It' s designed for my cross compiled language MoonScript, which compiles to Lua, but you can also use Lua directly if you wish.

It's called Lapis, the homepage is here: http://leafo.net/lapis/

I've written a ton of documentation which you can find here: http://leafo.net/lapis/reference.html

It supplies a bunch of things you would except to find in a web framework. URL routing, template rendering, active record system, query and schema generation functions, migrations, CSRF, and signed sessions.

I'm currently running two websites with it. One of them is a Lua rocks hosting repository called MoonRocks, http://rocks.moonscript.org The source is here: https://github.com/leafo/moonrocks-site

It's running on Heroku for free with an OpenResty module I built, which you can find here: https://github.com/leafo/heroku-openresty



Thanks,
Leaf

agentzh

unread,
Apr 26, 2013, 3:05:42 PM4/26/13
to openresty-en
Hello!

On Fri, Apr 26, 2013 at 11:55 AM, leaf corcoran <lea...@gmail.com> wrote:
> Hello everyone,
>
> I've just released a web framework I've been building the past few months
> that runs on top of OpenResty. I'd love some feedback! It' s designed for my
> cross compiled language MoonScript, which compiles to Lua, but you can also
> use Lua directly if you wish.
>

Thank you for your great contribution!

Best regards,
-agentzh

Ricardo Alcantara

unread,
Jun 4, 2013, 12:55:33 AM6/4/13
to openre...@googlegroups.com
I've been studying your framework, and I thought just awesome. Great work!

G_will

unread,
Jun 4, 2013, 1:51:26 AM6/4/13
to openre...@googlegroups.com
@Leaf

I don't think HTML Generation is a good idea. I prefer Template Render.

HTML Generation makes data and html too close, and htmls are always complex Especially for non-English-language environment.

So, I think you should build in a Template Engine in your framework.


2013/4/27 leaf corcoran <lea...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "openresty-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openresty-en...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Nicolas Rioux

unread,
Jun 4, 2013, 12:53:32 PM6/4/13
to openre...@googlegroups.com
I second that thought! I've been playing with openresty with/ without lapis and 
there's a need for adding in either openresty or lapis a tempting engine.

AgentZh mentionned LTP (http://www.savarese.com/software/ltp/) which is quite nice
and allows a clean separation. Integrating it at the lapis level could be nice
since the LTP as a compile steps that transforms it to lua (generating html).
So lapis server could have a hook that compiles those .ltp and have them
available as a lua module for efficiency. 



From: gwill...@gmail.com
Date: Tue, 4 Jun 2013 13:51:26 +0800
Subject: Re: [openresty-en] Lapis, an OpenResty web framework
To: openre...@googlegroups.com

leaf corcoran

unread,
Jun 4, 2013, 4:11:16 PM6/4/13
to openre...@googlegroups.com
I'm personally against templating languages for generating HTML. They encourage repetition and are typically difficult to extend and combine. The builder syntax in MoonScript can be treated as a templating language if you want, the amount of logic put it in it is up to you. The advantage though is that you get all the benefits of a real programming language should you need them. Once you start using class based inheritance and mixins in your templates you'll understand why it's very powerful. Also it makes it easy to bind data to your templates, for example you could attach things like CSS and JS to help with aggregating assets, or automatically generate enclosing dom elements for encapsulation, or maybe define explicit requirements before a template can be rendered and so on.

In any case, it's very easy to use an existing templating language in Lapis. An action can return a string and that will be rendered as is. So you're free to render any template using any templating language you want.

I recommend at least trying the Lapis way even though it might not be what you're used. I've had a lot of experience working on a very large (and localized) Rails application using Erector (http://erector.rubyforge.org/userguide.html) and I took a lot of what I learned and applied it to Lapis. I've been very satisfied with the organization this kind of setup gives me. My views have a logical hierarchy.

David J

unread,
Jun 4, 2013, 6:43:55 PM6/4/13
to openre...@googlegroups.com

What about json output wondering how to return json responses?

leaf corcoran

unread,
Jun 4, 2013, 7:49:16 PM6/4/13
to openre...@googlegroups.com
Just return something like this from your action:

json: { my: "json object" }

xxl...@gmail.com

unread,
Aug 19, 2013, 12:39:14 PM8/19/13
to openre...@googlegroups.com
nice framework, i will try!


Em sexta-feira, 26 de abril de 2013 15h55min41s UTC-3, leaf corcoran escreveu:

Derek

unread,
Oct 2, 2013, 4:10:29 AM10/2/13
to openre...@googlegroups.com
First: Is there a google group or forum dedicated to this framework? Also, is there a wishlist for features or a todo list that you might have?

Second: I noticed in your tutorial you used tup to help with the workflow.  Is there anything like LiveReload for Lapis that automatically changes the web page in the browser when you change your code (without you having to refresh yourself)?

zach....@throw-up.com

unread,
Nov 14, 2013, 11:27:59 PM11/14/13
to openre...@googlegroups.com, yizi...@gmail.com
@Derek, I recently put together a blog engine using lapis and LiveReload was the exact tool I used to achieve that.  I just added .moon as an extension, and had it set to do "moonc .;" after detecting any changes.  

Tup would be ideal, unfortunately tup --monitor only works on linux at the moment.  

velikan...@gmail.com

unread,
Feb 8, 2014, 6:10:13 PM2/8/14
to openre...@googlegroups.com
Leaf, your project rocks, but the documentation is HORRIBLY TERRIBLE!!!
The person (me) without any experience in moonscript cannot run the even test site at all! it's very discouraging :(((
five sleepless nights and no progress.... blah, and I can't ask anyone - nobody knows what the heck is moonscript :((((
but I believe that with time the community will grow!
good luck and thank you!!!

пятница, 26 апреля 2013 г., 22:55:41 UTC+4 пользователь leaf corcoran написал:

leaf corcoran

unread,
Feb 8, 2014, 11:33:06 PM2/8/14
to openre...@googlegroups.com
Hi,

If you're having trouble then you should ask me! Send me an email off list and I'll be glad to help you out. I'm working on an update that should be coming out in the next week or so that includes an improved Lua API and a reference manual written in Lua.

Thanks


--
Reply all
Reply to author
Forward
0 new messages