I've often heard the idea that “the way the application is coded shouldn’t dictate its UI” which is true, but leads people to think that the application architecture should be divorced from the UI, and I don’t think that’s true either. You should first figure out the intended mental model of how the application works, and then from that should flow both the UI and the application architecture.
In my experience, apps that start code-first tend to end up a CRUD apps and require a lot of composition from the end-user; apps that start UI-first tend to generate a lot of exceptional use cases and workarounds. Both give the user a muddy mental model of how the application should work.