A comprehensive backend API built with Spring Boot and JPA to manage Employees, Departments, Projects, and Insurance details in an organization.
src/
└── main/
└── java/
└── com/backend/Backend/
├── model/
│ ├── Department.java
│ ├── Employee.java
│ ├── Insurance.java
│ └── Project.java
└── resources/
└── application.properties
- Java 17+
- Spring Boot 3.x
- Spring Data JPA
- Hibernate
- H2 / MySQL Database
- Maven
-
🧑💼 Employee
- 🔁 Many-to-One → Department
- 🔁 Many-to-Many
↔️ Project - 🔁 One-to-One → Insurance
-
🏢 Department
- 🔁 One-to-Many ← Employees
-
🧾 Project
- 🔁 Many-to-Many
↔️ Employees
- 🔁 Many-to-Many
-
🛡 Insurance
- 🔁 One-to-One ← Employee
| Method | Endpoint | Description |
|---|---|---|
| GET | /employees |
Get all employees |
| POST | /employees |
Create new employee |
| GET | /departments |
Get all departments |
| POST | /projects |
Assign project to employees |
| GET | /insurance/{empId} |
Get employee insurance info |
(Depends on controller implementation)
./mvnw spring-boot:runor
mvn spring-boot:runOpen in browser: http://localhost:8080
- Fully annotated JPA Entity models
- Relationships: One-to-Many, Many-to-Many, One-to-One
- Auto schema generation (
ddl-auto=update) - Configurable DB via
application.properties
Made with ❤️ by Dinuki Prarthana
🔗 GitHub: @Dinuki
Licensed under the MIT License.
© 2025 Dinuki Prarthana