Skip to content

🔀 Add "Use a main router" advice#5

Open
p1-dta wants to merge 2 commits into
Kludex:mainfrom
p1-dta:main
Open

🔀 Add "Use a main router" advice#5
p1-dta wants to merge 2 commits into
Kludex:mainfrom
p1-dta:main

Conversation

@p1-dta

@p1-dta p1-dta commented Apr 29, 2024

Copy link
Copy Markdown

I think this repository is a good idea!

Here is my first contribution, more oriented around code and file layout than technical stuff. However, this approach has been very helpful to me and teammates over the past few years.

What do you think?

@Kludex

Kludex commented Apr 29, 2024

Copy link
Copy Markdown
Owner

That's not exactly what I would recommend (naming wise).

I prefer to call the directory api/, and have a directory structure where the __init__.py contains the APIRouter, with the prefix based on the directory it is in.

@p1-dta

p1-dta commented Apr 29, 2024

Copy link
Copy Markdown
Author

@Kludex to clarify this point, the fastapi.FastAPI object ("app") is located in project/app.py, and the main router in project/api/__init__.py ? What name would you prefer ? TBH I never took the time to think of a better name. What do you suggest?

@p1-dta

p1-dta commented Jun 12, 2024

Copy link
Copy Markdown
Author

@Kludex bump?

@Kludex Kludex left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I want to include this, because I think what's needed is a more structural advice than just the routing.

But here's my review... I'm nitpicking because I think this repository is supposed to be very opinionated.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
@Kludex

Kludex commented Nov 29, 2024

Copy link
Copy Markdown
Owner

Sorry the delay. It's been hard.

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
@p1-dta

p1-dta commented Dec 2, 2024

Copy link
Copy Markdown
Author

I really like your suggestions, I approved everything.

Sorry the delay. It's been hard.

No worries.

I'm not sure I want to include this, because I think what's needed is a more structural advice than just the routing.

A major issue in software is organization, structure of repository and projects. I consider this, if simple in essence, primordial in order to have a clean, well organized project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants