Blazor Server architecture for CRUD app that calls REST APIs
Recently built my first Blazor app, and not super happy with the architecture. It is kind of your standard CRUD app. It gets data from 2 different REST APIs.
I tried to do kind of clean architecture as I am more of a backend guy and that is what I am used to. I setup like this. The APIs are external.
- MyApp (Solution)
- MyApp.Application (Project)
- Components
- Components.Layout
- Components.Pages
- Components.Shared
- Configuration
- Security
- Services
- MyApp.Common
- Exceptions
- Constants
- MyApp.Domain (Project)
- Exceptions
- Models
- MyApp.Infrastructure (Project)
- Repositories
- Http
- MyApp.Application (Project)
My issue is that MyApp.Application.Services became kind of a dumping ground. I have a few pages that deal with customers so I ended up making a ICustomerService and CustomerService to put some shared logic and business rules in. Then that gets injected into multiple components where I deal with customers.
Reddit only letting me nest 2 levels of bullets so that is why component namespace is listed ahove like that
I feel like I should organize things around features, like have things under a customer namespace, but having trouble coming up with something that feels .NET like.
Any tips or suggestions would be appreciated. Or it would be super if you could point me at a public repo. My app is low-medium complexity, I don't need/want a high level of abstraction.