Comments (5)
I'm also spending some time thinking about the best layout, and I have been thinking along similar lines. It could make it much easier to add more resources. A different approach we're looking into is using a template to generate all these files in their respective directories. But the templating approach would work in either case.
from full-stack-fastapi-template.
I agree with this point -- I think the current organization makes it harder to build composable units of functionality (e.g., an auth system) that can be reused since you need to grab files from many places. (But maybe that's more of an issue of not being more intentional about it at the outset.)
I'm not sure what the ideal organization is -- you'd probably still want a place to put endpoints, etc., that touch multiple resources. But I think this point is definitely worth considering.
from full-stack-fastapi-template.
Thanks for the discussion here!
Yeah, for some cases where sections are clearly separated it would probably be better to have them separated by the specific feature/resource.
But there are also many use cases that require references across different parts of the application, for example "add user John's note to the board X", should the crud utils for that live under "notes", "boards", "users"?
And if another of the components needs to access the same utils, would it import them from that external component? How would one decide on which component to put that logic, so that when other team members come looking for that, they also find it instead of re-implementing it in the other component?
Of course, there are many use cases that would benefit from your proposed structure, and the current one wouldn't be ideal for them, but it would probably still "work". Nevertheless, the new structure would probably make some use cases more cumbersome.
That's also why I've tried to keep this project relatively simple so that you can remove entire sections easily and add your preferred style. That's also why I haven't made any of the code in this project available as a third-party package or similar, because I don't think it's the "best" solution, or that it would apply for all the use cases, but it's a somewhat acceptable starting point 🤷 😅
In fact, I think I would like to simplify some parts of this project, to make it easier to discard and/or refactor entire sections, to simplify the Docker Compose files, even if that means some duplication, etc.
from full-stack-fastapi-template.
Yeah, it would be nice to be able to easily generate resources in a modularity-oriented set of files. On that note, I would be especially interested in something that could generate pydantic and sqlalchemy models together! Or at least, an XCreate and XInDB model from a sqlalchemy model X (default behavior: all fields optional on the Create, all fields required on the InDB).
from full-stack-fastapi-template.
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.
from full-stack-fastapi-template.
Related Issues (20)
- How to start the backend server without using docker?
- FASTAPI
- Dependency injection of crud items
- AttributeError: module 'app.db.engine' has no attribute '_run_ddl_visitor' HOT 1
- How can I override my JWT auth dependency in the endponits in FastAPI testing?
- How do I get this running on local? HOT 3
- Deploying on a machine with nginx HOT 1
- Why React, not Vue?
- Mac M1 Docker error HOT 4
- Bad Gateway returned HOT 3
- [Improvement] Replace Prettier and Eslint with Biome and add pre-commit hooks HOT 1
- Feature Request: Support for GitHub Codespaces Deployment and Development HOT 2
- Login error in Dashboard HOT 5
- Secrets should not be versioned by default HOT 3
- Enable discussion on this repo? HOT 1
- Support the use of dev containers for reproducible dev environment HOT 1
- Embracing Technological Evolution: A Journey Toward Innovation
- Debug Launch Configuration for "Debug Frontend: (...)" does not work on WSL
- Z
- Running task 1 of 1: python .copier/update_dotenv.py /bin/sh: 1: python: not found HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from full-stack-fastapi-template.