Mix phx.gen.html vs mix phx.gen.schema


Would it better if I used mix phx.gen.html for an app since it creates an HTML and MVC file, vs the phx.gen.schema which only create the Schema what’s the difference with these two.

Tip: the gen.schema is mostly used for API applications with no Phoenix frontend.


when I used mix to create the application it already came with a and MVC so I should just go with mix phx.gen.schema. Because if I went with mix phx.gen.html then it would create another MVC, it’s redundant.

It’s not redundant, it just depends on what you want to do. You’d use it for a new html resource not whatever existing resources you have in your application.

You don’t have to use either, you can make everything manually too. The generators are there to help you and to speed up development.