Skip to content

volkanvanlioglu/TaskManagementApp

Repository files navigation

TaskManagementApp

TaskManagementApp is a .NET 10 Blazor Web App for managing departments, projects, tasks, and notifications inside a role-based enterprise workspace. The application combines an interactive server-rendered Blazor UI with ASP.NET Core Identity, Entity Framework Core, and SQL Server persistence.

Overview

The application is designed around three main operational roles:

  • Administrator - manages departments, users, roles, and has full visibility across the system.
  • DepartmentManager - works within a department scope, manages department projects and tasks, and reviews workload.
  • DepartmentUser - creates and works on assigned tasks and participates in department projects.

The app includes:

  • a dashboard with live metrics and charts
  • task and project workspaces
  • comments and file attachments for tasks
  • notification inbox and unread badge tracking
  • seeded identity roles and administrator account
  • audit logging for administrative actions

Technology Stack

  • Framework: ASP.NET Core / Blazor Web App on .NET 10 (net10.0)
  • Rendering model: Interactive Server Components
  • UI library: BlazorBootstrap
  • Authentication and authorization: ASP.NET Core Identity with roles
  • Data access: Entity Framework Core 10 with SQL Server
  • Validation: FluentValidation
  • Hosting model: ASP.NET Core web application

Solution Structure

The repository is organized into clear layers:

  • Components/ - Blazor UI, layout, routing, and account pages
  • Contracts/ - service and repository interfaces
  • Data/ - ApplicationDbContext, identity user model, and EF Core migrations
  • Domain/Entities/ - domain entities such as departments, projects, tasks, comments, attachments, notifications, and audit logs
  • DTOs/ - application DTOs used between services and UI
  • Infrastructure/Services/ - business logic for tasks, projects, dashboard, notifications, and administration
  • Infrastructure/Extensions/ - app startup and identity seeding helpers
  • Infrastructure/Middleware/ - custom exception handling middleware
  • wwwroot/ - static assets and uploaded task files

Core Features

Dashboard

The home page provides a role-aware operations dashboard backed by live database queries. It includes:

  • completed, in-progress, overdue, waiting, and total task metrics
  • finished, active, and total project counts
  • department counts and at-risk department indicators
  • task trends over recent days
  • recent activity stream
  • upcoming due dates
  • workload and work-hours charts based on role scope
  • task priority, task status, and project status visualizations

The dashboard adjusts what the user sees based on their assigned role and department membership.

Task Management

Authenticated users can access the task workspace at /tasks.

Supported capabilities include:

  • paged task listing
  • filtering by search text, status, priority, and department where permitted
  • sorting by due date, title, or priority
  • task creation based on role permissions
  • detailed task view at /tasks/{id}
  • task editing, assignee management, comments, and attachments
  • history tracking for task changes

Important workflow rules enforced by the application:

  • tasks cannot be created directly as Completed
  • a task must move to On Review before it can be marked Completed
  • completed tasks can no longer be edited or commented on
  • completed tasks do not allow additional file uploads
  • linked project selection is fixed after task creation

Attachment handling rules:

  • maximum of 5 attachments per task
  • allowed file types:
    • .bmp
    • .jpg
    • .png
    • .pdf
    • .doc
    • .docx
    • .xls
    • .xlsx
    • .txt
  • uploaded files are stored under wwwroot/uploads/tasks/{taskId}

Project Management

Authenticated users can access the project workspace at /projects.

Supported capabilities include:

  • paged project listing
  • filtering by search text, status, and department where permitted
  • project progress tracking
  • project details view at /projects/{id}
  • team member and instructor management
  • creation of tasks directly from a project
  • automatic calculation of project completion progress

Project behavior includes:

  • projects belong to a department
  • projects can include team members and an instructor
  • tasks can be linked to projects
  • a project is marked finished automatically when all linked tasks are completed
  • progress is calculated from linked task completion

Notifications

Authenticated users can access notifications at /notifications.

Features include:

  • database-backed notification list
  • unread count badge in the main layout
  • mark individual notifications as read or unread
  • mark all notifications as read or unread
  • automatic creation of due-soon reminders for tasks due within the next 3 days

Administration

The /admin page is restricted to the Administrator role.

Administrative capabilities include:

  • create, update, and delete users
  • assign departments and roles to users
  • create, update, and delete departments
  • create, update, and delete roles
  • review recent audit log entries

The application seeds these roles automatically at startup if they do not exist:

  • Administrator
  • DepartmentManager
  • DepartmentUser

Security and Authorization Model

The application uses ASP.NET Core Identity and role-based authorization.

Configured policies include:

  • RequireAdministrator
  • RequireManager

