Skip to content

volkanvanlioglu/HelpDeskApp

Repository files navigation

HelpDeskApp

HelpDeskApp is a role-based help desk portal built with .NET 10, Blazor, ASP.NET Core Identity, Entity Framework Core, and SQL Server. It supports ticket creation, assignment, status tracking, file attachments, notifications, analytics, and administrative management from a single web application.

Overview

The application is designed for three main user groups:

  • System administrators who manage users, roles, ticket metadata, notification preferences, reminder rules, and audit logs.
  • Department users who work tickets, update statuses, assign ownership, and monitor operational dashboards.
  • Clients who create and follow their own tickets.

The UI is implemented as a Blazor web app with interactive server rendering. Identity, application services, persistence, and minimal API endpoints are hosted in the same project.

Key Features

Ticket management

  • Create tickets with:
    • title
    • description
    • priority
    • category
    • type
    • optional attachments
  • Automatic fallback title when no title is provided, using the format Ticket yyyyMMdd-HHmmss
  • Title limited to 200 characters
  • Description limited to 4000 characters
  • Up to 5 attachments per ticket during creation
  • Ticket due dates calculated from configurable priority reminder settings
  • Ticket list filtering by:
    • priority
    • category
    • type
    • status
    • assignee
    • text search
  • Ticket ordering by common fields such as created date, title, status, category, type, and assignee
  • Default page size of 10, with support for 5, 10, 20, 50, 100, or all
  • Ticket detail page with:
    • status updates
    • assignment and unassignment
    • conversation thread
    • attachment preview and download
    • activity safeguards for closed/cancelled tickets

Notifications

  • In-app notification center
  • Unread count badge in the navigation menu
  • Mark individual notifications read or unread
  • Mark all notifications read or unread
  • Search and order notifications
  • Ticket-linked notifications that can open the related ticket
  • Department-user notifications on ticket creation and updates
  • Creator notifications when a ticket is updated
  • Assignee notifications when a ticket is assigned

Dashboard and analytics

  • Summary metrics for:
    • total tickets
    • completed tickets
    • pending tickets
    • cancelled tickets
  • Charts for:
    • priority distribution
    • status distribution
    • category distribution
    • type distribution
    • assignee workload
    • daily trend
  • Deadline calendar with clickable ticket cards
  • Year and month navigation in the calendar
  • Assignee display with full name and email where available

Administration

  • Role creation and deletion
  • User role assignment
  • Ticket category management
  • Ticket type management
  • Department user notification preference management
  • Priority reminder settings management
  • User department/title editing
  • Safe delete for users
  • Audit log browsing with search, ordering, and paging

Security and access control

  • ASP.NET Core Identity authentication
  • Role-based authorization for pages and APIs
  • Client users restricted to their own tickets and attachments
  • Department-user assignment limited to users in the DepartmentUser role

Technology Stack

  • .NET 10
  • Blazor Web App with Interactive Server rendering
  • ASP.NET Core Identity
  • Entity Framework Core 10
  • SQL Server
  • Blazor Bootstrap 3.5.0
  • Bootstrap 5.3.3
  • Chart.js

Architecture

The solution follows a layered structure inside a single web project.

Application layer

Located under Application/.

Contains:

  • common result and paging models
  • DTOs used by UI and APIs
  • service interfaces
  • repository and unit of work abstractions

Domain layer

Located under Domain/.

Contains:

  • business entities such as Ticket, TicketMessage, TicketAttachment, UserNotification, and AuditLog
  • enums such as TicketStatus and TicketPriority
  • security constants such as role names and policy names

Infrastructure layer

Located under Infrastructure/.

Contains:

  • dependency injection registration
  • security helpers and seed logic
  • persistence implementations
  • service implementations for tickets, admin, notifications, dashboard, roles, auth, and users
  • minimal API endpoints for help desk operations and attachment access

UI layer

Located under Components/.

Contains:

  • Blazor pages
  • layouts
  • shared components
  • account and identity pages

Data layer

Located under Data/.

Contains:

  • ApplicationDbContext
  • ApplicationUser
  • EF Core migrations

Project Structure

HelpDeskApp/
├── Application/
├── Components/
│   ├── Account/
│   ├── Layout/
│   ├── Pages/
│   └── Shared/
├── Data/
├── Domain/
├── Infrastructure/
├── Properties/
├── wwwroot/
├── Program.cs
├── appsettings.json
└── README.md

