[erlang-questions] web frameworks - yet another question about ...

Tristan Sloughter <>
Thu Aug 25 14:30:48 CEST 2011


It has a ways to go but I think the framework I am working on as I develop a
site is similar to what you will be looking for:

https://github.com/claimstrade/maru

It just requires you include maru_web in your app and you then can build off
of the users and authentication that come with it. It is broke into apps for
the web, models and db layer (and eventually security/ops) so they can be
mixed and matched/replaced.

In sys.config I define:

 {maru_web, [{webmachine_ip, any},
                    {webmachine_port, "8080"},
                    {host_dir, ""},
                    {dispatch_file, ""}]}

So it is still webmachine resources but I'm working to simply the general
cases, like the example you give, and resources that deal with
GET/POST/PUT/DELETE for some model by json->record and record->json.

It should grow fast and I have a number of things I still need to move out
of the site to the general framework Maru.

So its still very young, but if people have suggestions on what they'd like
to see that they don't in other Erlang web frameworks please let me know!
Right now it will grow based on what I find is generic as I build another
production site with Webmachine.

Tristan

On Thu, Aug 25, 2011 at 7:01 AM, Joe Armstrong <> wrote:

> I seem to have asked the same question in many ways ...
>
> I want to build a simple generic web server.
>
> By my way of thinking I should just have to write a single module,
> that exports a very simple interface.
>
> Suppose I define such a module, call this my_server.
>
> I'd like to write this as follows:
>
>    -module(my_server).
>    -export([request/6])
>
>    request(Who, Command, URI, Args, Headers, Data) ->
>         ...
>         {reply, Headers, Data1}
>
>   Where for example,
>
>       Who = "joe"
>       Command = 'GET' | 'POST' | 'PUT' | ...
>       URI = "/path/to/thing"
>       Args = [{Key,Val}]        (parsed part of URI , ie a parsed
> AAA=BBB&CCC=DDD& ... part of the query
>       Headers and Data and the HTML headers and any other POST data
>
>   To run the server - I'd just say:
>
>      gen_http_server:start(Por, my_server)
>
>    I want the generic bit to handle all the other nasty stuff that I
> don't want to know about. By this I mean user
> management. I want "Who" to be a fully authenticated user - or
> possibly the atom 'unknown' if the user is not authenticated.
>
> I wish to hide all the details of user management from the interface.
> Things like "I forgot my password"
> captchas to prevent abuse, preventing false account creation, black
> listing malicious IPS etc.
>
> I want all this part to be handled by the generic party of the server.
>
> I realize this is asking a lot and is fairly complicated - but all I
> want to do is to define
> the semantics of my web site. I don't care about templating languages
> and all that stuff.
> Given an parsed (or even unparsed) request generating a bundle of HTML
> or js or css
> is relatively trivial - the difficult bit (to me) seems to be all this
> attendant muck to
> authenticate users, prevent abuse, blacking abusers, take care of
> forgotten passwords etc.
>
> If people want to make yet another web framework then please make
> one that handles the user management part of the problem.
>
> In an ideal world I should just need three (ish) modules to make my web
> server.
>
>    - a semantics module (as I described)
>    - a user management module (missing)
>    - a storage module (missing)
>
> With suitable abstract interfaces one should be able to pick and mix
> user management
> and backed storage - making different trade-offs between availability
> security and reliability
> which keeping the interfaces constant.
>
> has anybody any advice for how to make the user-management layer?
>
> /Joe
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110825/f550f4cf/attachment.html>


More information about the erlang-questions mailing list