Open Apmannen opened 3 months ago
Should also comment what every directory's responsibility is. This is the structure I have in mind at the moment, but it's not fully finalized.
https://docs.google.com/presentation/d/1dLPUZMCz4Qs986NKqG-_TKJNOmn4RRrZfc1GUctCZqc/edit?usp=sharing
Maybe merge util and tools? Otherwise, they need a clearer distinction.
I think tools should be independent from the rest of the system, but could be used by most other layers
https://learn.microsoft.com/en-us/aspnet/core/blazor/call-web-api?view=aspnetcore-8.0
To follow the examples here, a service could be called ClientBlogService with HttpClient as parameter. Will not be called from the client though, but from the SSR razor-pages.
Then the controller could call a ServerBlogService to get items from the DB.
Suggestion: rename Component to Views and its related utils/tools/services (ViewServices, ViewUtils).
Or put Components inside a root Views folder and also have services etc. in that Views folder.
I think the popular Clean Architecture example strucutre would suit my project. https://github.com/jasontaylordev/CleanArchitecture/tree/main/src
I think it would suit my project better than the Vertical Slice architecture and the current struture is similar, even though it would be interesting to try out both. The point of this project is to experiment and try out different architectures after all.
A src/Source directory would be benificial either way to keep startups, Files and Scripts
ApiResponse would fit in domain, while the models (called Entities in the link) could be a subdirectory.
Controller could be in a Api parent directory.
I still like the name Communicator, I think it makes the responsibility more clear. Translation Service is not just a communicator though, but maybe that's the problem?
Btw, I'm not sure why I write in English when the site is 100% Swedish.
I should remove ApiUtil. Maybe call it ApiClient? Or have an abstract generic ApiServer/Communicator