Rendering and Runtime Model

The app uses Razor Components with interactive server rendering.

Startup highlights:

  • AddRazorComponents().AddInteractiveServerComponents()
  • AddBlazorBootstrap()
  • MapRazorComponents<App>().AddInteractiveServerRenderMode()
  • automatic EF Core migration execution on startup
  • seed execution after migration

The root app shell loads:

  • Bootstrap CSS
  • Blazor Bootstrap CSS and JS
  • Chart.js
  • Blazor runtime script
  • reconnect modal support

Authentication and Authorization

Identity is configured with:

  • required confirmed accounts
  • role support
  • default token providers
  • identity cookies

Password policy requires:

  • minimum length of 8
  • uppercase letter
  • lowercase letter
  • digit
  • non-alphanumeric character

Authorization policies include:

  • ManageRoles -> SystemAdmin
  • ManageTickets -> SystemAdmin, DepartmentUser
  • ViewDashboard -> SystemAdmin, DepartmentUser, Client

Roles

Role Purpose
SystemAdmin Full administrative access, ticket management, dashboard, user and metadata management
DepartmentUser Operational ticket handling, assignment, status updates, dashboard access
Client Creates tickets and views only their own ticket data

Seed Data

On startup, the app seeds:

  • roles: SystemAdmin, DepartmentUser, Client
  • a default administrator
  • base ticket categories and types

Seeded administrator

  • Email: admin@helpdesk.local
  • Password: Admin#12345

Change this password immediately outside local development.

Seeded metadata

Categories:

  • Software
  • Hardware

Types:

  • Application Bug
  • Access Request
  • Laptop Issue
  • Peripheral Support

Configuration

Connection string

Configured in appsettings.json:

  • ConnectionStrings:DefaultConnection

Default value points to local SQL Server:

  • Server=.;Database=HelpDeskApp;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True

Logging

Configured via standard Logging:LogLevel settings.

Launch profiles

Defined in Properties/launchSettings.json:

  • HTTP: http://localhost:5041
  • HTTPS: https://localhost:7086

User secrets

The project has a configured UserSecretsId, so environment-specific secrets can be moved out of source-controlled settings.

Getting Started

Prerequisites

  • .NET 10 SDK
  • SQL Server or SQL Server Express
  • Visual Studio 2026 or compatible tooling

Setup

  1. Clone the repository.
  2. Update appsettings.json or user secrets with a valid SQL Server connection string.
  3. Restore dependencies:
    • dotnet restore
  4. Run the application:
    • dotnet run
  5. The app will:
    • apply EF Core migrations automatically
    • seed roles, admin account, and initial metadata
  6. Sign in with the seeded administrator account.

Important Development Notes

Database migrations

The application runs Database.MigrateAsync() during startup. This means pending migrations are applied automatically when the app launches.

Confirmed account behavior

Identity requires confirmed accounts, but the app uses IdentityNoOpEmailSender, which does not send real emails. In development, the seeded admin account is the most reliable first login path. For newly registered users, you may need to confirm accounts through development workflows or direct database/admin actions.

File storage

Ticket attachments are stored on disk under:

  • App_Data/attachments

Attachment metadata is stored in the database, while binary files are stored in the application content root.

Core Pages and Workflows

Home (/)

  • Authenticated landing page
  • Links users to the dashboard

Dashboard (/dashboard)

  • Available to authenticated users with dashboard access
  • Shows metric cards and charts
  • Includes the deadline calendar
  • Uses Chart.js through Blazor Bootstrap chart components

Tickets (/tickets)

For SystemAdmin and DepartmentUser.

Capabilities:

  • create tickets
  • browse all visible tickets
  • filter, search, order, and page results
  • open details of a selected ticket
  • switch to the personal ticket view

My Tickets (/my-tickets)

For all authenticated users.

Capabilities:

  • create tickets
  • browse the user-focused ticket list
  • filter, search, order, and page results
  • open ticket details

Ticket Details (/tickets/{ticketId})

Central workflow page for an individual ticket.

Capabilities:

  • view ticket summary and attachments
  • preview eligible attachments inline
  • download attachments
  • assign or remove department-user assignees
  • update ticket status
  • post messages in the conversation thread

Rules enforced here and in services:

  • cancelled tickets cannot be updated further
  • closed/cancelled tickets disable operational actions
  • only department users can be assigned
  • client-only users can open only their own tickets

