A comprehensive ASP.NET Core MVC application for managing sales leads with role-based access control, automatic lead expiry, and customer conversion tracking.
- Custom user authentication with ASP.NET Identity
- Three role levels:
- Organization Admin: Full access to all features
- Group Admin: Manage leads within their sales group
- Sales Rep: View and manage only their assigned leads
- Register new leads with complete contact information
- Duplicate prevention (same phone/email blocked for 90 days)
- Automatic 90-day expiry tracking
- Color-coded urgency indicators (Critical, High, Medium, Low)
- Lead status tracking (New, Contacted, Qualified, Proposal, Negotiation, Converted, Lost, Expired)
- Leads must be converted within 90 days
- Automatic expiry after 90 days if not converted
- One-time 90-day extension available (Organization Admin only)
- Real-time statistics and metrics
- Pending vs Converted leads tracking
- Days remaining before expiry
- Critical and high-priority alerts
- Recent leads overview
- Conversion rate analytics
- Converted leads become customer records
- Track conversion metrics (days to convert)
- Search and filter capabilities
- Role-based visibility
- Create and manage sales groups
- Assign group administrators
- Track group performance
- Upload documents to a lead (any authenticated role)
- Download documents for a lead (any authenticated role)
- Files stored securely in Amazon S3
- No delete capability by design (audit-friendly)
- Framework: ASP.NET Core 8.0 MVC
- Database: Entity Framework Core with SQL Server
- Authentication: ASP.NET Core Identity
- UI: Bootstrap 5, Bootstrap Icons
- Pattern: Code-First Approach with EF Core Migrations
- .NET 8.0 SDK or later
- SQL Server or SQL Server LocalDB
- Visual Studio 2022 or VS Code
cd c:\Users\SivaSekharNalluri\Desktop\DirxNewSitecd LeadManagementPortal
dotnet restoreEdit appsettings.json to change the connection string if needed:
{
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=LeadManagementDB;Trusted_Connection=True;MultipleActiveResultSets=true"
}
}dotnet ef migrations add InitialCreatedotnet ef database updatedotnet runThe application will start at https://localhost:5001 (or the port shown in console)
- In
LeadManagementPortal/appsettings.Development.json(preferred) or environment variables, set the following underAwsStorage:
{
"AwsStorage": {
"AccessKeyId": "YOUR_ACCESS_KEY",
"SecretAccessKey": "YOUR_SECRET_KEY",
"Region": "us-east-1",
"BucketName": "your-bucket",
"KeyPrefix": "",
"UsePathStyle": false
}
}-
Ensure the S3 bucket exists and the IAM user/key has permissions:
s3:PutObject,s3:GetObject,s3:ListBucketfor that bucket. -
Build and run; navigate to a Lead Details page to upload/download docs.
Organization Admin:
- Email:
admin@leadportal.com - Password:
Admin@123
- AspNetUsers - User accounts with Identity
- AspNetRoles - User roles
- SalesGroups - Sales team groups
- Leads - Lead records with tracking
- Customers - Converted customer records
- Users belong to Sales Groups
- Leads are assigned to Users
- Leads belong to Sales Groups
- Customers reference original Leads
LeadManagementPortal/
├── Controllers/ # MVC Controllers
│ ├── AccountController.cs
│ ├── DashboardController.cs
│ ├── LeadsController.cs
│ ├── CustomersController.cs
│ ├── SalesGroupsController.cs
│ └── UsersController.cs
├── Models/ # Domain Models
│ ├── ApplicationUser.cs
│ ├── Lead.cs
│ ├── Customer.cs
│ └── SalesGroup.cs
├── Data/ # Database Context
│ ├── ApplicationDbContext.cs
│ └── SeedData.cs
├── Services/ # Business Logic
│ ├── LeadService.cs
│ ├── CustomerService.cs
│ ├── SalesGroupService.cs
│ ├── DashboardService.cs
│ └── LeadExpiryBackgroundService.cs
├── Views/ # Razor Views
│ ├── Account/
│ ├── Dashboard/
│ ├── Leads/
│ ├── Customers/
│ ├── SalesGroups/
│ ├── Users/
│ └── Shared/
└── wwwroot/ # Static Files
├── css/
└── js/
- Background service runs hourly to check for expired leads
- Leads automatically marked as expired after 90 days
- Organization Admin can grant one-time 90-day extension
- Expired leads become available for re-registration
Organization Admin:
- View all leads and customers
- Create sales groups
- Add/manage users
- Grant lead extensions
- Change lead status
Group Admin:
- View leads in their sales group
- Manage group members
- Cannot modify restricted fields
Sales Rep:
- View only assigned leads
- Register new leads
- Convert leads to customers
- Cannot change lead status
- System checks phone and email before registration
- Blocks duplicate registration within 90 days
- Checks both active leads and recent customers
- Allows re-registration after lead expiry or 90 days post-conversion
GET /Dashboard/Index- View dashboard
GET /Leads/Index- List all accessible leadsGET /Leads/Details/{id}- View lead detailsGET /Leads/Create- Show create formPOST /Leads/Create- Create new leadGET /Leads/Edit/{id}- Show edit formPOST /Leads/Edit/{id}- Update leadPOST /Leads/Convert/{id}- Convert to customerPOST /Leads/GrantExtension/{id}- Grant 90-day extension (Admin only)
GET /Customers/Index- List all customersGET /Customers/Details/{id}- View customer details
GET /SalesGroups/Index- List all groupsGET /SalesGroups/Create- Show create formPOST /SalesGroups/Create- Create new groupGET /SalesGroups/Edit/{id}- Show edit formPOST /SalesGroups/Edit/{id}- Update group
GET /Users/Index- List all usersGET /Users/Create- Show create formPOST /Users/Create- Create new user
The LeadExpiryBackgroundService runs every hour to automatically expire old leads. Configure the interval in LeadExpiryBackgroundService.cs:
await Task.Delay(TimeSpan.FromHours(1), stoppingToken);Configure password requirements in Program.cs:
options.Password.RequireDigit = true;
options.Password.RequireLowercase = true;
options.Password.RequireUppercase = true;
options.Password.RequireNonAlphanumeric = false;
options.Password.RequiredLength = 6;If you encounter database connection errors:
- Ensure SQL Server LocalDB is installed
- Check the connection string in
appsettings.json - Run migrations again:
dotnet ef database update
To reset database:
dotnet ef database drop
dotnet ef migrations remove
dotnet ef migrations add InitialCreate
dotnet ef database update- Email notifications for expiring leads
- Advanced reporting and analytics
- Lead assignment automation
- Activity logging and audit trail
- Import/Export functionality
- Mobile responsive improvements
- API endpoints for external integration
This project is created for demonstration purposes.
For issues or questions, please refer to the project documentation or contact the development team.
This repository includes a dedicated browser compatibility suite under tests/browser.
- Blocking parity workflow:
.github/workflows/browser-parity.yml - Advisory quality workflow (a11y + lighthouse):
.github/workflows/browser-quality-advisory.yml - Optional deployed smoke probes (same advisory workflow) when
SALESREPPORTAL_BASE_URLis set in repo variables
Local execution from repo root:
npm --prefix tests/browser ci
npx --prefix tests/browser playwright install --with-deps
npm --prefix tests/browser run test:parity