TaskFlow: Modern Task Management with ASP.NET Core and SignalR
Creating a real-time task management web app with ASP.NET Core MVC, Entity Framework, and SignalR for live notifications and collaboration.
Project Overview
TaskFlow is a comprehensive task management web application built with ASP.NET Core MVC that brings modern collaboration features to project management. The application focuses on real-time communication, intelligent notifications, and comprehensive analytics to help teams stay productive and organized.
Core Architecture
The application is built using a modern .NET stack that emphasizes performance, scalability, and maintainability:
Technology Stack
- ASP.NET Core MVC (.NET 9.0) - Modern web framework with excellent performance
- Entity Framework Core - ORM with SQL Server for data persistence
- SignalR - Real-time web functionality for live notifications
- ASP.NET Core Identity - Comprehensive authentication and authorization
- Background Services - Automated task reminders and notifications
- Serilog - Structured logging for monitoring and debugging
Key Features Deep Dive
Real-Time Notifications with SignalR
One of TaskFlow's standout features is its real-time notification system. Using SignalR, users receive instant updates without page refreshes:
// NotificationHub.cs
public class NotificationHub : Hub
{
public async Task JoinUserGroup(string userId)
{
await Groups.AddToGroupAsync(Context.ConnectionId, $"User_{userId}");
}
public async Task SendNotificationToUser(string userId, object notification)
{
await Clients.Group($"User_{userId}")
.SendAsync("ReceiveNotification", notification);
}
} Smart @Mentions System
The comment system includes intelligent @mentions that automatically notify users when they're referenced:
// Comment processing with @mentions
public async Task ProcessComment(string content, int taskId)
{
var mentions = ExtractMentions(content); // Find @user@example.com patterns
foreach (var mention in mentions)
{
var user = await _userManager.FindByEmailAsync(mention);
if (user != null)
{
await _notificationService.CreateMentionNotification(user.Id, taskId);
await _hubContext.Clients.Group($"User_{user.Id}")
.SendAsync("ReceiveNotification", notification);
}
}
} Automated Due Date Reminders
A background service continuously monitors tasks and sends timely reminders:
// Background service for due date monitoring
public class DueDateReminderService : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
await CheckDueDates();
await Task.Delay(TimeSpan.FromHours(1), stoppingToken);
}
}
private async Task CheckDueDates()
{
var dueTasks = await _context.Tasks
.Where(t => t.DueDate.Date == DateTime.Today && !t.IsCompleted)
.Include(t => t.AssignedUser)
.ToListAsync();
foreach (var task in dueTasks)
{
await _notificationService.CreateDueReminderNotification(task);
}
}
} Advanced Task Management Features
Progress Synchronization
TaskFlow maintains consistency between completion status and progress percentage through intelligent synchronization:
// Automatic progress synchronization
public void UpdateTaskProgress(Task task, int progressPercentage)
{
task.Progress = progressPercentage;
// Auto-complete when progress reaches 100%
if (progressPercentage >= 100 && !task.IsCompleted)
{
task.IsCompleted = true;
task.CompletedDate = DateTime.UtcNow;
}
// Reopen task if progress drops below 100%
else if (progressPercentage < 100 && task.IsCompleted)
{
task.IsCompleted = false;
task.CompletedDate = null;
}
} Calendar Integration
The calendar feature provides multiple views and intelligent task creation:
- Month View - Overview of all tasks with color-coded priorities
- Week View - Detailed weekly planning with drag-and-drop
- Quick Add - Click any date to instantly create tasks
- Smart Filtering - Filter by status, priority, category, and assignee
Comprehensive Analytics Dashboard
The analytics system provides actionable insights into team productivity:
- Completion Rates - Track team and individual performance
- Priority Breakdown - Understand workload distribution
- Category Analysis - Identify bottlenecks by task type
- Weekly Trends - Monitor productivity patterns
- Recent Activity - Real-time team activity feed
- Productivity Tips - AI-generated recommendations
Data Management & Import/Export
CSV Integration
TaskFlow supports seamless data exchange through CSV import/export functionality:
// CSV Export with comprehensive data
public async Task<byte[]> ExportTasksToCsv(string userId)
{
var tasks = await _context.Tasks
.Where(t => t.CreatedById == userId)
.Include(t => t.Category)
.Include(t => t.AssignedUser)
.Select(t => new TaskExportDto
{
Title = t.Title,
Description = t.Description,
Priority = t.Priority.ToString(),
Status = t.IsCompleted ? "Completed" : "In Progress",
Category = t.Category.Name,
AssignedTo = t.AssignedUser?.Email,
DueDate = t.DueDate.ToString("yyyy-MM-dd"),
Progress = t.Progress,
CreatedDate = t.CreatedDate.ToString("yyyy-MM-dd HH:mm")
})
.ToListAsync();
return GenerateCsvBytes(tasks);
} Bulk Operations
Efficient bulk operations allow users to manage multiple tasks simultaneously:
- Multi-select UI - Checkbox selection across pages
- Bulk Delete - Remove multiple tasks with confirmation
- Batch Updates - Change status, priority, or assignee for multiple tasks
- Category Migration - Move tasks between categories efficiently
Security & Authentication
ASP.NET Core Identity Integration
TaskFlow leverages ASP.NET Core Identity for comprehensive user management:
// Custom user registration with profile setup
public async Task<IActionResult> Register(RegisterViewModel model)
{
if (ModelState.IsValid)
{
var user = new ApplicationUser
{
UserName = model.Email,
Email = model.Email,
FirstName = model.FirstName,
LastName = model.LastName,
JoinDate = DateTime.UtcNow
};
var result = await _userManager.CreateAsync(user, model.Password);
if (result.Succeeded)
{
await _signInManager.SignInAsync(user, isPersistent: false);
await _notificationService.SendWelcomeNotification(user.Id);
return RedirectToAction("Index", "Dashboard");
}
}
return View(model);
} Authorization & Data Security
- Role-based Access - Different permissions for team members
- Data Isolation - Users only see their assigned or created tasks
- Secure API Endpoints - All endpoints require authentication
- CSRF Protection - Built-in protection against cross-site attacks
Performance Optimizations
Efficient Database Queries
TaskFlow uses optimized Entity Framework queries to ensure fast response times:
// Optimized task loading with selective includes
public async Task<IEnumerable<TaskViewModel>> GetUserTasksAsync(string userId)
{
return await _context.Tasks
.Where(t => t.AssignedUserId == userId || t.CreatedById == userId)
.Include(t => t.Category)
.Include(t => t.AssignedUser)
.Include(t => t.Comments.OrderByDescending(c => c.CreatedDate).Take(3))
.ThenInclude(c => c.User)
.Select(t => new TaskViewModel
{
// Map only required properties
Id = t.Id,
Title = t.Title,
Priority = t.Priority,
DueDate = t.DueDate,
Progress = t.Progress,
CategoryName = t.Category.Name,
AssignedUserName = t.AssignedUser.FirstName + " " + t.AssignedUser.LastName,
RecentComments = t.Comments.Take(3).ToList()
})
.ToListAsync();
} Caching Strategy
- Memory Caching - Cache frequently accessed data like categories
- Response Caching - Cache static content and analytics data
- Database Connection Pooling - Efficient database connection management
Monitoring & Logging
Structured Logging with Serilog
Comprehensive logging helps with debugging and monitoring:
// Structured logging configuration
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Information()
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Console()
.WriteTo.File("TaskFlow/logs/app-.log",
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: 30)
.CreateLogger();
// Usage in controllers
_logger.LogInformation("Task {TaskId} assigned to user {UserId} by {AssignerId}",
taskId, assigneeId, currentUserId); Challenges & Solutions
Real-Time Performance
Challenge: Maintaining real-time performance with multiple concurrent users.
Solution: Implemented efficient SignalR groups and optimized database queries to minimize latency.
Notification Overload
Challenge: Users receiving too many notifications, leading to notification fatigue.
Solution: Added intelligent notification batching and user preference controls for notification types.
Data Consistency
Challenge: Ensuring data consistency between task progress and completion status.
Solution: Implemented automatic synchronization logic and validation rules at the model level.
Future Enhancements
Planned Features
- Mobile App - Native iOS and Android applications
- Advanced Analytics - Machine learning-powered productivity insights
- Integration APIs - Connect with popular tools like Slack, Teams, and Jira
- Time Tracking - Built-in time tracking with reporting
- File Attachments - Attach documents and images to tasks
- Gantt Charts - Visual project timeline management
Technical Improvements
- Microservices Architecture - Split into smaller, focused services
- Redis Caching - Distributed caching for better scalability
- Docker Containerization - Easier deployment and scaling
- API Rate Limiting - Protect against abuse and ensure fair usage
Key Learnings
Real-Time Development
- Connection Management - Proper handling of SignalR connections and groups
- State Synchronization - Keeping client and server state in sync
- Error Handling - Graceful degradation when real-time features fail
User Experience
- Progressive Enhancement - Core functionality works without JavaScript
- Responsive Design - Consistent experience across all devices
- Accessibility - Proper ARIA labels and keyboard navigation
Conclusion
TaskFlow demonstrates how modern .NET technologies can be combined to create powerful, real-time web applications. The integration of SignalR for live updates, background services for automation, and comprehensive analytics creates a task management experience that goes beyond simple to-do lists.
The project showcases the maturity of the .NET ecosystem and how ASP.NET Core MVC remains a solid choice for building feature-rich web applications. The real-time capabilities, combined with robust authentication and comprehensive logging, make TaskFlow a production-ready solution for team collaboration.
Explore TaskFlow
Experience modern task management with real-time collaboration features.