gee5plus1
gee5plus1
AEAsh Elixir
Created by Wout on 5/15/2023 in #showcase
Ash Tutorial With Livebook
btw, ignore bulletpoint indentations, can't seem to get them to the same level
58 replies
AEAsh Elixir
Created by Wout on 5/15/2023 in #showcase
Ash Tutorial With Livebook
oh, and I volunteer to test drive the livebooks 😛
58 replies
AEAsh Elixir
Created by Wout on 5/15/2023 in #showcase
Ash Tutorial With Livebook
also, I know it's probably contentious topic, but good practices for solving some of these puzzles would probably be a good thing to. For me, as a beginner, it helps to see the opinions and learn good habits early. Later on I might disagree and take on a different route once I know the toolset but to start with, good habits are long term benefit imho
58 replies
AEAsh Elixir
Created by Wout on 5/15/2023 in #showcase
Ash Tutorial With Livebook
but these topics were at the top of my list to see how similar things can be done in Ash, with Ash mindset
58 replies
AEAsh Elixir
Created by Wout on 5/15/2023 in #showcase
Ash Tutorial With Livebook
There are more where this came from 😉
58 replies
AEAsh Elixir
Created by Wout on 5/15/2023 in #showcase
Ash Tutorial With Livebook
@Wout As discussed, have a look, see if any of it makes sense 😉
58 replies
AEAsh Elixir
Created by Wout on 5/15/2023 in #showcase
Ash Tutorial With Livebook
4. User with Role Two linked resources User and Role, and a set of policies to apply to say Article resource based on the Role queried from datastore. Simple but also expanding on the policies topic with more advanced example.
58 replies
AEAsh Elixir
Created by Wout on 5/15/2023 in #showcase
Ash Tutorial With Livebook
3. Many to Many with metadata Let's consider two standard resources: Article and Image, where there is many-to-many relationship between them, but also the join table has extra fields: - label (string) - order (integer) In such scenario let's consider an article, where every image can optionally have one of the two fields filled. Use cases for this can be as follow: - mark label as 'cover' so the article can display predefined image on a listing page - display article images in predefined order Things to consider for the tutorial part: - the way to load metadata when loading articles (as a list) - the way to load metadata when fetching individual article - for 'cover' use-case add calculation that would populate the cover attribute with Image record if one is present in such collection
58 replies
AEAsh Elixir
Created by Wout on 5/15/2023 in #showcase
Ash Tutorial With Livebook
2. Two separate authentication flows for a single app. Let's consider an appolication composed of 3 pieces of functionality: - standard website - customer area (ash authentication) - backoffice (ash authentication, different strategy) Customer and Operator are treated as separate resources with different auth strategies, both use ash authentication but also both have different styling considerations for built-in sign-in/sign-out pages.
58 replies
AEAsh Elixir
Created by Wout on 5/15/2023 in #showcase
Ash Tutorial With Livebook
1. Mapping resource to external api. Let's assume there is a REST api handling CRUD operations for a collection. Create resource with CRUD support wrapping the external api so internally it can be treated as just another resource, while it's using REST to manage the state. (This in fact could reuse previous tutorials where rest api is being created in Ash - for example, let's say a follow up of Ticket resource from the guide) Things to consider in the scenario: - Authorization headers need to be present - Capturing different rest statuses and mapping to :ok, :error - Transaction support for typical resource with rest based resource - Handling situations where REST api is down
58 replies
AEAsh Elixir
Created by Wout on 5/15/2023 in #showcase
Ash Tutorial With Livebook
As per discussion I'm adding few ideas to consider for more advanced tutorials. These are something I am planning to experiment with and I believe they do touch on more advanced topics but are also quite relatable in the real world so it could be a good resource of inspiration for the community. (Note, as I'm new to the ecosystem I'm not sure how feasible they are from the point of view of what the framework would do, but having gone through initial guides and few additional resources for me these would be the next logical step to try out)
58 replies