Ash Framework: resource-oriented application development framework for Elixir
Ash Framework

    
    
    
      Model your domain, 
  derive the rest

    
    
      Build 
  powerful Elixir applications
 with a 
  flexible
 toolchain.
    

    

    OR
    

    

    
      
  
  
    Resources
  
  
  Plug and play
 building blocks that scale with the complexity of your application.
        
  

      
  
  
    GraphQL
  
  
    
          Easily create rich, customizable, full featured 
  GraphQL APIs
 backed by Absinthe.
        
  

      
  
    
          
            alt-curly
            
          
        
  
  
    JSON:API
  
  
    
          Create JSON:API spec compliant apis in 
  minutes,
 not days.
        
  

      
  
  
    Authentication
  
  
    
          Effortless authentication with 
  magic link
 and 
  social login
 out of the box.
        
  

      
  
  
    Community
  
  
    
          A thriving community of people 
  working together
 to 
  build and learn.

        
  

      
  
  
    Authorization
  
  
    
          Add row and field level policies to 
  prohibit access
 to data.
        
  

      
  
  
    Multitenancy
  
  
  Built in strategies
 for splitting your application by tenant.
        
  

      
  
  
    Data Layers
  
  
    
          Postgres, Ets, Mnesia, CSV and 
  more on the way!

        
  

      
  
  
    Admin
  
  
    
          A 
  push-button admin interface
 you can drop right into your application.
        
  

      
  
  
    Extensions
  
  
    
          A suite of tools for you to 
  build your own
 extensions and DSLs.
        
  

      
  
  
    Observability
  
  
    
          Custom tracers and rich telemetry events allow you to export 
  high fidelity observability data.

        
  

      
  
  
    Compatibility
  
  
    
          Works great with 
  Phoenix, Ecto
 and all the other 
  first rate tools
 in the Elixir ecosystem.
        
  

    

    
      
        
          Service delivery partner
        
      
      
          
            
          
        
      
          
  Alembic

          specializes in providing custom solutions that ensure the success of your Ash Framework projects.
          Leveraging extensive knowledge of both Ash Framework and the broader Elixir ecosystem, our team is
          well-equipped to craft personalized projects, implement innovative features, or optimize your existing codebases.
          Reach out to learn more about how our tailored solutions can make your project excel.
        
    

    

    

    
      
  
    "The ease of defining our domain model and configuring Ash to generate a powerful GraphQL API has been a game-changer. What used to be complex and time-consuming has become simplicity itself."
  

  
    Alan Heywood
  

  
    CTO, HereTask
  


      
  
    "Through its declarative extensibility, Ash delivers more than you'd expect: Powerful APIs with filtering/sorting/pagination/calculations/aggregations, pub/sub, authorization, rich introspection, GraphQL... It's what empowers this solo developer to build an ambitious ERP!"
  

  
    Frank Dugan III
  

  
    System Specialist, SunnyCor Inc.
  


      
  
    "I’m constantly blown away with the quality of work and support the Ash community has put into this project. It’s gotten to the point that I can’t imagine starting a new Elixir project that doesn’t use Ash."
  

  
    Brett Kolodny
  

  
    Full stack engineer, MEW
  


      
  
    "Ash is an incredibly powerful idea that gives Alembic a massive competitive advantage. It empowers us to build wildly ambitious applications for our clients with tiny teams, while consistently delivering the high level of quality that our customers have come to expect."
  

  
    Josh Price
  

  
    Technical Director, Alembic
  


      
  
    "Ash Framework enabled us to build a robust platform for delivering financial services using bitcoin. Ash proved itself to our team by handling innovative use cases with ease and it continues to evolve ahead of our growing list of needs."
  

  
    Yousef Janajri
  

  
    CTO & Co-Founder, Coinbits
  


      
  
    "The more I’ve used Ash, the more blown away I am by how much I get out of it – and how little boilerplate I have to write. I’m yet to encounter a situation where I would need to fight the “Ash way” of doing things, but the framework still allows me to choose how I build my software."
  

  
    Juha Lehtonen
  

  
    Senior Software Developer
  

    

    

    

    

    
        

    
        
        
        
        
      
        Define a resource
      
      
      
  
  
      
        
          
             1
          
             2
          
             3
          
             4
          
             5
          
             6
          
             7
          
             8
          
             9
          
            10
          
            11
          
            12
          
            13
          
            14
          
            15
          
            16
          
            17
          
            18
          
            19
          
            20
          
            21
          
            22
          
            23
          
            24
          
            25
          
            26
          
            27
          
            28
          
            29
          
            30
          
            31
          
            32
          
            33
          
            34
          
            35
          
            36
          
            37
          
            38
          
            39
          
            40
          
            41
          
            42
          
            43
          
            44
          
            45
          
            46
          
            47
          
            48
          
            49
          
            50
          
          
      
      
        
          
            defmodule Example.Post do
          
        
          
        
          
        
          
                data_layer: AshPostgres.DataLayer
          
        
          
        
          
        
          
                description "A post is the primary sharable entity in our system"
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
                attribute :text, :string do
          
        
          
        
          
                  description "The body of the text"
          
        
          
        
          
        
          
                attribute :visibility, :atom do
          
        
          
        
          
                    one_of: [:friends, :everyone]
          
        
          
        
          
                  description "Which set of users this post should be visible to"
          
        
          
        
          
        
          
        
          
        
          
        
          
                  argument :type, Example.Types.ReactionType do
          
        
          
        
          
        
          
        
          
                  change manage_relationship(
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
                belongs_to :author, Example.User do
          
        
          
        
          
        
          
        
          
                has_many :reactions, Example.Reaction
          
        
          
        
          
        
      
    

        
            
        
          
            post = Example.Post.create!(%{
          
        
          
              text: "Declarative programming is fun!"
          
        
          
        
          
        
          
            Example.Post.react!(post, %{type: :like})
          
        
          
        
          
        
          
            |> Ash.Query.filter(likes > 10)
          
        
          
            |> Ash.Query.sort(likes: :desc)
          
        
          
        
      
            
      
        
          
             1
          
             2
          
             3
          
             4
          
             5
          
             6
          
             7
          
             8
          
             9
          
            10
          
            11
          
            12
          
            13
          
          
      
      
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
                create :create_post, :create
          
        
          
                update :react_to_post, :react
          
        
          
        
          
        
      
    
            
            
            
            
          
      
  