Goal of this Document / Gist is to layout the resources and challenges to writing a complete modern web app with Phoenix and Elixir as the state of the projects are starting on June 2015
- [Why Phoenix and not Rails or Node.js?](#Why Phoenix and not Rails or Node.js?)
- Main Resources
- Common Application Requirements
- Specific Application Requirements
- External APIs
- Example Code, Articles and Walkthroughs
The app that I'm building will use Real-time chat and SMS from Twilio, Stripe, GPS and IoT.
TODO: Put stats about performance, etc.
TODO: Put reasoning
- High Reliablity
- Hot Code Loading
- Low Latency
More Later...
Awesome Elixir
A curated list of amazingly awesome Elixir libraries, resources, and shiny things.
-
- Section where most of the Phoenix / Plug-based libraries are listed
Elixir Phoenix
My ever-growing list of bookmarks related to Phoenix and Elixir development.
Github Trending Elixir Projects
Things that any web developer will expect in a framework and it's ecosystem in 2015
What does it do? - For now, it enables your users to register, login, logout and recover/reset their passwords.
Addict depends on:
- Phoenix Framework
- Ecto
- Mailgun (Don't have an account? Register for free and get 10000 e-mails per month included)
Apache Kafka client for Elixir/Erlang.
Rough
Redis client for Elixir.
Atlas is an Object Relational Mapper for Elixir. (Work in progress. Expect breaking changes)
defmodule User do
use Atlas.Model
@table :users
@primary_key :id
field :id, :integer
field :email, :string
field :is_site_admin, :boolean
field :archived, :boolean
field :state, :string
validates_numericality_of :id
validates_presence_of :email
validates_length_of :email, within: 5..255
validates_format_of :email, with: %r/.*@.*/, message: "Email must be valid"
validates :lives_in_ohio
def lives_in_ohio(record) do
unless record.state == "OH", do: {:state, "You must live in Ohio"}
end
def admins do
where(archived: false) |> where(is_site_admin: true)
end
def admin_with_email(email) do
admins |> where(email: email)
end
end
iex> admin = Repo.first User.admin_with_email("[email protected]")
%User{id: 5, email: "[email protected]", archived: false, is_site_admin: true...}
EEx stands for Embedded Elixir. It allows you to embed Elixir code inside a string in a robust way:
iex> EEx.eval_string "foo <%= bar %>", [bar: "baz"]
"foo baz"
See ExGrid
There are others but, I currently only care about Sendgrid. Feel free to make a pull request and add some.
I know there's support for Mailgun.
Official Elixir Logger
JSON Logger is a logger backend that outputs elixir logs in JSON format.
This project is originally designed to make Elixir apps work with Logstash easily. It aims at providing as much information for the log is possible, so the logs can be more easily analyzed by backend services like Elasticsearch.
Official Basic unit testing framework for Elixir.
A polite, well mannered and thoroughly upstanding testing framework for Elixir.
fact "about factorial" do
factorial(0) |> ! 0
factorial(0) |> 1
list_of_factorials = Enum.map 0..3, fn n -> factorial(n) end
list_of_factorials |> contains 1
list_of_factorials |> !contains 2
list_of_factorials |> [ _, 1, _, 6 ]
end
For browser automation and writing integration tests in Elixir.
defmodule HoundTest do
use ExUnit.Case
use Hound.Helpers
hound_session
test "the truth", meta do
navigate_to("http://example.com/guestbook.html")
find_element(:name, "message")
|> fill_field("Happy Birthday ~!")
|> submit_element()
assert page_title() == "Thank you"
end
end
Record and replay HTTP interactions library for elixir. It's inspired by Ruby's VCR (https://github.com/vcr/vcr), and trying to provide similar functionalities.
Looks like this will need to be written by hand
See Twilio section
Roll your own
Currently not really a standard, more of requirement to have many channels open for long periods of time
All of the Twilio libraries are written by @danielberkompas so twilio should buy him a beer or three next time they are around.
Telephonist makes it easy to design state machines for [Twilio][twilio] calls. These state machines bring TwiML and logic together in one place, making call flows easier to maintain.
Twilio API client for Elixir
Only concerned with SendGrid at this point. Free free to add others
Payment processing library for Elixir. Based on Shopify's ActiveMerchant ruby gem
Supported Gateways
- Stripe
- Bogus - For Testing
BitPay Library for Elixir or Erlang
Powerful, flexible, lightweight interface to the BitPay Bitcoin Payment Gateway API. Can be used in an Elixir project or directly in an Erlang project as described in the Elixir Crash Course. This document assumes that you are using Elixir.
- Building a Simple Chat App in Elixir With Phoenix and RethinkDB
- Ticketee Rails 4 in Action in Phoenix - Building Ticketee in Phoenix. Step by step. Ongoing.
- The Philae Experiment: Landing an Elixir App on Meteor
Ruby on Rails