Ash Framework for Phoenix Developers
$37.00
Minimum price
$37.00
Suggested price

Ash Framework for Phoenix Developers

How to write Less code, Ship faster, and extend forever web application using Ash and Phoenix Framework

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.

Your unfair Ash Framework advantage begins now.

About the Author

Kamaro Lambert
Kamaro Lambert

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.

Table of Contents

    • Preface
    • Chapter 1: Thinking in Ash
      • 1.1 The Location of Ash In Your Application
      • 1.2 Describe(Model) Your Application
      • 1.3 Data all the way
    • Chapter 2: The Foundation – Resources and Domains
      • 2.1 Defining the Domain — The Home for Your Resources
      • 2.2 Defining Resources — Modeling Your Database Declaratively
      • 2.3 Generate the Database with a Single Set of Commands
    • Chapter 3: Actions
      • 3.1 Defining Actions on a Resource
      • 3.2 Creating Records
      • 3.2 Reading Record(s) with Ash.read
      • 3.3 Filter Condition With Ash.Query.filter
      • 3.4 Update Records with Ash.update
      • 3.5 Deleting Record(s) with Ash.destroy
    • 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
      • 5.1 Calculations
      • 5.2 Aggregates
    • Chapter 6: Validations
      • 6.1 Preventing Actions on Expired Invitations
    • Chapter 7: Authorization With Policies
    • Chapter 8: Code Interfaces(Soon)
    • Part 2 - Wire Ash into Phoenix Applications
    • Chapter 9: Wiring Ash into Phoenix
      • 9.1 Ash + Phoenix Controller - Building Public Home Page
      • 9.1.1 Basic Home Page Layout
      • 9.1.2 Loading Categories with Aggregates (Best Practice)
      • 9.2 Ash + Phoenix LiveView – Admin CRUD
    • Chapter 10: LiveView and Real-Time Updates with Ash PubSub
      • 10.1 Enable Ash PubSub Notifications on the Category Resource
      • 10.2 Subscribe to Notifications in LiveView
      • 10.3 Bonus: Even More Efficient Updates (Optional)
    • Chapter 11: Don’t Repeat Yourself (DRY) in Ash
      • 11.1 DRY Your Forms – One Component for Create & Edit
      • 11.2 DRY Your Read Queries with Preparations
      • 11.3 DRY Your Create/ Update Logic with Changes
    • Chapter 12: Authentication
      • 12.1.1 Router Scope for Authentication
      • 12.2 Testing Your Application
      • 12.3 Authorization
    • 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
      • 14.1 Group Permissions
      • 14.2 Create and Edit Access Group Form
      • 14.3 List Access Group
      • 14.4 Assign Access Group Permission
    • Chapter 15: Background Jobs with Oban and Ash — Reliable Email Notifications
      • 15.1 Install Dependencies (Igniter Makes This Easy)
      • 15.2 Create the UserNotification Resource (The Heart of the System)
      • 15.3 Global Notify Function — Call It From Anywhere
      • 15.4 Send Real Emails with Swoosh + Mailtrap
      • 15.6 View & Debug Jobs with Oban Web
    • Chapter 16: CI, and Deployment(Soon)
    • Chapter 17: Understanding Spark and the Extension System
      • 17.1 What Exactly is the AST?
      • 17.2 quote Turns Code into Portable AST Data
      • 17.3 unquote Injects Values (or AST) into a Quoted Block
      • 17.4 What is Spark?
      • 17.6 Key Spark Concepts You Need to Know
    • Chapter 18: Building Your First Ash Extension
      • 18.1 Basic Composition of an Ash Extension
      • 18.2 Start with Just the parent_id Attribute
      • 18.3 Add Relationships and Aggregate
      • 18.4 Usage Example
    • Chapter 19: Make Your Extension Configurable
      • 19.1 Delete Parent With Its Children
    • Chapter 20: Publish Your Extension To the World via Hex.pm
      • 20.1 Create Mix Package
      • 20.2 Move Extension Files to the New Package
      • 20.3 Update the Modules Namespace
      • 20.4 Test the Package Locally with Your Ash Application
      • 20.5 Publishing the Package to Hex.pm
      • 20.6 Adding Package Information
    • Appendix A: Ash Framework Cheat Sheet
      • Setup & Migrations
      • Domain & Resources (minimum)
      • Common Resource Sections
      • CRUD in IEx
      • Query & Filter
      • Relationships (manage_relationship)
      • Common Policy Checks
      • Authorization in Practice
      • Seed Data
      • Useful Ash Modules
    • Acknowledgments

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 earnedover $14 millionwriting, 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.

Learn more about writing on Leanpub