Phoenix 1.3 generators in umbrella app

Generating a new project in 1.3 gives a nice separation of applications for the web app and the domain (model/repo stuff)

However, when I generated a new json resource it required me to be in an app and put repo stuff in my web app.

Would it be possible to run this at the top level and have the domain stuff go into that app and the web stuff go into that respective app?


mix phx.gen.json Accounts User users name:string

apps/foo gets migrations, accounts dir with schema, account tests, etc
apps.foo_web gets controller, views, etc

I will monkey around with moving directories for now, but I think it would be nice for the generator to know it’s in an umbrella app that has a separate web and domain app and to split the generated stuff across the two. Thoughts?


It’s on the roadmap, stay tuned :slight_smile:


it’ll be very useful / helpful to have this feature!

1 Like