📁 Technologies Used
- Spring Boot
- Spring Web
- Spring Data JPA
- H2 Database (in-memory for simplicity)
🔧 Step-by-Step Guide
✅ Step 1: Add Dependencies in pom.xml
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency> <dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
✅ Step 2: Create the Student Entity
✅ Step 3: Create the Repository
public interface StudentRepository extends JpaRepository<Student, Long> {
}
✅ Step 4: Create the Controller
✅ Step 5: Application Properties
✅ API Endpoints
HTTP Method |
Endpoint |
Action |
POST |
/students |
Create a student |
GET |
/students |
Get all students |
GET |
/students/{id} |
Get student by ID |
PUT |
/students/{id} |
Update student |
DELETE |
/students/{id} |
Delete student |