willmcgugan / codereviews

Free code reviews for open source projects
113 stars 3 forks source link

[Code Review Request] Mealie - Recipe Manager #19

Open hay-kot opened 2 years ago

hay-kot commented 2 years ago

What is the name of your project? Mealie

What is the repo URL? https://github.com/hay-kot/mealie/tree/mealie-next

Is there anything else I should know about the code? Note that the branch mealie-next differs greatly from the master branch. Please review mealie-next. I'm working through a pretty thorough re-write at the moment to make the code more maintainable. Feel free to review anything in the code base that you please, but the items below are my main concern.

Are there any areas you would like me to focus on? The biggest thing I'd love to get another pair of eyes on is the HttpService class and RouterFactory that I'm using to base services off of. The BaseHttpService class contains the base code I'm using to build other services that are used throughout the life-cycle of a request. There are some utility methods and some abstract methods that are implemented by child classes.

I'm using these base classes in conjunction with a CrudHttpMixin class that contains some common functionality for CRUD operations. The WebhookService shows the most basic implementation of inheriting from both classes.

To establish routes, I feed them into a RouterFactory class that returns an APIRouter with the CRUD routes populated from their definitions on the class. You can see an example of use with the WebhooksSevice here

Part of me feels like I'm taking the best parts of C# API Design in shoving them into FastAPI and the other part of me feels like I'm creating too much cohesion between classes and am going to regret this later.

Any insight or recommendations you have would be greatly appreciated.

Have I reviewed this project previously? No