Coder Social home page Coder Social logo

adamsanderson / willdo Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 200 KB

A sample RESTful Merb app designed as a test bed for RESTful clients

Home Page: http://endofline.wordpress.com/2008/12/01/the-new-client-side-restful-backends/

JavaScript 15.19% Ruby 84.81%

willdo's Introduction

WillDo

WillDo is a very simple RESTful application. It is meant to be the base layer for various explorations into building alternative front-end clients. As such, WillDo's HTML interface is little more than some basic scaffolding required to explore the data.

WillDo is just complicated enough to ensure that clients will represent real world clients, however is not so complex that it should be a burden.

This is an open project, and it would be awesome to see some folks fork it and build more example clients.

Design Principles

No JavaScript was used for the interface, real clients will provide their own interface, so we should not add any more to the UI layer than is needed.

Resources are used whenever they make sense. Everything that can be, should be mapped as a resource. This way we can keep a simple interface to the underlying data.

Each resource should be available in multiple formats. We should facilitate as many clients as possible, if people enjoy XML, give them XML, if they want JSON, then give them JSON.

File Structure

WillDo is a standard Merb application. Clients and shared libraries will exist in the +public+ directory.

For instance:

  • public/
    • clients/
      • jQuery_client/
        • index.html
        • client.js
      • shoes_client/
        • will_do.shy
    • lib
      • JSON2.js

Resource Structure

WillDo consists of three key resources: Users, TodoLists, and TodoItems. Users have many TodoLists, and TodoLists have many TodoItems.

Resources are accessible via nested routes such as:

get User id 1:

/users/1

get the TodoLists for User 1:

/users/1/todo_lists

get the TodoItems for TodoList 1:

/users/1/todo_lists/1/todo_items

More Information This project is motivated by my post here: http://endofline.wordpress.com/2008/12/01/the-new-client-side-restful-backends/

Warnings, Dire Words, Utter Failures

At the moment, the app works, however the tests don't. To be quite honest, a lot seems to have changed in Merb's progression to 1.0 status, and I'm having a lot of trouble figuring out how to write meaningful tests.

Contact

Adam Sanderson, [email protected]

willdo's People

Contributors

adamsanderson avatar

Stargazers

Angus H. avatar  avatar

Watchers

James Cloos 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.