Skip to the content.

Architecture Overview

Issue Tracker follows Clean Architecture principles to ensure separation of concerns, maintainability, and testability.

High-Level Architecture

┌─────────────────────────────────────────────────────────┐
│                     Presentation Layer                  │
│                  (IssueTracker.UI)                      │
│              Blazor Components & Pages                   │
└────────────────────┬────────────────────────────────────┘
                     │
                     ▼
┌─────────────────────────────────────────────────────────┐
│                   Application Layer                      │
│                 (IssueTracker.Services)                 │
│            Business Logic & Use Cases                    │
└────────────────────┬────────────────────────────────────┘
                     │
                     ▼
┌─────────────────────────────────────────────────────────┐
│                     Domain Layer                         │
│               (IssueTracker.CoreBusiness)               │
│           Entities, Interfaces, Models                   │
└────────────────────┬────────────────────────────────────┘
                     │
                     ▼
┌─────────────────────────────────────────────────────────┐
│                 Infrastructure Layer                     │
│                (IssueTracker.PlugIns)                   │
│             Data Access & External Services              │
└─────────────────────────────────────────────────────────┘

Layer Responsibilities

1. Presentation Layer (IssueTracker.UI)

Purpose: User interface and user interaction

Contains:

Dependencies:

Key Principles:

2. Application Layer (IssueTracker.Services)

Purpose: Application business logic and orchestration

Contains:

Dependencies:

Key Principles:

3. Domain Layer (IssueTracker.CoreBusiness)

Purpose: Core business models

Contains:

Dependencies:

Key Principles:

4. Infrastructure Layer (IssueTracker.PlugIns)

Purpose: External concerns and data persistence

Contains:

Dependencies:

Key Principles:

Data Flow

Example: Creating a New Issue

User Input (UI)
    │
    ▼
Blazor Component validates input
    │
    ▼
Calls IssueService.CreateIssueAsync()
    │
    ▼
Service validates business rules
    │
    ▼
Calls IIssueRepository.CreateAsync()
    │
    ▼
MongoDb Repository saves to database
    │
    ▼
Returns result up the chain
    │
    ▼
UI updates and displays confirmation

Key Design Patterns

1. Repository Pattern

Abstracts data access behind interfaces:

// In CoreBusiness (interface)
public interface IIssueRepository
{
    Task<Issue> CreateAsync(Issue issue);
    Task<Issue?> GetByIdAsync(string id);
    Task<List<Issue>> GetAllAsync();
    // ...
}

// In PlugIns (implementation)
public class IssueRepository : IIssueRepository
{
    private readonly IMongoCollection<Issue> _collection;
    // Implementation details...
}

2. Dependency Injection

All dependencies are injected:

public class IssueService
{
    private readonly IIssueRepository _repository;
    
    public IssueService(IIssueRepository repository)
    {
        _repository = repository;
    }
}

3. Service Layer Pattern

Business logic is encapsulated in services:

public class IssueService : IIssueService
{
    public async Task<Issue> CreateIssueAsync(Issue issue)
    {
        // Validate
        // Apply business rules
        // Persist
        // Return result
    }
}

Technology Stack

Frontend

Backend

Data Access

Testing

Project Organization

src/
├── CoreBusiness/
│   └── IssueTracker.CoreBusiness/
│       ├── Models/              # Domain entities
│       ├── Contracts/           # Repository interfaces
│       ├── Enum/               # Enumerations
│       └── Helpers/            # Domain utilities
│
├── PlugIns/
│   ├── IssueTracker.PlugIns/
│   │   ├── DataAccess/         # MongoDB repositories
│   │   └── Contracts/          # Infrastructure interfaces
│   │
│   └── IssueTracker.PlugIns.Mongo/
│       └── ...                 # Future: additional providers
│
├── Services/
│   └── IssueTracker.Services/
│       ├── Issue/              # Issue-related services
│       ├── User/               # User management
│       ├── Comment/            # Comment services
│       ├── Category/           # Category services
│       └── Status/             # Status services
│
└── UI/
    └── IssueTracker.UI/
        ├── Components/         # Reusable components
        ├── Pages/             # Routable pages
        └── Shared/            # Shared layouts

Benefits of This Architecture

1. Testability

2. Maintainability

3. Flexibility

4. Scalability

Dependency Rules

The dependency flow is strictly enforced:

UI → Services → CoreBusiness
      ↓
    PlugIns → CoreBusiness

Core Rule: Dependencies point inward (toward the domain)