r/FastAPI • u/gfw- • Oct 17 '24
Question Looking for project's best practices
Hey guys! I'm new to FastAPI and I'm really liking it.
There's just one thing, I can't seem to find a consensus on best practices on the projects I find on Github, specially on the project structure. And most of the projects are a bit old and probably outdated.
Would really appreciate some guiding on this, and I wouldn't mind some projects links, resources, etc.
Thanks! =)
Edit: just to make it clear, the docs are great and I love them! It's more on the projects file structure side.
50
Upvotes
View all comments
Show parent comment
1
u/myroslavrepin Dec 05 '25
I think this template is not the best way to organize it. At the start of my project I had the same concept: making CRUD functions, but I found that when migrating my db table I needed to refactor everything in codebase. So I found a better solution: I am using a class for each table and passing arguments in self.<argument>. This helped me save a lot of time. It looks at the start bit overwhelmed, but when project grows more than 10k lines, it helped so much, I did regret everything thing I have been non organized