This is my personal implementation of the original MoneyPit project by Christian Alexander.
Original Project: ChristianAlexander/money_pit
I created this version as a hands-on learning experience to deepen my understanding of Ash Framework and some Ash extensions. This repository represents my journey of learning through practice, implementing features and exploring different approaches while building upon Christian's excellent foundation.
A demonstration of AshStateMachine - the state machine extension for the Ash Framework.
This e-commerce application showcases how to build robust, stateful business processes with automatic state transitions, validation, and background job integration.
-
** Order State Transitions** - Orders flow through states:
created→paid/failed→ready_for_refund→refunded -
** Automatic State Validation** - Invalid state transitions are prevented at the framework level
-
** Background Job Integration** - State changes trigger background jobs using AshOban
-
** Real-time Updates** - UI updates automatically as orders transition through states.
-
** Policy Integration** - Authorization rules based on current state (e.g., only admins can refund
paidorders)
-
📦 Install dependencies and set up the database:
mix setup
This will:
-
Install Elixir dependencies
-
Set up the database with migrations
-
Create seed data with demo products and users
-
Install and build frontend assets
-
-
▶️ Start the Phoenix server:iex -S mix phx.server
-
🌐 Visit the application:
-
Main site:
localhost:4000 -
Storefront:
localhost:4000/storefront(requires login) -
Orders:
localhost:4000/orders(requires login)
-
-
** Regular User:**
[email protected]/password123 -
** Admin User:**
[email protected]/password123
-
** Basic Plan** - $9.99
-
** Pro Plan** - $19.99
-
** Max Plan** - $199.00
-
Ash State Machine - State machine extension
-
Ash Framework - Declarative application framework
-
AshOban - Background job processing
-
Phoenix LiveView - Real-time web interfaces
-
Ash Authentication - Authentication system
-
Ash Money - Money type and currency handling