All Projects → boazsegev → Plezi

boazsegev / Plezi

Licence: mit
Plezi - the Ruby framework for realtime web-apps, websockets and RESTful HTTP

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Plezi

Http
An opinionated framework for scalable web 🌎
Stars: ✭ 136 (-43.1%)
Mutual labels:  framework, websockets
Kratos
A modular-designed and easy-to-use microservices framework in Go.
Stars: ✭ 15,844 (+6529.29%)
Mutual labels:  rest-api, framework
Azure Signalr
Azure SignalR Service SDK for .NET
Stars: ✭ 137 (-42.68%)
Mutual labels:  websockets, real-time
Signalw
Even simpler and faster real-time web for ASP.NET Core.
Stars: ✭ 125 (-47.7%)
Mutual labels:  websockets, real-time
Hexnut
🔩 Hexnut is a middleware based, express/koa like framework for web sockets
Stars: ✭ 204 (-14.64%)
Mutual labels:  framework, websockets
Huobi
火币的行情交易的python实现
Stars: ✭ 129 (-46.03%)
Mutual labels:  rest-api, websockets
Django Salesman
Headless e-commerce framework for Django.
Stars: ✭ 157 (-34.31%)
Mutual labels:  rest-api, framework
Nest
A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications on top of TypeScript & JavaScript (ES6, ES7, ES8) 🚀
Stars: ✭ 42,981 (+17883.68%)
Mutual labels:  framework, websockets
Blynk Server
Blynk is an Internet of Things Platform aimed to simplify building mobile and web applications for the Internet of Things. Easily connect 400+ hardware models like Arduino, ESP8266, ESP32, Raspberry Pi and similar MCUs and drag-n-drop IOT mobile apps for iOS and Android in 5 minutes
Stars: ✭ 8 (-96.65%)
Mutual labels:  rest-api, websockets
Autoserver
Create a full-featured REST/GraphQL API from a configuration file
Stars: ✭ 188 (-21.34%)
Mutual labels:  rest-api, framework
Kepler
The open source full-stack geosocial network platform
Stars: ✭ 125 (-47.7%)
Mutual labels:  framework, real-time
Feathers
A framework for real-time applications and REST APIs with JavaScript and TypeScript
Stars: ✭ 13,761 (+5657.74%)
Mutual labels:  framework, real-time
Drone
CLI utility for Drone, an Embedded Operating System.
Stars: ✭ 114 (-52.3%)
Mutual labels:  framework, real-time
Bolt Js
A framework to build Slack apps using JavaScript
Stars: ✭ 1,971 (+724.69%)
Mutual labels:  framework, websockets
Framework
[NOT MAINTAINED] A full-featured PHP framework powering the server side of Webiny Platform. Can also be used as standalone library.
Stars: ✭ 110 (-53.97%)
Mutual labels:  rest-api, framework
Vidgear
A High-performance cross-platform Video Processing Python framework powerpacked with unique trailblazing features 🔥
Stars: ✭ 2,048 (+756.9%)
Mutual labels:  framework, real-time
Sandstone
PHP microframework designed to build a RestApi working together with a websocket server. Build a real time RestApi!
Stars: ✭ 98 (-59%)
Mutual labels:  websockets, real-time
Facil.io
Your high performance web application C framework
Stars: ✭ 1,393 (+482.85%)
Mutual labels:  framework, websockets
Fiber
⚡️ Express inspired web framework written in Go
Stars: ✭ 17,334 (+7152.72%)
Mutual labels:  rest-api, framework
Stampede
🦕 Deno REST framework/eco-system
Stars: ✭ 205 (-14.23%)
Mutual labels:  rest-api, framework

Plezi - a real-time web application framework for Ruby

Gem Version Inline docs GitHub

Note: at this point, plezi.io is mostly a wrapper around the iodine Ruby server. Use iodine directly if possible.

Are microservices on your mind? Do you dream of a an SPA that's easy to scale? Did you wonder if you could write a whole Websockets, RESTful AJAX back-end with just a few lines of code (business logic not included)?

Welcome to your new home with plezi.io, the Ruby real-time framework that assumes the business logic is seperate from the web service logic.

Short and Sweet

What if your next Pub/Sub application could be as easy as:

require 'plezi'
class MyChatroom
  # HTTP
  def index
    render :index
  end
  def on_open
    subscribe channel: :chat
    @name = ::ERB::Util.h(params[:nickname] || "anonymous")
    publish channel: :chat, message: "#{@name} joined the chat."
  end
  def on_message data
    publish channel: :chat, message: "#{@name}: #{::ERB::Util.h data}"
  end
  def on_shutdown
    write "Server is going away. Come back again some other time, #{@name}."
  end
end

Plezi.route '/(:nickname)', MyChatroom

What does Plezi have to offer?

Plezi is a Rack based framework with support for native (server side implemented) Websockets.

Plezi will provide the following features over plain Rack:

  • Object Oriented (M)VC design, BYO (Bring Your Own) models.

  • A case sensitive RESTful router to map HTTP requests to your Controllers.

    Non-RESTful public Controller methods will be automatically published as valid HTTP routes, allowing the Controller to feel like an intuitive "virtual folder" with RESTful features.

  • Raw Websocket connections.

    Websocket connections are now route specific, routing the websocket callbacks to the Controller that "owns" the route.

  • Auto-Dispatch (optional) to automatically map JSON websocket "events" to Controller functions (handlers).

  • Native Pub/Sub provided by Iodine.

  • Automatic (optional) scaling using Redis.

  • An extensible template rendering abstraction engine, supports Slim, Markdown (using RedCarpet) and ERB out of the box.

  • Belated, extensible, asset baking (optional fallback for when the application's assets weren't baked before deployment).

    It's possible to define an asset route (this isn't the default) to bake assets on the fly.

    In production mode, assets will be baked directly to the public folder supplied to Iodine (the web server) with a matching path. This allows the static file server to serve future requests.

    However, during development, baking will save the files to the asset's folder, so that the Ruby layer will be the one serving the content and dynamic updates could be supported.

Things Plezi doesn't do (anymore / ever):

  • No DSL. Plezi won't clutter the global namespace.

  • No application logic inside.

    Conneting your application logic to Plezi is easy, however, application logic should really be independent, reusable and secure. There are plenty of gems that support independent application logic authoring.

  • No native session support. If you must have session support, Rack middleware gems provide a lot of options. Pick one... However...

    Session have been proved over and over to be insecure and resource draining.

    Why use a session when you can save server resources and add security by using a persistent connection, i.e. a Websocket? If you really feel like storing unimportant stuff, why not use javascript's local storage on the client's machine? (if you need to save important stuff, you probably shouldn't be using sessions anyway).

  • No code refresh / development mode. If you want to restart the application automatically whenever you update the code, there are probably plenty of gems that will take care of that.

Do notice, Websockets require Iodine (the server), since (currently) it's the only Ruby server known to support native Websockets using a Websocket Callback Object.

Installation

Add this line to your application's Gemfile:

gem 'plezi'

And then execute:

$ bundle

Or install it yourself as:

$ gem install plezi

Usage

A new application (default applications include a simple chatroom demo):

 $  plezi new app_name

A simple hello world from irb:

require 'plezi'

class HelloWorld
  def index
    "Hello World!"
  end
end

Plezi.route '*', HelloWorld

exit # <= if running from terminal, this will start the server

Documentation

Plezi is fairly well documented.

Documentation is available both in the forms of tutorials and explanations available on the plezi.io website as well as through the YARD documentation.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/boazsegev/plezi.

License

The gem is available as open source under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].