Coming from Ruby on Rails, the convention is to have a `User` model handle multiple aspects of an account such as login, logout, password reset, and email confirmation. While there is a temptation to bring that convention with us when building an Elixir application, we can do better by leveraging bounded contexts,
Ecto's embedded schemas, and `Ecto.Multi` to break these separate pieces of functionality into isolated chunks that are easier to maintain and extend.
Come on a journey with me as I take a large Elixir `User` module and break it down into smaller, focused modules. We'll employ a test-driven development approach and may even end up with a better database design for managing user accounts in an Elixir application.
For the past decade, Zach has been helping several companies solve problems with software written in a variety of languages and frameworks. Zach is currently a Senior Developer at Viget where he provides custom software solutions for a mix of companies including Dick's Sporting Goods, the Wildlife Conservation Society, and the Privia Health Group.