Skip to content

Modularize api#100

Merged
Benjamin-Nussbaum merged 2 commits into
masterfrom
modular-api
Jul 25, 2025
Merged

Modularize api#100
Benjamin-Nussbaum merged 2 commits into
masterfrom
modular-api

Conversation

@Benjamin-Nussbaum

Copy link
Copy Markdown
Contributor

This commit is just modularization, refactoring will come later

This commit is just modularization, refactoring will come later

@marcosfrenkel marcosfrenkel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The settings import is still the old settings file. Other than that it looks good.

Do we need to have 2 main files? specially since the only thing both of them do is add the other routes.

@Benjamin-Nussbaum

Copy link
Copy Markdown
Contributor Author

This PR just modularizes what was already there from #96, without any further additions or refactoring.

The reason for multiple main files is to enforce separation of concerns. As more api routes are added, there is no need to modify the top level file. When we add web views, we can consolidate them into a single router and have a minimal change in the top level file to include that router.

@marcosfrenkel

Copy link
Copy Markdown
Collaborator

The imports are making the program crash, the old settings.py file doesn't exist anymore

@Benjamin-Nussbaum

Copy link
Copy Markdown
Contributor Author

This structure also follows what I've already set up in the webapp branch according to the full stack FastAPI template.

Comment thread src/pqnstack/app/api/routes/chsh.py Outdated
Comment on lines +11 to +12
from pqnstack.app.settings import settings
from pqnstack.app.settings import state

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be from pqnstack.app.core.config import settings and from pqnstack.app.core.config import state

Comment thread src/pqnstack/app/api/routes/qkd.py Outdated
Comment on lines +11 to +12
from pqnstack.app.settings import settings
from pqnstack.app.settings import state

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same here

from fastapi import HTTPException
from fastapi import status

from pqnstack.app.settings import settings

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

and here

@Benjamin-Nussbaum

Copy link
Copy Markdown
Contributor Author

Should be fixed now

@Benjamin-Nussbaum Benjamin-Nussbaum merged commit 68001af into master Jul 25, 2025
6 checks passed
@Benjamin-Nussbaum Benjamin-Nussbaum deleted the modular-api branch July 25, 2025 21:57
Benjamin-Nussbaum added a commit that referenced this pull request Jul 29, 2025
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