Welcome to the backend API for the HR Management System, built using ASP.NET Core 9.0. This repository contains the complete API infrastructure that powers the HR platform, designed to efficiently manage employees, handle requests (leaves, salaries), track attendance using geofencing (zones) and QR Codes, manage chat communications, and provide real-time notification capabilities.
The API fully supports multiple distinct roles with tailored levels of authorization:
- Admin: Full access to the system. Handles system-wide settings, user roles, and global oversight.
- HR: Manages employee records, salary slips, deductions, and HR-specific requests.
- Manager: Responsible for assigning tasks to their department's team members, approving leaves, and monitoring departmental attendance.
- Employee: Can view their tasks, submit leave requests, fetch their salary slips, and communicate with co-workers.
- Create, Read, Update, and Delete actions for Employees and Departments.
- Organization tracking by linking employees to specific companies and departments.
- Geo-fencing integration via Zones for checking in and checking out.
- QR code integration (
QRCoder) offering an extra layer for physical attendance verification. - Automated checkout features via optimized background services.
- Inter-employee chat integration with rooms and private direct messages.
- Endpoints fetching chat participants and chatting history, allowing smooth real-time capabilities.
- Salary history tracker that generates historical data and dynamic adjustments.
- Create and approve salary slips that encompass deductions and additional earnings.
- Tasks assignment to employees, with trackable progress statuses.
- Advanced "Request" architecture tailored to handling leave balances, annual days off, and pending approvals.
- Firebase integration: Uses
FirebaseAdminto orchestrate secure and scalable push notifications across different devices. - Mailing: Integration with
MailKitandSendGridfor account verifications, password resets, and critical alerts.
- Framework: .NET 9.0 (ASP.NET Core Web API)
- Database: SQL Server
- ORM: Entity Framework Core 9.0
- Authentication: JWT Bearer Tokens & ASP.NET Core Identity
- Push Notifications: Firebase Admin SDK
- Emails: SendGrid / MailKit
- Documentation: Swagger (Swashbuckle)
The solution uses standard N-Tier MVC guidelines tailored for REST APIs:
- Controllers: Handlers for
Admin,Attendance,Auth,Chat,Employee,HR,Manager,Notification, andZone. - DTOs: Data Transfer Objects structured for specific requests and responses, decoupling database models from public interfaces.
- Models: Defines database entities (User, Department, ChatMessage, SalarySlip, etc.).
- Services: Business logic abstractions (e.g.,
AuthServices,EmailService,FirebaseService,NotificationService). - Data: Houses the
ApplicationDbContextwhere DbSets configure EF Core migrations.
- .NET 9.0 SDK
- SQL Server (Local or hosted)
- A Firebase Service Account key (placed into the project directory as
firebase-admin.json)
- Clone the repository.
git clone https://github.com/yousefzuainat/HR-system-.git
- Open
appsettings.jsonand configureDefaultConnectionproperly for your database underConnectionStrings. Include your JWT secret key and SendGrid configurations as needed. - Validate
firebase-admin.jsonis located in the root or build destination, so push notifications won't raise issues on launch. - Apply the database migrations:
dotnet ef database update
- Run the application:
dotnet run
- Navigate to
https://localhost:<port>/swaggerin your browser to view the OpenAPI endpoints and start interacting with the backend.
This repository represents the independent ASP.NET Web API backend of the HR system.