- Preface
- Chapter 1: Thinking in Ash
- Chapter 2: The Foundation: Resources and Domains
- Chapter 3: Actions
-
Chapter 4: Relationships – How to Link Records
- 4.1 Has Many Relationship
-
4.2 How to Read Related Data with
Ash.Query.load/2 - 4.3 Belongs To Relationship
- 4.4 Create Child and Parent at the Same Time
- 4.5 Many To Many Relationship
- 4.6 Has One
- 4.7 Filtering With Relationships
- 4.8 Retrieving Nested Relationships
- 4.9 Deleting Records With Related Records
- Chapter 5: Calculations and Aggregates
- Chapter 6: Validations
- Chapter 7: Authorization With Policies
- Chapter 8: Code Interfaces
- Part 2 - Wire Ash into Phoenix Applications
- Chapter 9: Wiring Ash into Phoenix
- Chapter 10: LiveView and Real-Time Updates with Ash PubSub
- Chapter 11: Don’t Repeat Yourself (DRY) in Ash
- Chapter 12: Authentication
-
Chapter 13: Convert Your Application into Multitenant
- 13.1 Setting Up Teams (Tenant) Resource
- 13.2 Make this resource multi-tenant
- 13.3 Creating a Team and Auto-Linking the Owner User to the Team
- 13.4 Ash Multitenancy: Automating User-Team Associations
- 13.5 Associate Users with Teams
- 13.6 Linking the User to the Team
- 13.7 Setting the Owner’s Current Team
- 13.8 Logged In User Tenant set
- 13.9 Speeding Up Our Tests
- 13.10 Making Liveview Tenant Aware
- Chapter 14: Authorization in Ash Multitenancy
- Chapter 15: Background Jobs with Oban and Ash — Reliable Email Notifications
- Chapter 16: CI, and Deployment(Soon)
-
Chapter 17: Understanding Spark and the Extension System
- 17.1 The Foundation: Code as Data in Elixir
- 17.2 What is the Abstract Syntax Tree (AST)?
- 17.3 Using quote to Capture Code as Data
- 17.4 Using unquote to Inject Values into Quoted Code
- 17.5 Introducing Spark: The Engine Behind Ash’s DSLs
- 17.6 How Spark Works: A Simple Example
- 17.7 A Real Ash Example
- 17.8 Key Spark Concepts
- 17.9 Why Spark’s Extension Model is Revolutionary
- Chapter 18: Building Your First Ash Extension
- Chapter 19: Make Your Extension Configurable
- Chapter 20: Publish Your Extension To the World via Hex.pm
- Appendix A: Ash Framework Cheat Sheet
- Acknowledgments
Ash Framework for Phoenix Developers
How to write Less code, Ship faster, and extend forever web application using Ash and Phoenix Framework
Ash Framework has climbed to #4 as the most used Elixir framework/library in the 2025 community survey, right behind Phoenix, LiveView, and Absinthe. Impressive rise for the youngest in the top!
If you're a Phoenix developer looking to level up with Ash, the rising star that's simplifying business logic, data layers, APIs, and more, now is the perfect time!
What's inside?
- Part 1: The Fundamentals: Master the 20% that unlocks 80% of Ash's power.
- Part 2: Wire Ash into Phoenix Applications: Seamless integration for your projects.
- Part 3: Building and Publishing Reusable Ash Extensions: Create pro-level tools like those in ash_authentication.
Minimum price
$37.00
$47.00
You pay
$47.00Author earns
$37.60About
About the Book
The hands-on, no-fluff guide that finally shows Phoenix developers how to stop writing the same boilerplate over and over and start shipping robust, secure, production-grade Elixir applications in a fraction of the time.
Written by a battle-tested Phoenix engineer who has built and shipped real-world systems in healthcare, manufacturing, and HR, this book takes you from “I’ve heard Ash is powerful” to “I just built a complete multi-tenant help-center in weeks instead of months.”
You’ll go far beyond the official docs. Through a single, real production application (a fully-featured multi-tenant knowledge base with categories, articles, nested comments, tagging, feedback, search, and admin tools) and by writing, testing, configuring, and publishing your own Ash extension to Hex.pm as a reusable Elixir package, you will master every layer of Ash:
- Declare your domain once with Resources and Domains—Ash generates migrations, relationships, constraints, and keeps everything in sync forever
- Master actions, changesets, calculations, aggregates, policies, and code interfaces the way Ash was designed to be used
- Build bulletproof, database-driven authorization that scales from simple roles to dynamic permissions
- Wire Ash into LiveView, PubSub, Oban, and Phoenix channels with zero friction
- Dive deep into Spark and write real Ash extensions: transformers, configurasble sections, custom changes, atomic hooks, and full test suites—the exact techniques behind ash_authentication, ash_archival, and ash_json_api
- Publish your own hex package (you’ll ship AshParental, a production-ready single-table parent/child extension, to hex.pm by the end of the book)
This isn’t theory. Every line of code has run in production. Every pattern has survived real users, real bugs, and real deadlines.
If you already love Phoenix and are ready to 4x your throughput while writing cleaner, safer, more maintainable systems, this is the Ash book you need.
Author
About the Author
Kamaro Lambert is a tech lead and full-stack Elixir engineer with over 15 years of experience shipping production software in PHP/Laravel, Python/Django, .NET before specializing in Elixir, Phoenix, and Ash.
He has built and scaled battle-tested systems solo for healthcare, manufacturing, HR, and SaaS delivering in months what once took teams of four, with zero backend incidents in years for apps serving tens of thousands of daily users.
He wrote the widely-read Medium series Ash Framework for Phoenix Developers (38+ parts, thousands of readers), published the popular Hex package ash_parental, and maintains community starter kits that help teams ship faster.
Kamaro holds an MBA in Strategic Management and remains a hands-on contributor to the Ash ecosystem. This book distills the hard-won expertise he uses every day in production.
Contents
Table of Contents
Get the free sample chapters
Click the buttons to get the free sample in PDF or EPUB, or read the sample online here
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Write and Publish on Leanpub
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.