Open leferrad opened 1 year ago
Some pros I found:
Some cons on the other hand:
Maybe it would be convenient to specify entities + relationships in a config file (e.g. YAML file), so the prompt will ask for that config file to generate the template based on that. Otherwise, it is not nice to specify everything in a prompt (as a developer, I like to have everything well defined in a config file)
I was thinking a lot about this, and my conclusion was the next one: Adding the ability to automatically generate more entities without taking into account their relationship doesn't make any sense, it adds overall complexity and little to no value. Maybe we can consider making another script to generate these isolated entities from the CLI (after the cookie-cutter was executed and the architecture was all set up) with something like ./scripts/generate_entity.py --user
and this creates the same structure as the original first entity
but for the user
entity.
That said, the best of all worlds would be generating a whole architecture from an entity-relationship diagram
so we have there all the models, the entities, and how their relationships are, but I can't think of a solution to generate all this structure at once.
I guess we should start sharing the template and see what the community says about it and what they suggest to evolve this
@leferrad suggested checking https://github.com/koxudaxi/fastapi-code-generator it seems promising
Opening a discussion about pros / cons of this template allowing the user to create more than just 1 entity