Skip to content

Enterprise-grade Change Management System built with ASP.NET Core 6.0 MVC featuring role-based authorization, comprehensive security, and responsive UI. Implements repository pattern with Entity Framework Core.

License

Notifications You must be signed in to change notification settings

Karinateii/ChangeManagement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

38 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Change Management System

.NET ASP.NET Core Entity Framework License

A secure, enterprise-grade web application for managing organizational change requests built with ASP.NET Core 6.0 MVC. Features role-based authorization, comprehensive security measures, and a responsive user interface for streamlined change management workflows.

πŸ“Έ Screenshots

Login Page Secure login with ASP.NET Core Identity

Dashboard Main dashboard showing all change requests

Request List View all requests with DataTables integration

Create Request Form Create new change request form with validation

Dashboard Analytics Dashboard with request statistics

Admin Dashboard Admin view with approval management

✨ Features

πŸ”’ Security

  • Role-Based Authorization: Admin and Employee roles with policy-based access control
  • Strong Password Policies: Minimum 8 characters with complexity requirements
  • Account Lockout: 5 failed attempts trigger 15-minute lockout
  • CSRF Protection: Anti-forgery tokens on all state-changing operations
  • Security Headers: XSS protection, clickjacking prevention, Content Security Policy
  • Secure Cookies: HttpOnly, Secure, SameSite strict policies
  • Input Validation: Comprehensive server-side and client-side validation
  • SQL Injection Prevention: Entity Framework parameterized queries

🎯 Application Features

  • Request Management: Create, view, update, and delete change requests
  • Status Tracking: Pending, Approved, Not Approved states
  • Priority Levels: Low, Medium, High, Critical classifications
  • Admin Workflow: Approval/rejection with reason documentation
  • Audit Trail: Complete history with dates and submitter information
  • Email Notifications: SMTP-based notifications for status changes
  • Structured Logging: Serilog with daily rolling file logs
  • Responsive Design: Mobile-friendly Bootstrap 5 interface
  • DataTables Integration: Sortable, searchable request lists

πŸ› οΈ Technology Stack

Backend:

  • ASP.NET Core 6.0 MVC
  • C# 10
  • Entity Framework Core 6
  • ASP.NET Core Identity
  • Repository Pattern & Unit of Work

Database:

  • SQL Server / SQL Server LocalDB
  • Entity Framework Migrations

Frontend:

  • Bootstrap 5.3
  • jQuery 3.6
  • DataTables 1.13
  • Font Awesome Icons
  • Responsive Design

Security & Logging:

  • Serilog (Structured Logging)
  • ASP.NET Core Data Protection
  • Identity Framework Authentication

Development Tools:

  • Visual Studio 2022 / VS Code
  • .NET CLI
  • SQL Server Management Studio

πŸ“ Project Structure

ChangeManagement/
β”œβ”€β”€ ChangeManagement/              # 🌐 Main web application
β”‚   β”œβ”€β”€ Controllers/               # MVC Controllers (Home, Request, Approve, etc.)
β”‚   β”œβ”€β”€ Views/                     # Razor views with responsive layouts
β”‚   β”œβ”€β”€ wwwroot/                   # Static files (CSS, JS, images)
β”‚   β”œβ”€β”€ Areas/Identity/            # ASP.NET Core Identity UI
β”‚   β”œβ”€β”€ Program.cs                 # Application startup & configuration
β”‚   └── appsettings.json           # Configuration (non-sensitive)
β”‚
β”œβ”€β”€ Change.DataAccess/             # πŸ’Ύ Data access layer
β”‚   β”œβ”€β”€ Data/                      # DbContext configuration
β”‚   β”œβ”€β”€ Migrations/                # EF Core migrations
β”‚   └── Repository/                # Repository pattern implementation
β”‚       β”œβ”€β”€ IRepository/           # Repository interfaces
β”‚       β”œβ”€β”€ Repository.cs          # Generic repository
β”‚       β”œβ”€β”€ RequestRepository.cs   # Request-specific repository
β”‚       └── UnitOfWork.cs          # Unit of Work pattern
β”‚
β”œβ”€β”€ Change.Models/                 # πŸ“‹ Domain models
β”‚   └── Models/
β”‚       β”œβ”€β”€ ApplicationUser.cs     # Extended Identity user
β”‚       β”œβ”€β”€ Request.cs             # Change request entity
β”‚       └── ErrorViewModel.cs      # Error handling model
β”‚
└── Change.Utility/                # πŸ”§ Shared utilities
    β”œβ”€β”€ EmailSender.cs             # SMTP email service
    └── SD.cs                      # Static definitions (roles, status)

πŸš€ Getting Started

Prerequisites

  • .NET 6.0 SDK or later - Download
  • SQL Server 2019+ or SQL Server LocalDB - Download
  • Visual Studio 2022 or VS Code (optional but recommended)
  • Git for version control

