Nested data structures the Phoenix way?

Hey all!

I‘m currently learning Phoenix and Elixir. My day job is working on the frontend side of things with React.

For fun, I started building a project management app for craftsmen. Different companies should use it. They‘d have projects, a calendar, overview of the latest changes,…

There’s a nested data structure that I have on the project detail page and I‘d love to get some advice on how to „think“ of this in a Phoenix-Elixir-way.

Each project has phases, each phase has tasks and each task can have appointments. I‘ve got all of these in separate data tables (another thing I never touched - data modeling on the db level :sweat_smile:) which seems to be the correct way to do it, quite a few belongs_to in there as well.

When I think about this from the UI side of things, my hunch is to add a form for „add task“ as a LiveComponent. I could of course do all of this at once in a single LiveView and render some nested data structure with different events for different forms. Or could I? Coming from Remix, I‘m used to thinking in nested routes, but that‘s unfortunately not a thing in Phoenix from what I understood so far.

Since I have almost no experience with all of this besides a few tutorials, I would love to get some feedback on how people handle these scenarios. Nested data structures have to be common scenarios, no?

Appreciate any thoughts and hints on this.