Code Monkey home page Code Monkey logo

ringfinger's Introduction

ringfinger Build Status

Fun, fast, secure web development on top of Clojure/Ring. A framework for the age of non-relational databases, content delivery networks, cloud hosting, HTML5 and coffee. InstaRESTful, if you like the hipster-speak. Named after a great Nine Inch Nails song. Not ready yet, but a lot of things work, including MongoDB support, ready-to-use customizable login/signup system and more.

Check out the website for a live demo.

Get excited

(ns superapp.core
  (:use (ringfinger core resource fields auth-routes),
        ringfinger.db.mongodb, ringfinger.timesavers.hooks,
        ring.util.serve))

(def mymongo (mongodb "mydb"))

(defresource contacts
  {:db mymongo
   :pk :name_slug
   :hooks {:data (make-slug-for :name)}}
  [:name  (required) "sorry, anonymous"]
  [:bday  (date-field) "invalid date"]
  [:email (email-field) "invalid email"])

(defapp myapp
        {:static-dir "custom_static_name"
         :session-db mymongo
         :auth-db mymongo}
        contacts
        (auth-routes {:db mymongo}))

(serve myapp 3000)

or something like that. You can do create/read/update/delete operations on the same resource with a browser (there are default HTML templates, like in Rails) or something that supports JSON, YAML, CSV or XML. Yeah, URLs are the same. The app is an API, and HTML is just another output format. The Accept HTTP header (or ?_format=something) is what "separates" the API. And insert some example data by visiting /contacts/_create_fakes (only in development environment, of course). Nice, eh?

You can customize the behavior via hooks (eg. if you need to automatically add URL-friendly "slugs", as in the example, or automatic timestamps), via providing Lamina channels and subscribing to them (eg. if you need real-time push) or adding custom actions, eg. for voting in a poll. You also can use lower-level auth/database/validation/output/routing APIs if you can't fit something into these RESTful constraints.

Coming "soon"

  • optionally separating create/index and view/edit pages in html
  • rate limiting (per user)
  • queries in url prefixes (eg. :username prefix to allow :username/collname/:pk with the same pk values)
  • pagination link (including HTTP Link header) things
  • enlive views quick builder
  • cyrillic transliteration for slugs
  • automatic API docs route for resources w/ examples using faker
  • Swagger implementation
  • automatic javascript model definitions for client-side mvc per resource, using clojurescript
  • live reloader (long poll, on disconnect: try to reconnect, when server is up, reload)
  • middleware like django-paranoid-sessions
  • extracting security, db and output once they'll be more stable and have more features
  • atom feeds for resources
  • invite mode for registration
  • file attachments w/ GridFS support
  • asset system that doesn't suck & supports preprocessors, css sprite making & completely dynamic in dev mode & uploads to clouds for production with a lein task, supporting attachment storages
  • pre-made Lamina subscribers for Pusher/pubsub.io/hook.io
  • FleetDB, CouchDB support
  • cloudy packages (ringfinger-aws = S3 + SES + SimpleDB, ringfinger-gae = Blobstore + Mail + Datastore)
  • read-only mode
  • database and attachment migrations (eg. mongodb + gridfs to simpledb + s3)
  • field renaming
  • (fun!) external package for outputting data in native formats - python pickle using jython, php serialized array using quercus, yaml for ruby
  • easy full text search (elasticsearch, lucene): lamina subscriber + route for querying

ringfinger's People

Contributors

danieljomphe avatar

Stargazers

 avatar

Watchers

 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.