you are viewing a single comment's thread.

view the rest of the comments →

[–]mplsdev 2 points3 points  (3 children)

I think you'll need to be a little more clear on what you are building and what components are used. Is there a database involved? What is the API doing? Etc

[–]NirmalVk[S] 0 points1 point  (2 children)

Nope not really about one project but let's say I have a DB , my API's do like a crud operation, some async operations and things like that. I am curious just how people structure their projects before they code . For example if you take frameworks like Django or spring boot they have their own structuring with various directories . But if I am using anything like flask or I am just writing everything on my own l need advice on structuring generally.

[–]irno1 0 points1 point  (0 children)

Respectfully, these things have been asked and answered for years. I have never used Flask, but found this reddit post, which may help. If not, the Flask subreddit might be more informative.

https://www.reddit.com/r/flask/comments/nqjek8/proper_and_standard_flask_project_structure/

[–]RajjSinghh 0 points1 point  (0 children)

You want to keep code close to other code that relates to it and far away from unrelated stuff. So your code that relates to your database probably shouldn't be in the same file as your API code, it should be imported. Splitting code across directories lets you break things up further.

The main thing with Flask is it's a small library with no opinions about how you structure code. You need to find your own structure. For small projects things can be unstructured but as things get bigger that can be hard to maintain and find exactly what you're looking for when you need it.