Best practices From data model To liveview application using generators?

Hi
I’m new to elixir. I’ve watched/read some tutorials.

I’m looking for the best ways to put a data model into ecto and start using liveview.
I’ve read about phx.gen.live is this the best way?

I’ve got a model with multiple associations (nothing special)

Do I have to add them all in ecto first and then put them in liveview? I’d rather the generators generate all of them. I can always remove views later on.
Do you have to manually make changes to postgresql or does ecto & migrations the basic things?

I’ve found some resources but they might be outdated?

Have you read the guides on the Phoenix and Phoenix LiveView hexdocs?

Have a play with the generators for both dead and live views and study the files that they generate.

You could run the auth generator which (I’m pretty sure) will give you examples of migrations and schemas with associations.

The migrations that you write/generate will make all the changes to the database. You want to manage all db changes through your migrations.

Yes, you need to write/generate the ecto schemas before you can use them.

It’s impossible for anyone to know if the unnamed resources that you’ve found are outdated.

1 Like

I’ve read some and am still reading others.

I’ve used the auth generator.