Quick Start

  1. Clone the repository

    git clone https://github.com/Karinateii/ChangeManagement.git
    cd ChangeManagement
  2. Configure User Secrets (Recommended for development)

    Navigate to the main project folder:

    cd ChangeManagement
    dotnet user-secrets init

    Set admin credentials:

    dotnet user-secrets set "AdminUser:Email" "admin@example.com"
    dotnet user-secrets set "AdminUser:Password" "Admin@123456"
    dotnet user-secrets set "AdminUser:Name" "System Administrator"

    Configure database connection:

    dotnet user-secrets set "ConnectionStrings:DefaultConnection" "Server=(LocalDb)\\MSSQLLocalDb;Database=CHANGE;Trusted_Connection=True;TrustServerCertificate=True;"
  3. Configure Email (Optional - for notifications)

    dotnet user-secrets set "EmailSettings:SmtpServer" "smtp.gmail.com"
    dotnet user-secrets set "EmailSettings:SmtpPort" "587"
    dotnet user-secrets set "EmailSettings:SenderEmail" "your-email@gmail.com"
    dotnet user-secrets set "EmailSettings:Username" "your-email@gmail.com"
    dotnet user-secrets set "EmailSettings:Password" "your-app-password"

    πŸ’‘ Tip: For Gmail, use an App Password instead of your regular password.

  4. Restore Dependencies

    cd ..
    dotnet restore
  5. Apply Database Migrations

    dotnet ef database update --project Change.DataAccess --startup-project ChangeManagement

    If dotnet-ef is not installed:

    dotnet tool install --global dotnet-ef
  6. Run the Application

    dotnet run --project ChangeManagement

    The application will start at:

    • HTTPS: https://localhost:7XXX
    • HTTP: http://localhost:5XXX

    (Check console output for exact ports)

  7. Login

    • Use the admin credentials you configured in step 2
    • Default role: Admin (full access)

πŸ“– Additional Documentation

βš™οΈ Configuration

Password Policy

