phoenix.cr alternatives and similar shards
Based on the "Framework Components" category.
Alternatively, view phoenix.cr alternatives based on common mentions on social networks and blogs.
-
shrine.cr
File Attachment toolkit for Crystal applications. Heavily inspired by Shrine for Ruby. -
Exception Page
An exceptional exception page for Crystal web libraries and frameworks -
praetorian
A minimalist Crystal authorization system inspired by https://github.com/varvet/pundit. -
motion.cr
Motion is a framework for building reactive, real-time frontend UI components in your Amber application using pure Crystal that are reusable, testable & encapsulated. -
kemal-auth-token
Kemal middleware to authentication via HTTP header token using JWT -
device_detector
Crystal shard for device detection by User-Agent string -
mochi
Mochi is a authentication shard inspired by devise. Mochi is designed for the Amber framework with support for both Granite & Jennifer ORM's. -
Athena Event Dispatcher
A Mediator and Observer pattern event library -
mime-types.cr
MIME Types for Crystal :: A port of the Ruby MIME::Types library -
request_id
Middleware for generates / pick up a unique request ID for Crystal servers. -
Athena Negotiation
Framework agnostic content negotiation library
InfluxDB - Power Real-Time Data Analytics at Scale
Do you think we are missing an alternative of phoenix.cr or a related project?
README
phoenix.cr Phoenix Channels client for Crystal API Docs
Installation
Add this to your application's shard.yml
:
dependencies:
phoenix:
github: dtcristo/phoenix.cr
Usage
The example below shows basic usage; connecting to a socket, joining a channel, binding to an event and sending messages.
require "phoenix"
# Create socket and connect to it
socket = Phoenix::Socket.new("http://example.com/socket")
socket.connect
# Initiate a channel, bind to an event and join
channel = socket.channel("topic:subtopic")
channel.on "event" do |payload|
# do stuff with payload
end
channel.join
# Start a loop and send a message down the channel every second
loop do
sleep 1
channel.push("new_msg", JSON::Any.new({"text" => JSON::Any.new("Hello world!")}))
end
The Phoenix Channels docs provide details on implementing sockets and channels on the server side. The phoenix.cr docs detail the client side API available for use in your Crystal application.
Chat example
examples/chat.cr demonstates an example chat client.
Start the phoenix-chat server example:
git clone https://github.com/dtcristo/phoenix-chat
cd phoenix-chat
mix deps.get
mix phx.server
Run the chat client:
crystal examples/chat.cr
Follow the prompts to enter your name and chat away.
Todo
- Improve test coverage
- Implement Presence
- Build larger example application
Contributors
- dtcristo David Cristofaro - creator, maintainer
Credits
- Thanks chrismccord and the Phoenix team for building an amazing web framework. This implementation is based off the original JavaScript reference implementation.