Cinque Terre Rack::App
Ruby Web Application framework - Fully BDD - Sadistically minimalist

Examples


Let's see some examples before we go any deeper! =)

Benchmarking


Benchmarking

This is a repo that used for measure Rack::App project speed in order keep an eye on the performance in every release.

the benchmarking was taken on the following hardware specification:

  • Processor: 2,7 GHz Intel Core i5
  • Memory: 16 GB 1867 MHz DDR3
  • Ruby: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]

Endpoint to be call type: static

number of declared endpoints: 100

name version current / fastest real
rack-app 4.0.0 1.0 2.2053215187043942e-05
ramaze 2012.12.08 1.469 3.2396856602279885e-05
hobbit 0.6.1 2.996 6.607205038890137e-05
brooklyn 0.0.1 5.243 0.00011562206838279088
nyny 3.4.3 5.272 0.00011626420279498706
nancy 0.3.0 5.649 0.00012458588462322884
roda 2.16.0 9.894 0.00021819913859945575
scorched 0.25 12.728 0.0002807019599946191
sinatra 1.4.7 21.169 0.0004668393424013356
grape 0.17.0 25.941 0.0005720832234016178
rails 5.0.0 33.234 0.0007329187002032537
camping 2.1.532 39.699 0.0008754866444039887
cuba 3.8.0 54.196 0.001195195165998367

Endpoint to be call type: dynamic

number of declared endpoints: 100

name version current / fastest real
ramaze 2012.12.08 1.0 3.563736104406403e-05
rack-app 4.0.0 1.045 3.7236363370898984e-05
hobbit 0.6.1 3.327 0.00011857437202706835
brooklyn 0.0.1 3.435 0.0001224283379153493
nancy 0.3.0 3.655 0.00013025841524358072
nyny 3.4.3 3.769 0.00013432033741847768
roda 2.16.0 6.167 0.00021978241582400968
scorched 0.25 8.382 0.000298717098613243
grape 0.17.0 15.433 0.0005500056585995111
sinatra 1.4.7 16.949 0.0006040298487991155
rails 5.0.0 22.101 0.0007876135203987838
camping 2.1.532 22.724 0.0008098106166115665
cuba 3.8.0 34.394 0.0012257058174116335

Dependency


One dependency to rule them all

"RACK:APP has a single dependency, called rack!" - Captain Obvious

Disclaimer: you still need a webserver other than webrick :)

Features


Easy to understand syntax

module method level endpoint definition inspirited heavily by the Sinatra DSL

unified error handling

syntax sugar for default header definitions

namespaces for endpoint request path declarations so it can be dry and unified

no Class method bloat, so you can enjoy pure ruby without any surprises

App mounting so you can crete separated controllers for different task

O(log(n)) lookup routing

allows as many endpoint registration to you as you want, without impact on route lookup speed

only basic sets for instance method lvl for the must need tools, such as params, payload

simple to use class level response serializer

so you can choose what type of serialization you want without any enforced convention

static file serving so you can mount even filesystem based endpoints too

built in testing module so your app can easily written with BDD approach

made with minimalism in mind so your app can't rely on the framework when you implement business logic

if you need something, you should implement it without any dependency on a webframework, rack-app only mean to be to provide you with easy to use interface to the web layer, nothing less and nothing more

controller/endpoint level based middleware definitions

you can define middleware stack before endpoints and it will only applied to them, similar like protected method workflow

File Upload and file download in a efficient and elegant way with minimal memory consuming

note that this is not only memory friendly way pure rack solution, but also 2x faster than the usually solution which includes buffering in memory

Principles


Keep It Simple

The RACK:APP codebase is kept to a bare minimum! It will still make you productive :)

No Code bloat

RACK:APP is completely monkey patch free! No Core Class magic, main space method bloats or universal global helpers.

Absolute minimal runtime processing

RACK:APP preprocesses anything that it can! This achieve minimal overhead during request processing.

Fully BDD

RACK:APP was developed using Behavior Driven Design! Fully tested and ready for production.

It makes integration testing a breeze. All you need to do is require the Test module in your specification.

Easy to Learn

Mastering RACK:APP takes very little time! It's DSL was inspired by Sinatra.

The framework is a bit opinionated, but all you need is your classic ruby method listing trick:

puts(self.methods - Object.methods)

Everything is self descriptive. If not, drop us a mail to make it so!

Principle Of Least Surprise

RACK:APP is simple! Everything works just as you would expect it to. No black magic correcting developers' mistakes at runtime.

If something should break during development, it will.

Modular design

RACK:APP does not force you to use the full development stack! Start with the Core and add modules as needed.

Writing plugins and isolated mountable applications is also a piece of cake.

Open development

RACK:APP developers love new ideas and encourage contribution! Catch us on Github.

Loaded with examples

RACK:APP features examples for all it's features! Check them out at the top right!

About


Your next favourite rack based micro framework with minimal dependencies and minimalism in mind. Have a cup of awesomeness by starting to use rack-app today!

"Simplicity is the ultimate sophistication." - Leonardo Da Vinci. Write pure RACK:APPs. They will only do what you define! Nothing more, nothing less.

"If you want see fancy magic, you are in a bad place buddy, RACK:APP ain't nothing like ActiveSupport monkey patching the world!" - Captain Developer

It's routing can handle a very large number of endpoints. Go crazy and try it with 10k endpoint! There is one thing you won't need to worry about routing lookup.

Whether you're a student looking to create some project work on the web, a professional looking to create a clean architecture based business critical micro-service, a web designer who wants to create attractive websites for their clients! rack-app is for you! Start using it today!

Companies who use rack-app