Notifications (/notifications)

  • view notification inbox
  • search by title/message
  • sort notifications
  • mark read/unread
  • bulk mark all read/unread
  • navigate to the related ticket if one exists

Admin (/admin)

For SystemAdmin only.

Sections include:

  • roles
  • user role assignment
  • ticket categories
  • ticket types
  • department user notification preferences
  • priority reminder settings
  • user department/title maintenance
  • safe delete user
  • audit log viewer

Business Rules

Ticket statuses

Defined in Domain/Enums/TicketStatus.cs:

  • Open
  • InProgress
  • Waiting
  • Closed
  • Cancelled

Ticket priorities

Defined in Domain/Enums/TicketPriority.cs:

  • Low
  • Medium
  • High
  • Critical

Priority reminder behavior

When a ticket is created, a due date is calculated from priority reminder settings. If no custom rule exists, default fallback days are used by the ticket service.

Cancellation rules

Cancelled tickets are treated as locked:

  • status changes are blocked unless remaining cancelled
  • messaging is blocked
  • assignment updates are blocked
  • dashboards count cancelled tickets separately and also include them in completed totals

Notification preference behavior

Department-user notification preferences are category/type based.

Behavior:

  • if preferences exist for a category/type, only matching department users are notified
  • if no specific preferences exist, all department users are eligible for department notifications

Data Model Summary

ApplicationUser

Extends Identity user data with:

  • first name
  • last name
  • department
  • title
  • created timestamp
  • active flag

Ticket

Main help desk record containing:

  • title
  • description
  • status
  • priority
  • creator
  • assigner
  • category
  • type
  • due date
  • timestamps
  • soft-delete flag

Related ticket entities

  • TicketAssignee
  • TicketMessage
  • TicketHistory
  • TicketAttachment
  • TicketCategory
  • TicketType

Administrative/supporting entities

  • UserNotification
  • DepartmentUserNotificationPreference
  • PriorityReminderSetting
  • AuditLog

API Endpoints

The app exposes authenticated minimal API endpoints under:

  • /api/helpdesk

Key routes include:

Tickets

  • GET /api/helpdesk/tickets
  • GET /api/helpdesk/tickets/{ticketId}
  • POST /api/helpdesk/tickets
  • PATCH /api/helpdesk/tickets/{ticketId}/status
  • POST /api/helpdesk/tickets/{ticketId}/assignees/{assigneeUserId}
  • DELETE /api/helpdesk/tickets/{ticketId}/assignees/{assigneeUserId}
  • GET /api/helpdesk/tickets/{ticketId}/messages
  • POST /api/helpdesk/tickets/{ticketId}/messages

Attachments

  • GET /api/helpdesk/attachments/{attachmentId}
  • GET /api/helpdesk/attachments/{attachmentId}?inline=true

Notes:

  • all help desk API routes require authentication
  • management routes additionally require the ManageTickets policy
  • client-only users are restricted from downloading attachments that do not belong to their own tickets

UI Libraries and Styling

The app uses:

  • Bootstrap for layout and standard UI
  • Blazor Bootstrap for components such as confirm dialogs, charts, and toast notifications
  • custom styles in wwwroot/app.css

Navigation Summary

Main navigation includes:

  • Dashboard
  • Tickets
  • My Tickets
  • Notifications
  • Admin
  • Account
  • Logout

Navigation items are role-aware. For example, the Tickets link is shown only to SystemAdmin and DepartmentUser, and the Admin link is shown only to SystemAdmin.

Audit and Traceability

Administrative actions are recorded in the audit log with:

  • user id
  • user name
  • action text
  • IP address
  • timestamp

Audit data is viewable from the Admin page with search, ordering, and pagination.

Known Operational Characteristics

  • The project currently contains no dedicated automated test project in the main build.
  • Attachment files under App_Data/attachments are environment-local and should be handled carefully in deployments.
  • New registrations may need manual confirmation support in development because the configured email sender is a no-op implementation.

Recommended Next Steps for Production Hardening

  • replace the no-op email sender with a real provider
  • move secrets and connection strings to secure environment configuration
  • review seeded credentials and disable development defaults
  • add automated tests for service and UI workflows
  • add centralized logging/monitoring
  • add attachment antivirus/content validation if required by policy
  • define backup and retention policies for uploaded files and database records

License / Ownership

No license file is currently documented in the repository. Add the appropriate license and ownership details if this project will be shared externally.

About

Enterprise help desk app sample

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors