A comprehensive REST API backend system for managing employee performance evaluations, goals, and activities. Built with ASP.NET Core 8.0, featuring Azure AD authentication, MySQL database integration, and a clean architecture pattern.
- Overview
- Features
- Technology Stack
- Architecture
- Getting Started
- API Endpoints
- Configuration
- Database
- Authentication & Authorization
- Logging
- CI/CD
- Project Structure
This backend system provides a robust API for managing performance evaluations in an organization. It enables administrators and employees to track goals, monitor activities, and conduct annual performance reviews with a comprehensive workflow management system.
- Employee Management: Maintain employee records with department assignments
- Performance Evaluations: Create and manage annual performance evaluations
- Goal Tracking: Define, track, and manage employee goals with different categories and statuses
- Activity Management: Associate activities with goals to track progress
- Role-Based Access Control: Secure API endpoints with Azure AD authentication and role-based authorization
- Soft Delete: Preserve data integrity with soft delete functionality
- Pagination: Efficient data retrieval with paginated responses
- β RESTful API architecture
- β Azure AD integration for authentication
- β Entity Framework Core with MySQL
- β Repository pattern for data access
- β Service layer for business logic
- β DTOs for request/response mapping
- β Global exception handling middleware
- β CORS configuration
- β Swagger/OpenAPI documentation
- β Structured logging with Serilog
- β Soft delete implementation
- β Audit fields (CreatedBy, UpdatedBy, DeletedBy, etc.)
- β Azure Pipelines CI/CD integration
- Framework: ASP.NET Core 8.0
- Database: MySQL (via Pomelo.EntityFrameworkCore.MySql)
- ORM: Entity Framework Core 8.0.13
- Authentication: Microsoft Identity Web 3.9.2 (Azure AD)
- Logging: Serilog.AspNetCore 9.0.0 with MySQL sink
- Documentation: Swashbuckle.AspNetCore 8.1.2
- CI/CD: Azure DevOps Pipelines
The project follows a clean architecture with clear separation of concerns:
βββ Controllers/ # API endpoints
βββ Services/ # Business logic layer
βββ Repositories/ # Data access layer
βββ Models/ # Domain models and DTOs
βββ Interfaces/ # Service and repository contracts
βββ Data/ # DbContext and database configuration
βββ Middleware/ # Custom middleware (Exception, CORS)
βββ Extensions/ # Extension methods for configuration
βββ Utils/ # Helpers, constants, enums, mappers
βββ Configurations/ # Dependency injection setup
- Repository Pattern: Abstracts data access logic
- Service Pattern: Encapsulates business logic
- DTO Pattern: Separates API contracts from domain models
- Dependency Injection: Loosely coupled components
- Middleware Pattern: Cross-cutting concerns (logging, exceptions)
- .NET 8.0 SDK
- MySQL Server 8.0 or higher
- Azure AD App Registration (for authentication)
- Clone the repository:
git clone https://github.com/yourusername/performance_evaluation_system_BE.git
cd performance_evaluation_system_BE- Restore NuGet packages:
dotnet restore-
Configure
appsettings.json:- Set up MySQL connection string
- Configure Azure AD settings
- Configure Serilog settings
-
Run database migrations (if using EF migrations):
dotnet ef database update- Build and run the project:
dotnet build
dotnet run --project PACE/PACE.csprojThe API will be available at https://localhost:5001 (or configured port).
- Access Swagger documentation:
Navigate to
https://localhost:5001/swaggerto explore the API endpoints.
GET /api/Employees- Get paginated list of employees (Admin only)GET /api/Employees/{id}- Get employee by IDPOST /api/Employees- Create new employeePUT /api/Employees/{id}- Update employeeDELETE /api/Employees/{id}- Soft delete employee
GET /api/Evaluations- Get paginated list of evaluations (Admin only)GET /api/Evaluations/withgoals/{employeeid}- Get evaluation with goals by employee ID and yearPOST /api/Evaluations/all- Create evaluations for multiple employees (Admin only)PUT /api/Evaluations/idemployee/{employeeid}- Update evaluation (Admin only)
GET /api/Goals/{id}- Get goal by IDPOST /api/Goals- Create new goalPUT /api/Goals/{id}- Update goalDELETE /api/Goals/{id}- Soft delete goal
GET /api/Activities/{id}- Get activity by IDPOST /api/Activities- Create new activityPUT /api/Activities/{id}- Update activityDELETE /api/Activities/{id}- Soft delete activity
Note: All endpoints require authentication. Some endpoints have role-based restrictions (Admin/User).
Key configuration sections:
{
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"ClientId": "your-client-id",
"TenantId": "your-tenant-id"
},
"ConnectionStrings": {
"AppConnection": "server=...;user=...;database=...;port=...;password=...;"
},
"Serilog": {
// Logging configuration
}
}For production, use environment variables or Azure Key Vault to store sensitive configuration.
Employee (1) βββ (N) Evaluation
Evaluation (1) βββ (N) Goal
Goal (1) βββ (N) Activity
- Employees: Employee information with department assignment
- Evaluations: Annual performance evaluations with feedback
- Goals: Employee goals with categories, types, and status tracking
- Activities: Activities associated with goals to track progress
All entities implement soft delete functionality with:
IsActiveflagDeletedByandDeletedOnaudit fields- Automatic filtering of deleted records
The API uses Azure AD for authentication:
- Azure AD Integration: Microsoft Identity Web
- Roles:
Admin: Full access to all endpointsUser: Limited access to employee-specific data
- Token Validation: Automatic token validation via middleware
- Authorization: Role-based authorization on controllers
- Register application in Azure AD
- Configure redirect URIs
- Set up API permissions
- Configure app roles (Admin, User)
Structured logging implemented with Serilog:
- Sinks: Console and MySQL
- Log Levels: Configurable per namespace
- Enrichment: Machine name, thread ID, context
- Storage: Logs stored in MySQL database
Configure log levels in appsettings.json under the Serilog section.
Azure DevOps Pipeline configured for automated deployment:
- Trigger: Push to
mainbranch - Build: .NET build and publish
- Deploy: Automatic deployment to Azure Web App (Linux)
- Runtime: .NET Core 8.0
Pipeline file: azure-pipelines.yml
PACE/
βββ Controllers/ # API Controllers
β βββ ActivitiesController.cs
β βββ EmployeesController.cs
β βββ EvaluationsController.cs
β βββ GoalsController.cs
β βββ ErrorsController.cs
β
βββ Services/ # Business Logic
β βββ ActivityService.cs
β βββ EmployeeService.cs
β βββ EvaluationService.cs
β βββ GoalService.cs
β βββ UserService.cs
β
βββ Repositories/ # Data Access
β βββ ActivityRepository.cs
β βββ EmployeeRepository.cs
β βββ EvaluationRepository.cs
β βββ GoalRepository.cs
β
βββ Models/ # Domain & DTOs
β βββ ActivityModels/
β βββ EmployeeModels/
β βββ EvaluationModels/
β βββ GoalModels/
β βββ CommonModels/
β
βββ Data/
β βββ PaceDbContext.cs
β
βββ Middleware/
β βββ ExceptionMiddleware.cs
β βββ CorsMiddleware.cs
β
βββ Utils/
β βββ Constants/
β βββ Enums/
β βββ Helpers/
β βββ Mappers/
β
βββ Configurations/
βββ DependencyInjection.cs
βββ ServiceConfiguration.cs
Contributions are welcome! Please feel free to submit a Pull Request.
This project is private and owned by CGC. All rights reserved.
Developed by CGC
β If this project has been useful to you, consider giving it a star on GitHub.