fastapi / full-stack-fastapi-template

Full stack, modern web application template. Using FastAPI, React, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more.
MIT License
27.95k stars 5k forks source link

♻️ Refactor the API #1382

Closed justin-p closed 1 month ago

justin-p commented 1 month ago

This PR changes the following

tiangolo commented 1 month ago

Thanks for the interest! I see this has lots of changes packed in a single PR. It would be better to separate each atomic suggestion in an independent PR that can be individually reviewed.

I see a lot of the changes are new CRUD functions, an older version of this project had lots of them, and I actually did put a lot of effort into refactoring it to remove all the extra complexity. :sweat_smile:

Also, the docstrings depend on the specific format, I would prefer to use what I use for FastAPI, and right now I would rather not have docstirngs in these functions yet.

Also, separating models into files can lead to complex logic to handle imports, references, cyclic imports, etc. So I prefer to have the simplest structure possible and allow people to refactor and evolve as needed, you can read more about that in the SQLModel docs.

For now I'll pass on this one, but thanks for the effort! :coffee: