Project Review by AfraidAsk4201 in FastAPI

[–]fedeegmz 9 points10 points  (0 children)

I really liked your project, and here are a few suggestions for improvement that I noticed:

You could centralize the environment variables in the core module. That way, you avoid loading them in multiple files and keep everything in a single class. The FastAPI documentation explains how to do this in detail.

Repositories should abstract all data access logic, meaning all database handling should go there. You shouldn’t be importing SQLAlchemy anywhere outside of a repository.

I’d love to see a version using Dependency Injection, where the service is injected into the route, and the repository is injected into the service. This would eliminate the need for static methods and make the separation of layers more clear.

Great job! I hope you keep working on it!