This project is a Student Management API developed as part of a classroom exercise. The application provides CRUD functionalities to manage student data such as code, name, course, and CPF.
It was built using Spring Boot with Maven as the build tool, making it simple and robust for educational purposes.
- Create Students: Add new students to the system.
- Read Students: Retrieve the list of all students or a specific student by their code.
- Update Students: Modify student details.
- Delete Students: Remove students from the system.
- Java: Programming language.
- Spring Boot: Framework for building the API.
- Maven: Build and dependency management tool.
- RESTful API: Architecture for the endpoints.
GET /alunos
Response: Returns the list of all students.
GET /alunos/{codigo}
Path variable: codigo - ID of the student
Response: Returns the student details if found, otherwise 404.
POST /alunos
Request body:
{
"nome": "Student Name",
"curso": "Course Name",
"cpf": "CPF"
}Response: Returns the created student with a generated ID. Error: 409 if the CPF already exists.
PUT /alunos/{codigo} Path variable: codigo - ID of the student Request body:
{
"nome": "Updated Name",
"curso": "Updated Course",
"cpf": "Updated CPF"
}Response: Returns the updated student details. Error: 404 if the student is not found.
DELETE /alunos/{codigo} Path variable: codigo - ID of the student Response: Deletes the student if found. Error: 204 if the student is successfully removed.
- Clone the repository.
- Open the project in an IDE such as Eclipse or IntelliJ.
- Ensure you have Java 17+ and Maven installed.
- Run the application using the command:
mvn spring-boot:run
Access the API at http://localhost:8080.
This project was developed as an educational exercise during class and showcases the use of Spring Boot for creating RESTful APIs. It demonstrates basic CRUD operations and simple in-memory storage using a List. No database integration was implemented in this version.
This API was tested using the Thunder Client extension for VS Code. Thunder Client provides a simple and efficient way to test RESTful APIs directly within the VS Code editor, making it easy to send requests and view responses during development.