public
Description: Web framework and a templating engine for Reia programming language.
Homepage: http://dev_addict.jot.ly
Clone URL: git://github.com/pirj/ryan.git
ryan /
name age message
file .gitignore Fri Jul 17 07:28:56 -0700 2009 retem peg syntax (errata) [pirj]
file LICENSE Fri Dec 05 14:03:04 -0800 2008 building the yaws example ain't rocket science ... [pirj]
file Makefile Mon Jul 06 11:39:03 -0700 2009 optimizing file copy [pirj]
file README.md Mon Jul 27 14:39:52 -0700 2009 some doc changes [pirj]
file STATUS Sun Apr 12 03:44:13 -0700 2009 current state and to do info [pirj]
directory application_example/ Thu Aug 06 13:37:30 -0700 2009 controllers -> pages [pirj]
directory application_example_classic/ Thu May 28 02:55:11 -0700 2009 getting rid handlers, get use of callbacks [pirj]
directory behavior/ Mon Apr 13 12:44:15 -0700 2009 behave is now first-class command [pirj]
directory bin/ Fri Sep 04 08:22:38 -0700 2009 if no models, why initialize database? [pirj]
directory deps/ Sun May 24 09:54:22 -0700 2009 adding leex (slightly modified makefile) in hop... [pirj]
directory src/ Wed Nov 04 13:33:08 -0800 2009 latest peg change [pirj]
README.md

Web applications with Ryan and Reia

Ryan is a Reia/Erlang BEAM based web framework. It allows you to create web applications with clean and short code.

Ryan consists of: - Session module - Routing module - Behave (RSpec-like testing tool) - Template engine adapter (Retem) - HTTP server adapters (YAWS, Mochiweb) - Database adapters (CouchDB)

Prerequisites

Erlang/OTP R12B-3 or higher, Reia language, CouchDB 0.9 Leex Mochiweb erlang_couchdb CouchDB adapter

Building

Run the following from Ryan source folder to build it: sudo make install

That will install ryan libraries into Erlang lib folder and ryan executable file into /usr/local/bin

Running an example application

Run:

cd application_example
ryan

Surf to: http://localhost:8001/app

You can specify a port number to run on in command line:

ryan -p 8080

Modify Todo controller, implement or change actions Create your own controllers and see the results without the need to even reload web page. Enjoy!

Routing

Following REST idiom, Ryan provides the ability to parse any url and run the corresponding controller.

http://host:post/store/fruits/show/122

will be passed to 'store' application, 'fruits' controller, 'show' action (method), providing it with cookie data, http request method (~GET, ~PUT, ~POST, ~DELETE, ~UPDATE etc.), and parsed query data list.

Controllers

Controllers are Reia modules. They reside in application_name/controllers/ folder. By default each controller method is available to web application user unless otherwise defined in routing schema.

Views

Views can be Retem templates (retems) and are placed in application_name/views/ folder.

Models

Models are object definitions that can be stored, retrieved and queried from storage systems. Only CouchDB is currently supported.

Useful links

Ryan@github Reia language home Dev blog Mailing list

This work wouldn't be possble without these guys

  • Tony Arcieri : Reia creator
  • Robert Virding : Excellent lexer library
  • Nick Gerakines : CouchDB adapter
  • Dmitry Chernyak : Smart JSON library refinement
  • Sean Cribbs : Huge work on PEG parser
  • many more

Authors

  • Phil Pirozhkov pirj@mail.ru