This project is a backend service built using Spring Boot
and Java
. It exposes RESTful API endpoints for managing
resources in a PostgreSQL database
. The application is containerized using Docker
, enabling easy deployment and
scaling.
For Security of endpoints and app, This project implements spring-security
. All endpoints (if required) are secured to
be accessed by only authentic users.
Check out all the documentations of the endpoints from this link below :)
This project is hosted on AWS you can test it from this link below :)
- Java:
opne jdk: v22.0
. - Spring Boot:
v3.3.3
. - PostgreSQL:
v16.0
. - Docker: with
docker-compose v3.0
. - Maven:
v4.0.0
.
- RESTful API endpoints for CRUD operations.
- User authentication and authorization.
- Integration with PostgreSQL for persistent storage.
- Dockerized application for easy deployment.
https://github.com/abhijeet-Bh/hrelix.git
./mvnw clean install
You can run the application using Maven
or Maven-Wrapper
.
- Setup database with Docker
-
Before you run this application, make sure you have database setup, this can be done either of the ways using
Docker
or simply installingPostgreSQL
in your system. -
If you want to use docker install docker in your system and then run the below code, this wi setup database in your local system.
docker-compose up --build
-
Run the Spring Boot application:
./mvnw spring-boot:run -Dspring-boot.run.profiles=dev
The application will start on
http://localhost:8080
.
-
Connect to the PostgreSQL database:
Ensure PostgreSQL is running and configured as per
application.properties
. Create.env
file in the root directory and paste the below configuration.PRODUCTION_DATABASE_URL=<your-db-url> PRODUCTION_DATABASE_USERNAME=<your-db-username> PRODUCTION_DATABASE_PASSWORD=<your-db-password> MAIL_USERNAME=<your-mail-host> MAIL_PASSWORD=<your-mail-password>
-
Run the Spring Boot application:
./mvnw spring-boot:run -Dspring-boot.run.profiles=prod
The application will start on http://localhost:8080
.
Here’s a list of all API endpoints for the HR Management System. These endpoints cover the main functionalities for managing employees, leave requests, payroll, performance reviews, and attendance tracking.
These endpoints handle public-related operations such as health-check
and login
.
HTTP Method | Endpoint | Description | Access Role |
---|---|---|---|
GET | /api/v1/healthz |
Check running status of the backend | OPEN |
GET | /api/v1/auth/login |
Login employee with email and password |
OPEN |
These endpoints handle admin-related operations such as create-new-employee
, change-employee-role
or
delete-an-employee
etc.
HTTP Method | Endpoint | Description | Access Role |
---|---|---|---|
POST | /api/v1/admin/register |
This is to create admin when running this for the first time. |
OPEN |
POST | /api/v1/admin/create-new-employee-with-role |
This is to create new-employee with different roles like HR , EMPLOYEE , ADMIN |
ADMIN |
POST | /api/v1/admin/update-role/{id} |
This is to update roles of the employee. | ADMIN |
Here’s a comprehensive list of possible and useful API endpoints for the HR Management System. These endpoints cover the main functionalities for managing employees, leave requests, payroll, performance reviews, and attendance tracking.
These endpoints handle employee-related operations such as creating, reading, updating, and deleting employee records.
HTTP Method | Endpoint | Description | Access Role |
---|---|---|---|
POST | /api/employees |
Create a new employee | ADMIN, HR |
GET | /api/employees |
Get a list of all employees | ADMIN, HR |
GET | /api/employees/{id} |
Get employee details by ID | ADMIN, HR, EMPLOYEE (self) |
PUT | /api/employees/{id} |
Update employee details | ADMIN, HR |
DELETE | /api/employees/{id} |
Delete an employee | ADMIN, HR |
GET | /api/employees/search |
Search employees by name, department, etc. | ADMIN, HR |
GET | /api/employees/profile |
Get the current logged-in employee’s profile | EMPLOYEE |
These endpoints manage leave applications, approvals, and rejections.
HTTP Method | Endpoint | Description | Access Role |
---|---|---|---|
POST | /api/leaves |
Apply for a leave | EMPLOYEE |
GET | /api/leaves |
Get a list of all leave requests (filtered by status) | ADMIN, HR, EMPLOYEE (self) |
GET | /api/leaves/{id} |
Get leave request details by ID | ADMIN, HR, EMPLOYEE (self) |
PUT | /api/leaves/{id}/status |
Approve or Reject a leave request | ADMIN, HR |
GET | /api/leaves/employee/{empId} |
Get all leave requests of an employee | ADMIN, HR |
GET | /api/leaves/types |
Get available leave types (SICK, ANNUAL, etc.) | ADMIN, HR, EMPLOYEE |
This project is still under development and more endpoints and features will be updated.
Thanks :)