Password requirements enforced:

  • βœ… Minimum 8 characters
  • βœ… At least 1 uppercase letter (A-Z)
  • βœ… At least 1 lowercase letter (a-z)
  • βœ… At least 1 digit (0-9)
  • βœ… At least 1 special character (!@#$%^&*)
  • βœ… Account lockout: 5 failed attempts = 15-minute lockout

Authorization Policies

Policy Description Access
AdminOnly Administrator access Full system control
EmployeeOnly Standard employee Create/view requests
AdminOrEmployee Any authenticated user Common features

Logging Configuration

Logs are written to:

  • Console output (all environments)
  • File: logs/changemanagement-YYYYMMDD.txt (daily rolling)

Configure log levels in appsettings.json:

{
  "Serilog": {
    "MinimumLevel": {
      "Default": "Information",
      "Override": {
        "Microsoft": "Warning"
      }
    }
  }
}

πŸ‘₯ Usage

User Roles

πŸ” Admin

Full system access including:

  • View all change requests
  • Approve or reject requests with reasons
  • Delete requests
  • Set approval dates and admin notes
  • Access to admin dashboard

πŸ‘€ Employee

Standard access including:

  • Create new change requests
  • View all requests (read-only for others' requests)
  • Edit own pending requests
  • Track request status

Creating a Change Request

  1. Log in with employee or admin credentials
  2. Navigate to Request β†’ Create New Request
  3. Fill in the form:
    • Title: Brief description (5-200 characters)
    • Description: Detailed explanation (10-2000 characters)
    • Priority: Select Low, Medium, High, or Critical
  4. Click Submit
  5. Request is created with "Pending" status

Admin Approval Process

  1. Log in with admin credentials
  2. Navigate to Approve section
  3. Review pending requests
  4. Click Approve or Not Approve
  5. Provide approval/rejection reason
  6. Confirmation saved with timestamp

Request Status Flow

πŸ“ Pending β†’ βœ… Approved
         β†’ ❌ Not Approved

πŸ”’ Security Best Practices Implemented

  1. βœ… No Hardcoded Secrets: User Secrets for development, environment variables for production
  2. βœ… HTTPS Enforcement: Automatic redirection with HSTS headers
  3. βœ… Security Headers: X-Content-Type-Options, X-Frame-Options, X-XSS-Protection, CSP
  4. βœ… Input Validation: Server-side validation with data annotations
  5. βœ… SQL Injection Prevention: Entity Framework parameterized queries
  6. βœ… XSS Protection: Razor encoding, Content Security Policy
  7. βœ… CSRF Protection: Anti-forgery tokens on all forms
  8. βœ… Secure Authentication: Identity Framework with strong password policies
  9. βœ… Account Lockout: Brute-force attack prevention
  10. βœ… Secure Cookies: HttpOnly, Secure, SameSite strict

πŸ“– See SECURITY.md for detailed security documentation

πŸ—„οΈ Database Schema

Request Table

Column Type Description Constraints
Id int Primary Key Auto-increment
Title nvarchar(200) Request title Required, 5-200 chars
Description nvarchar(2000) Detailed description Required, 10-2000 chars
Priority nvarchar(50) Priority level Required, Enum
Status nvarchar(50) Current status Nullable, Enum
Date datetime2 Submission date/time Required
SubmittedBy nvarchar(256) Username of submitter Required
AdminReason nvarchar(1000) Admin decision reason Nullable, max 1000 chars
AdminApprovalDate datetime2 Decision timestamp Nullable

Enums

Priority Levels:

  • Low
  • Medium
  • High
  • Critical

Status Values:

  • Pending (default)
  • Approved
  • Not Approved

πŸ› Troubleshooting

Database Connection Issues

Problem: Can't connect to database
Solutions:

  • Verify SQL Server is running
  • Check connection string in user secrets: dotnet user-secrets list
  • Ensure database exists or run migrations
  • For Azure SQL, check firewall rules

Migration Errors

# Remove last migration
dotnet ef migrations remove --project Change.DataAccess --startup-project ChangeManagement

# Add new migration
dotnet ef migrations add MigrationName --project Change.DataAccess --startup-project ChangeManagement

# Update database
dotnet ef database update --project Change.DataAccess --startup-project ChangeManagement

Admin User Not Created

Problem: Can't login with admin credentials
Solutions:

  • Check logs/changemanagement-YYYYMMDD.txt for errors
  • Verify AdminUser secrets are set: dotnet user-secrets list
  • Ensure password meets complexity requirements
  • Delete and recreate database if needed

Email Not Sending

Problem: Email notifications not working
Solutions:

  • Verify SMTP settings in user secrets
  • For Gmail: Use App Password, not regular password
  • Check firewall allows outbound SMTP (port 587/465)
  • Review logs for detailed error messages
  • Email is optional - app works without it

Port Already in Use

Problem: Port 5000/7000 already in use
Solution:

# Specify different ports
dotnet run --urls "https://localhost:7001;http://localhost:5001"

User Secrets Not Loading

# List all secrets
dotnet user-secrets list --project ChangeManagement

# Clear all secrets
dotnet user-secrets clear --project ChangeManagement

# Re-initialize
dotnet user-secrets init --project ChangeManagement

πŸš€ Deployment

This application can be deployed to:

  • ☁️ Azure App Service (Recommended)
  • 🐳 Docker Container
  • πŸ–₯️ Windows Server / IIS
  • 🐧 Linux Server (Ubuntu/Debian) with Nginx

See DEPLOYMENT.md for detailed deployment instructions.

Quick Deploy to Azure

# Login to Azure
az login

# Create resources and deploy
az webapp up --sku B1 --name changemanagement-app --location eastus

πŸ“ API Endpoints

Request Management

  • GET /Request - List all requests
  • GET /Request/Create - New request form
  • POST /Request/Create - Submit new request
  • GET /Request/Edit/{id} - Edit request form
  • POST /Request/Edit/{id} - Update request
  • POST /Request/Delete/{id} - Delete request

Admin Approval

  • GET /Approve - Admin approval dashboard
  • POST /Approve/ApproveRequest - Approve request
  • POST /Approve/NotApproveRequest - Reject request

Not Approved Requests

  • GET /NotApproved - View rejected requests

All endpoints require authentication. Admin endpoints require Admin role.

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/AmazingFeature
  3. Commit your changes
    git commit -m 'Add some AmazingFeature'
  4. Push to the branch
    git push origin feature/AmazingFeature
  5. Open a Pull Request

Contribution Guidelines

  • Follow C# coding conventions
  • Add unit tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting PR
  • Follow security best practices

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘€ Author

Doutimiwei Ebenezer

πŸ™ Acknowledgments

  • ASP.NET Core Team - For the excellent framework and documentation
  • Serilog Contributors - For structured logging capabilities
  • Bootstrap Team - For the responsive UI framework
  • jQuery & DataTables - For enhanced user interactions
  • Stack Overflow Community - For invaluable development support

πŸ“š Learning Resources

This project demonstrates:

  • Clean architecture principles
  • Repository and Unit of Work patterns
  • Identity Framework implementation
  • Entity Framework Core best practices
  • Security-first development approach
  • Responsive web design

Perfect for learning ASP.NET Core MVC development!

πŸ”— Related Projects


⭐ If you found this project helpful, please give it a star!

Built with ❀️ using ASP.NET Core

About

Enterprise-grade Change Management System built with ASP.NET Core 6.0 MVC featuring role-based authorization, comprehensive security, and responsive UI. Implements repository pattern with Entity Framework Core.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published