GithubHelp home page GithubHelp logo

yote's Introduction

Name

YOTE

Summary

Yote is a platform for creating web based applications by bridging client side javascript with server side, automatically persistent perl objects. Yote provides javascript objects with methods that map to their server side counterparts.

See http://fenowyn.com/yote for more information.

Quickstart for OSX / Linux

It's as easy as...

1. Install Yote
$ perl Build.PL
$ ./Build
$ ./Build test
$ ./Build install
2. Start the server
$ yote_server --port=8001 # 8001 is the default. This can be run on 80 to serve pages.
3. Write your own code (e.g. "hello world" app, website code, etc)

Requirements

  • perl version 5.10

Verify / install the requirements

Following is how to verify that you have each of the requirements and, if not, to get it.

  • perl version 5.10

    To verify if you have this:

    $ perl -v

    If your version is too low, look at using perlbrew to upgrade:

    http://search.cpan.org/~gugod/App-perlbrew-0.39/bin/perlbrew

    (From the perlbrew docs:)

    $ curl -kL http://install.perlbrew.pl | bash
    $ ~/perl5/perlbrew/bin/perlbrew install 5.14.2  # Current version as of 2012-01-20
    $ ~/perl5/perlbrew/bin/perlbrew use 5.14.2
    $ perl -v  # Should now tell you 5.14.2

    This installs the perlbrew executable, the perl-5.14.2 executable, and all core Perl modules into ~/perl5/perlbrew/. It then sets the current shell to use the new version.

    You may also want to use cpanm (or another CPAN shell) to install additional modules for the new perl version.

  • run javascript tests

    Start yote :

    $ yote_server --port=8001 

    launch a web browser with the address :

    http://localhost:8001/yote/unit_tests.html

Using Yote

Start the Web App Server

Starting the Web App Server from the command line:

$ script/yote_server

This starts the server on the default port (8008), using SQLiteIO, and writing to file ~/.yote/SQLite.yote.db.

Starting the Web App Server from a package:

use Yote::WebAppServer;

my $server = new Yote::WebAppServer();

$server->start_server( port => 8008,
           datastore  => 'Yote::SQLiteIO',
           sqlitefile => 'yote.database' );

Coding with Yote

Client Side

<script src="./js/jquery-latest.js"></script>
<script src="./js/jquery.dumper.js"></script>
<script src="./js/jquery.base64.min.js"></script>
<script src="./js/json2.js"></script>
<script src="./js/yote.js"></script>
<script>
    var hello_app = $.gServ.fetch_app( 'Yote::Hello' );
    var result = hello_app.hello({ name:"fred" } );
    var counter = hello_app.get_counter();
</script>

Server Side

package Yote::Hello;

use strict;
use Yote::Obj;
use base 'Yote::AppRoot';

sub init {
    my $self = shift;
    my $counter = $self->get_counter( new Yote::Obj() );
}

sub hello {
    my( $self, $data, $acct ) = @_;
    my $name = $data->{name};
    my $counter = $self->get_counter();
    $counter->set_count( $counter->get_count() + 1 );
    return "hello there '$name'. I have said hello ". $counter->get_count() . " times.";
}

1;

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 74:

Expected '=item *'

yote's People

Contributors

ewolf avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.