I like to design systems in that order :
1. my data model ( database schema ), because it gives you good questions to ask regarding the business side of your problem and let you go very deep just by asking « for each a, how many bs can we get »
2. my external api. Because it requires you to « dumb down » your problem, and see which part of your model you want to expose and how.
3. I actually start coding my business process, and then bind them to the model on one end and api on the other
If i were to use code generation tool, it would need to generate both the db and the api stubs, together with the correct information exposure. I’m not aware of any tool that would let you do that.