A simple Student Management CRUD API built with Spring Boot, Spring Data JPA, and MySQL.
- Java 17+
- Spring Boot 3.2.0
- Spring Data JPA (Hibernate)
- MySQL
- Lombok
-
Database Setup:
- Ensure MySQL is running on
localhost:3306. - Create a database named
sms_db(or it will be created automatically if you have permissions). - Update
src/main/resources/application.propertiesif your username/password differs fromroot/root.
- Ensure MySQL is running on
-
Build and Run:
- Using Maven:
mvn spring-boot:run
- Or import the project into IntelliJ IDEA / Eclipse and run
SmsApplication.java.
- Using Maven:
Base URL: http://localhost:8080/api/students
- POST
/api/students - Body:
{ "fullName": "John Doe", "email": "john.doe@example.com", "phone": "1234567890", "branch": "CSE", "yop": 2024 }
- GET
/api/students/{id}
- GET
/api/students?branch=CSE&yop=2024&page=0&size=10 - Params:
branch(optional)yop(optional)page(default 0)size(default 10)sortBy(default id)sortDir(default asc)
- PUT
/api/students/{id} - Body:
{ "fullName": "John Doe Updated", "email": "john.updated@example.com", "phone": "0987654321", "branch": "IT", "yop": 2025 }
- DELETE
/api/students/{id}
- Database credentials are
root/root. - Java 17 or higher is installed.
- Maven is installed or an IDE with Maven support is used.