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.
Secure login with ASP.NET Core Identity
Main dashboard showing all change requests
View all requests with DataTables integration
Create new change request form with validation
Dashboard with request statistics
Admin view with approval management
- 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
- 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
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
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)
- .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
-
Clone the repository
git clone https://github.com/Karinateii/ChangeManagement.git cd ChangeManagement -
Configure User Secrets (Recommended for development)
Navigate to the main project folder:
cd ChangeManagement dotnet user-secrets initSet 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;"
-
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.
-
Restore Dependencies
cd .. dotnet restore -
Apply Database Migrations
dotnet ef database update --project Change.DataAccess --startup-project ChangeManagement
If
dotnet-efis not installed:dotnet tool install --global dotnet-ef
-
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)
- HTTPS:
-
Login
- Use the admin credentials you configured in step 2
- Default role: Admin (full access)
- Configuration Guide - Detailed setup instructions
- Security Documentation - Security features and best practices
- Deployment Guide - Production deployment instructions
- Quick Start Guide - Get up and running in 5 minutes
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
| Policy | Description | Access |
|---|---|---|
| AdminOnly | Administrator access | Full system control |
| EmployeeOnly | Standard employee | Create/view requests |
| AdminOrEmployee | Any authenticated user | Common features |
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"
}
}
}
}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
Standard access including:
- Create new change requests
- View all requests (read-only for others' requests)
- Edit own pending requests
- Track request status
- Log in with employee or admin credentials
- Navigate to Request β Create New Request
- Fill in the form:
- Title: Brief description (5-200 characters)
- Description: Detailed explanation (10-2000 characters)
- Priority: Select Low, Medium, High, or Critical
- Click Submit
- Request is created with "Pending" status
- Log in with admin credentials
- Navigate to Approve section
- Review pending requests
- Click Approve or Not Approve
- Provide approval/rejection reason
- Confirmation saved with timestamp
π Pending β β
Approved
β β Not Approved
- β No Hardcoded Secrets: User Secrets for development, environment variables for production
- β HTTPS Enforcement: Automatic redirection with HSTS headers
- β Security Headers: X-Content-Type-Options, X-Frame-Options, X-XSS-Protection, CSP
- β Input Validation: Server-side validation with data annotations
- β SQL Injection Prevention: Entity Framework parameterized queries
- β XSS Protection: Razor encoding, Content Security Policy
- β CSRF Protection: Anti-forgery tokens on all forms
- β Secure Authentication: Identity Framework with strong password policies
- β Account Lockout: Brute-force attack prevention
- β Secure Cookies: HttpOnly, Secure, SameSite strict
π See SECURITY.md for detailed security documentation
| 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 |
Priority Levels:
- Low
- Medium
- High
- Critical
Status Values:
- Pending (default)
- Approved
- Not Approved
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
# 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 ChangeManagementProblem: Can't login with admin credentials
Solutions:
- Check
logs/changemanagement-YYYYMMDD.txtfor errors - Verify AdminUser secrets are set:
dotnet user-secrets list - Ensure password meets complexity requirements
- Delete and recreate database if needed
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
Problem: Port 5000/7000 already in use
Solution:
# Specify different ports
dotnet run --urls "https://localhost:7001;http://localhost:5001"# 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 ChangeManagementThis 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.
# Login to Azure
az login
# Create resources and deploy
az webapp up --sku B1 --name changemanagement-app --location eastusGET /Request- List all requestsGET /Request/Create- New request formPOST /Request/Create- Submit new requestGET /Request/Edit/{id}- Edit request formPOST /Request/Edit/{id}- Update requestPOST /Request/Delete/{id}- Delete request
GET /Approve- Admin approval dashboardPOST /Approve/ApproveRequest- Approve requestPOST /Approve/NotApproveRequest- Reject request
GET /NotApproved- View rejected requests
All endpoints require authentication. Admin endpoints require Admin role.
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch
git checkout -b feature/AmazingFeature
- Commit your changes
git commit -m 'Add some AmazingFeature' - Push to the branch
git push origin feature/AmazingFeature
- Open a Pull Request
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
Doutimiwei Ebenezer
- GitHub: @Karinateii
- LinkedIn: Doutimiwei Ebenezer
- Email: karinateidoutimiwei@gmail.com
- 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
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!