Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define project's architecture #4

Closed
pournasserian opened this issue Oct 20, 2023 · 0 comments · Fixed by #116
Closed

Define project's architecture #4

pournasserian opened this issue Oct 20, 2023 · 0 comments · Fixed by #116
Assignees
Labels
documentation Improvements or additions to documentation question Further information is requested
Milestone

Comments

@pournasserian
Copy link
Contributor

pournasserian commented Oct 20, 2023

Architectural Considerations for Building a Headless CMS with ASP.NET Core and Blazor Server App

1. Layered Architecture

Break down the application into distinct layers:

  • Presentation Layer (Blazor Server App): Houses admin dashboard and content management interfaces.
  • Application Layer: User input processing, application logic execution, and user output return.
  • Domain Layer: Business rules, entities, and domain logic definitions.
  • Infrastructure Layer: Manages data access and external system integrations.

2. Clean Architecture

Divide the system into concentric circles emphasizing separation of concerns:

  • Entities: Application's business logic representation.
  • Use Cases: Application-specific business rules.
  • Interface Adapters: Data adaptation between internal and external formats.
  • Frameworks and Drivers: IO operations' home, including Blazor Server App and ASP.NET Core Web APIs.

3. Domain-Driven Design (DDD)

Understanding and modeling the domain:

  • Entities and Value Objects: Main domain objects.
  • Aggregates: Ensure data modification consistency.
  • Repositories: Domain object retrieval interfaces.
  • Domain Events: Capture of domain-specific actions.

4. CQRS

Model separation pattern for reading (query) from updating data (command).

5. API First Development

Prioritize API design considering:

  • Versioning
  • Authentication
  • Authorization

6. Repository Pattern

Data access logic abstraction.

7. Microservices (Optional)

Functionalities segregation strategy:

  • Authentication
  • Content management
  • Media storage

8. Database Choices

  • Relational databases like SQL Server.
  • NoSQL databases like MongoDB or CosmosDB.

9. Blazor Server-Specific Considerations

  • State Management: Efficient state management due to server-based user sessions.
  • Performance: Efficient rendering is paramount.
  • SignalR: Required for real-time web functionalities.

10. Extensibility

Flexible system enhancement with plugin or extension capabilities.

11. Testing

  • Unit Testing: Individual component, service, and repository testing.
  • Integration Testing: Component interaction testing.
  • End-to-End Testing: Full workflow testing.

12. Onion Architecture

Focuses on application's core, separating it from frequently changing modules:

  • Core Layer (Innermost Circle):
    • Entities/Domain Models: Primary data objects.
    • Interfaces: Define contracts for outer layers.
  • Service Layer:
    • Domain Services: Business logic outside entity boundaries.
  • Application Layer:
    • Application Services: Domain object orchestration and infrastructure tasks.
    • DTOs (Data Transfer Objects): Data transmission objects.
  • Infrastructure Layer (Outermost Circle):
    • Repositories: Implement repository interfaces.
    • Factories: For intricate object creation.
    • Services: External services like email and file storage.
  • UI/Web Layer:
    • Controllers/Views/ViewModels: User interface layer.

Key Principles

  • Inner layers define interfaces; outer layers provide implementations.
  • Core remains independent of outer layers.
  • Center the application around an independent object model.

Advantages

  • Separation of Concerns: Clear layers with distinct responsibilities.
  • Maintainability: Enhances maintenance and scalability.
  • Testability: Dependency Inversion Principle fosters easier testing.

Disadvantages

  • Overhead: Can be overwhelming for simple applications.
  • Learning Curve: Takes time for newcomers to master.
@pournasserian pournasserian added the documentation Improvements or additions to documentation label Oct 20, 2023
@pournasserian pournasserian moved this to In Progress in FluentCMS Oct 21, 2023
@pournasserian pournasserian added this to the MVP milestone Oct 21, 2023
@pournasserian pournasserian added the question Further information is requested label Oct 21, 2023
@pournasserian pournasserian linked a pull request Nov 5, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this from In Progress to Done in FluentCMS Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants