Ash

Introduction

Traditional MVC Frameworks (Rails, Django, .Net, Phoenix, etc) leave it up to the user to build the glue between requests for data (HTTP requests in various forms as well as server side domain logic) and their respective ORMs. In that space there is an incredible amount of boilerplate code that must get written from scratch for each application (authentication, authorization, sorting, filtering, pagination, sideloading relationships, serialization, etc). Often this code is untested, lacks many feature support, is tighly coupled to a specific web layer, and varies widely between each piece of data.

Ash is an opinionated yet configurable framework designed to reduce boilerplate in any Elixir application by providing a layer of abstraction over the data layer of your system called a Resource. Don't worry Phoenix developers - Ash is designed to play well with Phoenix :)

To riff on a famous JRR Tolkien quote, a Resource is "One Interface to rule them all, One Interface to find them, One Interface to bring them all, and in the darkness bind them".

First you declare your resources using the Ash resource DSL. You could technically stop there, and just leverage the Ash Elixir API to avoid writing boilerplate. More likely, you would use libraries like Ash.JsonApi or Ash.GraphQL(someday) with Phoenix to add external interfaces to those resources without having to write any extra code at all.

Developers shoud be focusing on their core business logic - not boilerplate code. Ash builds upon the incredible productivity of Phoenix and empowers developers to get up and running with a fully functional app in substantially less time, while still being flexible enough to allow customization when the need inevitably arises.

Ash is an open source project, and draws inspiration from similar ideas in other frameworks and concepts. The goal of Ash is to lower the barrier to adopting and using Elixir and Phoenix, and in doing so help these amazing communities attract new develpers, projects, and companies.

Example Resource

defmodule Post do
use Ash.Resource, name: "posts", type: "post"
use AshJsonApi.JsonApiResource
use Ash.DataLayer.Postgres
actions do
read :default,
authorization_steps: [
allow_if: user_is(:admin)
]
create :default,
authorization_steps: [
allow_if: user_is(:admin)
]
end
attributes do
attribute :name, :string
end
relationships do
belongs_to :author, Author
end
end

TODO LIST (in no order)