Pro-Sales is a Customer Relationship Management (CRM) backend built with ASP.NET Core Web API and .NET 8.
The system is designed to help organizations manage customers, businesses, sales activities, deals, communication, users, and sales performance through a structured RESTful API.
The project focuses on building a realistic business-oriented backend while applying common architectural and software development patterns in ASP.NET Core.
Pro-Sales provides a centralized platform for managing customer relationships and sales activities.
The system supports different roles within the organization, allowing users such as managers, moderators, and sales representatives to perform operations according to their responsibilities.
The main business areas include:
- Customer management
- Business management
- Sales and deal management
- Calls
- Meetings
- Messages
- Interests
- Lead/source tracking
- User profiles
- Authentication
- Role-based authorization
- Sales reporting
- Filtering and searching
- Email communication
The system provides functionality for managing customers and businesses and maintaining the relationships between them.
Core models include:
- Customers
- Businesses
- Interests
- Sources
Sales representatives can manage sales activities and deals throughout the customer relationship process.
The system includes:
- Deal management
- Sales activities
- Sales representatives
- Customer interactions
- Sales tracking
The CRM provides several mechanisms for recording and managing customer communication:
- Calls
- Meetings
- Messages
These activities allow sales teams to keep track of their interactions with customers and prospects.
The API includes authentication and role-based access control.
Different roles are represented within the application, including:
- Manager
- Moderator
- Sales Representative
- User
The API contains dedicated controllers and services for authentication, profiles, and role-specific operations.
The project contains a dedicated reporting area for generating business and sales-related statistics.
Current report models include:
- Daily reports
- Global statistics
- Sales representative reports
This provides a foundation for analyzing sales activity and performance.
The project includes filtering functionality for retrieving data based on different criteria.
Filtering is implemented as a reusable service rather than embedding all filtering logic directly into controllers.
The application contains a mailing service responsible for handling email-related operations.
This can be used for communication and account-related workflows.
The solution is separated into three main projects:
Pro-Sales/
β
βββ CRM/
β βββ Controllers/
β βββ Extensions/
β βββ Properties/
β βββ Program.cs
β βββ appsettings.json
β
βββ CRM.Core/
β βββ Consts/
β βββ Custom Attributes/
β βββ Dtos/
β βββ Filters/
β βββ Helpers/
β βββ Interfaces/
β βββ Models/
β βββ Reports/
β βββ Services/
β βββ Settings/
β βββ IUnitOfWork.cs
β
βββ CRM.Infrastructure/
βββ Data/
βββ Migrations/
βββ Repositories/
βββ UnitOfWork.cs
The repository's current structure confirms this separation between the API layer, core/application logic, and infrastructure/data-access concerns.
CRM.Core contains the application's central models, DTOs, abstractions, services, reports, helpers, and other reusable components.
The current model layer includes:
ApplicationUserBusinessCallCustomerDealInterestMeetingMessageSourceVerificationCode- Authentication-related models
The project uses DTOs to separate API contracts from internal models.
Examples include DTOs for:
- Customers
- Calls
- Actions
- Authentication
- Other CRM operations
Business/application operations are organized into dedicated services.
Current service implementations include:
- Authentication service
- Filter service
- Mailing service
- Manager service
- Moderator service
- Reporting service
- Sales service
- Shared service
- User profile service
This keeps controllers focused primarily on HTTP/API responsibilities while moving application operations into dedicated services.
The infrastructure layer contains the application's persistence implementation.
It includes:
- Entity Framework Core
ApplicationDbContext- Repository implementations
- Unit of Work
- Database migrations
The project also defines repository abstractions in the Core layer, keeping the application code separated from concrete data-access implementations.
The CRM project contains the ASP.NET Core Web API entry point and controllers.
Current controllers include:
AuthControllerManagerControllerModeratorControllerReportsControllerSalesRepControllerSharedControllerUserProfileController
The API layer is responsible for exposing the CRM functionality through HTTP endpoints.
Reporting is separated into its own area within the Core project.
Current report types include:
DailyReport
GlobalStat
SalesRepresentativeReport
These reports provide information that can be used to understand sales activity and overall business performance.
| Technology | Purpose |
|---|---|
| C# | Programming language |
| .NET 8 | Runtime and platform |
| ASP.NET Core Web API | REST API |
| Entity Framework Core | ORM / data access |
| SQL Server | Relational database |
| JWT / Authentication | User authentication |
| ASP.NET Core Authorization | Role-based access |
| Repository Pattern | Data-access abstraction |
| Unit of Work | Transaction coordination |
| DTOs | API/application data transfer |
| Swagger / OpenAPI | API exploration and documentation |
The API/presentation layer.
CRM/
βββ Controllers/
βββ Extensions/
βββ Properties/
βββ Program.cs
βββ appsettings.json
The application's core layer.
CRM.Core/
βββ Consts/
βββ Custom Attributes/
βββ Dtos/
βββ Filters/
βββ Helpers/
βββ Interfaces/
βββ Models/
βββ Reports/
βββ Services/
βββ Settings/
The infrastructure and persistence layer.
CRM.Infrastructure/
βββ Data/
βββ Migrations/
βββ Repositories/
βββ UnitOfWork.cs
Make sure you have installed:
- .NET 8 SDK
- SQL Server
- Git
git clone https://github.com/Mahmoud-Mshrf/Pro-Sales.gitNavigate into the project:
cd Pro-SalesRestore the dependencies:
dotnet restoreBuild the solution:
dotnet buildConfigure the SQL Server connection string in:
CRM/appsettings.json
Then apply the Entity Framework Core migrations:
dotnet ef database updatedotnet run --project CRMOnce the application starts, use the configured API/Swagger endpoint to explore the available endpoints.
The API includes authentication functionality through the dedicated authentication controller and service.
A typical flow is:
Client
β
βΌ
Authentication
β
βΌ
JWT / Identity
β
βΌ
Authenticated Request
β
βΌ
Role-Based Authorization
β
βΌ
CRM Endpoint
Different parts of the CRM can then be protected according to the user's role and responsibilities.
The project demonstrates several backend development concepts and patterns:
Provides an abstraction over data-access operations.
Coordinates multiple repository operations and database persistence.
Services and infrastructure components are registered and resolved through ASP.NET Core's dependency injection system.
DTOs are used to define explicit data contracts between the API and the application.
Application operations are organized into dedicated services instead of placing all business logic inside controllers.
Different users can access functionality according to their assigned roles.
Pro-Sales was developed as a practical backend project to apply ASP.NET Core concepts in a realistic CRM/business domain.
Rather than implementing only simple CRUD operations, the project explores how different backend components work together:
HTTP Request
β
βΌ
Controller
β
βΌ
Service
β
βΌ
Repository / Unit of Work
β
βΌ
Entity Framework Core
β
βΌ
SQL Server
This structure helps separate responsibilities and makes the application easier to understand and maintain.
Through this project, the following areas are practiced:
- ASP.NET Core Web API
- RESTful API development
- Dependency Injection
- Authentication
- Authorization
- Role-based access control
- Entity Framework Core
- SQL Server
- Repository Pattern
- Unit of Work Pattern
- DTOs
- Service Layer
- Database migrations
- Customer relationship management
- Sales management
- Business logic
- Filtering
- Reporting
- Email communication
- API design
Mahmoud Mshrf
.NET Backend Developer focused on C#, ASP.NET Core, Web APIs, and backend architecture.
GitHub: https://github.com/Mahmoud-Mshrf
Pro-Sales is a backend-focused CRM project built to explore how a real business application can be structured using ASP.NET Core and common backend architectural patterns.
The project is continuously evolving as new concepts are learned and existing implementations are improved.
Built with C# and ASP.NET Core.