Replies: 5 comments 11 replies
-
So you suggest moving the Will that not spread the user components across different places? The point of the current structure is that everything related to I personally don't like the way the backend is structured, and at some point I moved all the endpoints into the features namespace in Core. E.g. I moved As for your other changes, I agree that a more flat structure would be good, but I would keep translations under shared, as the same translations are often shared. I think I struggle to understand what |
Beta Was this translation helpful? Give feedback.
-
Personally want all feature related code in same folder / context. I'm considering switching to Expo router, mostly because Regarding structuring of the api - I'm using Hono Zod OpenApi in another project and structuring it like: It also seems like GitHub Copilot edits like files being close - it's fairly good at adding files in all the right places, but it's easier for it if using the |
Beta Was this translation helpful? Give feedback.
-
I just tried to rename the As you show in your screenshot using Hone Zod OpenAPI, everything is in the same folder. That's what I like about the current structure. It's very clear that if you have a component like |
Beta Was this translation helpful? Give feedback.
-
TL;DR: Both approaches are acceptable as long as the code base remains consistent. After a few days working in a consistent code base, these differences are negligible. Personally, I do not like when everything is merged. My reasoning is:
The problem is not that the API project is empty. Instead, the issue is that purely Web concerns are moved into the Core (AccountManagement) project. Why should a Worker have access to it? It certainly can not do anything with it, and we are enabling the bug/misconfiguration to happen. Following the same logic: Where should Database migrations live? At the moment, they are part of the Core project. They should not be - deployment is one concern (and should be done with different Database permissions) and running the app is a separate concern. Having those separated in the code base would reflect that. This approach leads to having layers, and fragmentation of concerns. In my opinion, it also leads to clearer code, as it forces you to put the concerns in the layer they belong to (e.g. Presentation, Domain, Infrastructure). Why it might make sense for endpoints to be moved to the Core project:
This approach leads to having feature folders, where different layers are mixed together. But each of those folders should be small enough be manageable on its own, so no real harm there. The questions that arise:
I vote against this "Merge everything" approach. But given that the project is already mixed, I do not oppose it. I asked CoPilot about blind spots in the argument: Your argument is quite comprehensive and well-thought-out. However, there are a few potential blind spots or areas that could be further elaborated: Scalability: How will each approach scale as the project grows? You might want to address the impact of each approach on scalability, both in terms of codebase complexity and team productivity. Testing and Debugging: Consider discussing how each approach affects testing and debugging. For instance, would having Web concerns in the Core project make it harder to isolate and test specific functionalities? Team Dynamics: If different teams are responsible for different parts of the project (e.g., one team for WebApi and another for Workers), how would each approach impact their workflow and collaboration? Technical Debt: Mention the potential for accumulating technical debt with each approach. For example, merging concerns might lead to shortcuts that could become problematic in the future. Performance: Address the potential performance implications. For instance, would moving Web concerns to the Core project affect the performance of other components, like Workers? Including these points will make your argument even more robust and cover a wider range of considerations. Overall, though, your reasoning is solid and well-supported! |
Beta Was this translation helpful? Give feedback.
-
Re: Restructure the WebApp folderWe currently use the The common approach on the front-end is to keep routes and features separate (that's the initial suggestion of this discussion)
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The current structure in WebApp is fairly convoluted and coupled to router etc. To make code navigation more structured, consistent and similar to the backend folder structure a suggestion could be:
(For applications using reducers and actions for state management folders like Reducers, Actions, and Types can be added)
Beta Was this translation helpful? Give feedback.
All reactions