<div>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:</div><div><br></div><a href="https://github.com/claimstrade/maru">https://github.com/claimstrade/maru</a><br>
<br><div>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. </div>
<div><br></div><div>In sys.config I define:</div><div><br></div><div> {maru_web, [{webmachine_ip, any},<br>                    {webmachine_port, "8080"},<br>                    {host_dir, ""},<br>                    {dispatch_file, ""}]}<div>
<br></div><div>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.</div>
<div><br></div><div>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.</div><div><br></div><div>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.</div>
<div><br></div><div>Tristan</div><div><br><div class="gmail_quote">On Thu, Aug 25, 2011 at 7:01 AM, Joe Armstrong <span dir="ltr"><<a href="mailto:erlang@gmail.com">erlang@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I seem to have asked the same question in many ways ...<br>
<br>
I want to build a simple generic web server.<br>
<br>
By my way of thinking I should just have to write a single module,<br>
that exports a very simple interface.<br>
<br>
Suppose I define such a module, call this my_server.<br>
<br>
I'd like to write this as follows:<br>
<br>
    -module(my_server).<br>
    -export([request/6])<br>
<br>
    request(Who, Command, URI, Args, Headers, Data) -><br>
         ...<br>
         {reply, Headers, Data1}<br>
<br>
   Where for example,<br>
<br>
       Who = "joe"<br>
       Command = 'GET' | 'POST' | 'PUT' | ...<br>
       URI = "/path/to/thing"<br>
       Args = [{Key,Val}]        (parsed part of URI , ie a parsed<br>
AAA=BBB&CCC=DDD& ... part of the query<br>
       Headers and Data and the HTML headers and any other POST data<br>
<br>
   To run the server - I'd just say:<br>
<br>
      gen_http_server:start(Por, my_server)<br>
<br>
    I want the generic bit to handle all the other nasty stuff that I<br>
don't want to know about. By this I mean user<br>
management. I want "Who" to be a fully authenticated user - or<br>
possibly the atom 'unknown' if the user is not authenticated.<br>
<br>
I wish to hide all the details of user management from the interface.<br>
Things like "I forgot my password"<br>
captchas to prevent abuse, preventing false account creation, black<br>
listing malicious IPS etc.<br>
<br>
I want all this part to be handled by the generic party of the server.<br>
<br>
I realize this is asking a lot and is fairly complicated - but all I<br>
want to do is to define<br>
the semantics of my web site. I don't care about templating languages<br>
and all that stuff.<br>
Given an parsed (or even unparsed) request generating a bundle of HTML<br>
or js or css<br>
is relatively trivial - the difficult bit (to me) seems to be all this<br>
attendant muck to<br>
authenticate users, prevent abuse, blacking abusers, take care of<br>
forgotten passwords etc.<br>
<br>
If people want to make yet another web framework then please make<br>
one that handles the user management part of the problem.<br>
<br>
In an ideal world I should just need three (ish) modules to make my web server.<br>
<br>
    - a semantics module (as I described)<br>
    - a user management module (missing)<br>
    - a storage module (missing)<br>
<br>
With suitable abstract interfaces one should be able to pick and mix<br>
user management<br>
and backed storage - making different trade-offs between availability<br>
security and reliability<br>
which keeping the interfaces constant.<br>
<br>
has anybody any advice for how to make the user-management layer?<br>
<br>
/Joe<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div></div>