Authorization is also enforced in service-layer logic. In practice:

  • Administrators have global access
  • DepartmentManagers are limited primarily to their own department scope, while still being able to review relevant items assigned to them
  • DepartmentUsers are limited to their own created work, assignments, and project participation

Identity features are enabled through the built-in account pages under Components/Account/Pages.

Data Model Summary

The application stores and relates these main entities:

  • ApplicationUser - Identity user extended with first name, last name, display name, active status, and optional department
  • Department - organizational unit with code, description, and optional manager
  • Project - department-owned initiative with instructor, team members, progress, and completion state
  • ProjectTeamMember - membership link between projects and users
  • TaskItem - task record with status, priority, due date, creator, optional project, and assignees
  • TaskAssignment - links tasks to users
  • TaskComment - comments on tasks
  • TaskAttachment - uploaded task files
  • TaskHistory - audit-style activity history for task changes
  • NotificationItem - user notifications
  • AuditLog - administrative audit trail
  • UserSession - persisted session-related data

Application Startup

At startup, the app configures:

  • Razor components with interactive server rendering
  • authentication and Identity cookies
  • ASP.NET Core Identity with roles
  • EF Core SQL Server for ApplicationDbContext
  • IDbContextFactory<ApplicationDbContext> for services that create short-lived contexts
  • BlazorBootstrap UI services
  • FluentValidation task validation
  • memory cache and HTTP context access
  • custom exception handling middleware
  • health endpoint at /health

After the app is built, identity seeding runs automatically to ensure roles and the core administrator account exist.

Configuration

Main configuration lives in appsettings.json.

Connection string

"ConnectionStrings": {
  "DefaultConnection": "Server=.;Database=TaskManagementApp;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True"
}

Security settings

"Security": {
  "JwtTokenMinutes": 60,
  "RefreshTokenDays": 7,
  "MaxFailedLoginAttempts": 5
}

Seed administrator

"SeedUser": {
  "Email": "admin@taskmanagement.local",
  "Password": "Admin123!",
  "DisplayName": "Core Administrator"
}

For real deployments, move secrets and production credentials out of source-controlled settings and into user secrets, environment variables, or a secure secret store.

Prerequisites

Before running the application, ensure you have:

  • .NET 10 SDK
  • SQL Server instance available to the configured connection string
  • Visual Studio 2026 or the .NET CLI

Getting Started

1. Restore dependencies

dotnet restore

2. Apply database migrations

dotnet ef database update

3. Run the application

dotnet run

By default, launch settings define:

  • http://localhost:5177
  • https://localhost:7187

4. Sign in with the seeded administrator account

Use the values from the SeedUser section, unless you changed them in configuration.

Development Notes

EF Core migrations

Migrations are stored under Data/Migrations/. The current migration history shows support for:

  • initial application schema
  • task attachments
  • projects and task review workflow

Health endpoint

A simple health check endpoint is exposed at:

  • /health

It returns a JSON payload indicating application status.

Error handling

The application uses a custom middleware component to log unhandled exceptions and return a JSON 500 response with a generic error message.

Typical User Flows

Administrator

  1. Sign in with the seeded or existing administrator account.
  2. Open /admin to create departments, users, and roles.
  3. Assign managers and department users to departments.
  4. Review dashboard-wide metrics and audit logs.

Department manager

  1. Sign in and open the dashboard.
  2. Review department workload and pending tasks.
  3. Create or update department projects.
  4. Create tasks and assign department users.
  5. Monitor comments, progress, and due dates.

Department user

  1. Sign in and open the task workspace.
  2. Review assigned or self-created tasks.
  3. Add comments and attachments while the task is active.
  4. Move tasks through the workflow, including On Review before completion.
  5. Monitor reminders from the notifications inbox.

Repository Highlights

Key files worth reviewing:

  • Program.cs - application startup, service registration, middleware, and endpoint mapping
  • Data/ApplicationDbContext.cs - EF Core model and table configuration
  • Infrastructure/Extensions/IdentitySeedExtensions.cs - role and administrator seeding
  • Infrastructure/Services/TaskService.cs - task workflow, permissions, attachments, and notifications
  • Infrastructure/Services/ProjectService.cs - project management and progress calculations
  • Infrastructure/Services/DashboardService.cs - dashboard analytics and role-aware summaries
  • Infrastructure/Services/NotificationService.cs - notification loading and due-soon reminders
  • Components/Pages/ - primary Blazor pages for dashboard, tasks, projects, notifications, and admin management

Current Limitations and Considerations

  • The default seeded administrator password is suitable only for local development.
  • Uploaded files are stored on the web server file system under wwwroot/uploads.
  • Authorization rules are implemented both at page level and service level, so future changes should keep those layers aligned.
  • The project currently targets SQL Server specifically through UseSqlServer.

License

See LICENSE.txt for license details.

About

Enterprise Task and Project Management App sample

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors