A declarative and extensible framework for building Elixir applications.
Go to file
Zach Daniel 81fee97306 fix: use `Ash.Changeset.set_context` on changesets 2024-02-22 17:39:52 -05:00
.github fix: properly set context on query and changeset 2024-02-21 08:16:23 -05:00
benchmarks fix: ensure we retain the sort order of embedded resources 2024-02-13 13:55:07 -05:00
config improvement: don't run `check` in cases that require strict checks 2024-02-01 17:09:34 -05:00
documentation chore: release version v2.19.5 2024-02-22 10:58:45 -05:00
lib fix: use `Ash.Changeset.set_context` on changesets 2024-02-22 17:39:52 -05:00
logos chore: add pride and trans pride versions of the logos. (#645) 2023-07-10 19:32:14 -04:00
scripts chore: add `gource` script 2023-12-27 16:37:24 -05:00
test fix: honor soft destroys for atomic bulk destroys 2024-02-22 08:02:01 -05:00
.check.exs chore: add cheat_sheets to check 2023-09-14 17:27:21 -04:00
.credo.exs improvement: handle pkey-less resources when attaching fields 2024-01-21 00:45:35 -05:00
.doctor.exs ci: remove tweets/switch to standardized CI pipeline 2023-01-31 11:15:09 -05:00
.formatter.exs fix: ensure we retain the sort order of embedded resources 2024-02-13 13:55:07 -05:00
.gitignore * improvement: add data layer introspection to Ash.Resource.Info (#610) 2023-06-10 13:17:17 -04:00
.gitpod.yml fix: handle builtin types in unions (#752) 2023-10-25 08:31:25 -04:00
.tool-versions improvement: optimize embedded resource creation 2024-01-19 09:58:54 -05:00
CHANGELOG.md chore: release version v2.19.5 2024-02-22 10:58:45 -05:00
FUNDING.yml fix: parse functions properly 2020-10-09 20:59:43 -04:00
LICENSE chore: Update License 2020-09-21 14:00:57 -04:00
README.md chore: release version v2.19.5 2024-02-22 10:58:45 -05:00
backers.md chore: update backers.md 2022-11-25 14:45:35 -05:00
coveralls.json feat: Add pagination (#131) 2020-10-11 23:55:47 -04:00
mix.exs chore: release version v2.19.5 2024-02-22 10:58:45 -05:00
mix.lock fix: properly annotate `run_flow`'s recursive DSL tag 2024-02-16 21:25:18 -05:00

README.md

Logo Logo

Elixir CI License: MIT Hex version badge

Dependency

def deps do
  [
    {:ash, "~> 2.19.5"}
  ]
end

What is Ash?

Ash Framework is a declarative, resource-oriented application development framework for Elixir. A resource can model anything, like a database table, an external API, or even custom code. Ash provides a rich, and extensive set of tools for interacting with and building on top of these resources. By modeling your application as a set of resources, other tools know exactly how to use them, allowing extensions like AshGraphql and AshJsonApi to provide top tier APIs with minimal configuration. With filtering/sorting/pagination/calculations/aggregations, pub/sub, policy authorization, rich introspection, and much more built-in, and a comprehensive suite of tools to allow you to build your own extensions, the possibilities are endless.

For those familiar with Phoenix, you can think of Ash as a declarative application modeling layer designed to replace your Phoenix contexts.

Ash Framework 2.0

Ash Framework 2.0 has been released! This begins the official stable release cycle (although it was already quite stable). Thanks to everyone in the community who helped make this possible, from the contributors, the curious, to those already using Ash in prod. I'm eternally grateful for all of your support.

Additionally, I'd like to thank Alembic, who have brought me on to work on Ash full time. Alembic is building complex software with small teams in record time by leveraging tools like Ash Framework and Phoenix LiveView.

Along with the 2.0 release of core, the AshPostgres, AshPhoenix and AshArchival packages have had 1.0 version released as well. AshGraphql is next up, and should be released in the next few weeks. Feel free to dive in to it before then, though :).

Is Ash an alternative to X?

Ash is not meant to be an alternative to Phoenix, Ecto, or Absinthe. Ash uses Ecto under the hood, AshGraphql uses Absinthe. Phoenix is absolutely the recommended way to build web interfaces on top of your Ash application (there is a whole package dedicated to it, AshPhoenix). Ash is not meant to be the only way that you ever interact with your data, so it is almost a certainty that you will need to use Ecto in some cases. For instance, Ash does not currently support bulk actions or atomic updates. For this reason, you can implement custom actions for things that can be encapsulated in your resource, and you have all of Elixir at your disposal to implement custom behavior outside of your resources, with a wide array of escape hatches in between.

Extensions

Extensions in 1.0+

  • AshPostgres - Back a resource with postgres. Rich querying capabilities, supporting aggregates, calculations, and fragments. Comes with a migration generator to get you up and running in record time!
  • AshPhoenix - Helpers to integrate Ash Resources with Phoenix. Tools like AshPhoenix.Form allow you to build forms over your resources, and manage complex nested related data with one data structure.
  • AshArchival - A tiny but powerful extension. Get archival (A.K.A soft deletion) with one line of code.

Extensions <1.0

  • AshGraphql - Create a GraphQL from your resources with only a few lines of code. Backed by the excellent Absinthe library. It comes with its own fully implemented dataloader, and automatically derives all the types, fields, and mutations automatically. Getting a relay compatible GraphQL API is as easy as setting the relay? toggle.
  • AshJsonApi - Create a JSON:API spec compliant API in minutes.
  • AshAdmin - A rich admin UI automatically derived from your resource definitions.
  • AshCsv - Back your resource with a CSV file.
  • Spark - The core declarative DSL library that backs Ash and its extensions.

Unreleased Extensions

  • AshPaperTrail - Creates and manages a versions table for a resource, and writes all changes to that version resource. With one line of code.
  • AshJsonApiWrapper - Back your resource with an external API using finch and configuration to describe how your resource maps to the response from the external service.

Your Own Extensions

All of the extensions above are created with a set of tools that are free to use to create your own extensions. They can all be used as a basis point, or as inspiration. Many users have created their own extensions for various reasons. An extension can both add to the resource's DSL and programatically restructure the resource. For example, AshArchival adds an attribute, modifies every destroy action, and adds a "base filter" to the resource. This allows for extremely powerful extensions.

Contributors

Ash is made possible by its excellent community!

Become a contributor