This project is a simple Student Management System built with Spring Boot and MongoDB. It provides basic CRUD operations for managing student records.
- Java 21
- Spring Boot 3.3.1
- MongoDB
- Docker
- Maven
- JUnit 5
- Mockito
Before you begin, ensure you have met the following requirements:
- JDK 21 installed
- Maven installed
- Docker and Docker Compose installed
- Git installed
To get this project up and running on your local machine, follow these steps:
- Clone the repository:
git clone https://github.com/NCherfaoui/student-management.git
cd student-management
- Start MongoDB using Docker Compose:
docker-compose up -d
- Build the project:
mvn clean install
- Run the application:
mvn spring-boot:run
The application will start and be available at http://localhost:8080.
- GET
/api/students
: Retrieve all students - GET
/api/students/{id}
: Retrieve a specific student by ID - POST
/api/students
: Create a new student - PUT
/api/students/{id}
: Update an existing student - DELETE
/api/students/{id}
: Delete a student
To create a new student:
POST http://localhost:8080/api/students
Content-Type: application/json
{
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"age": 20
}
To run the unit tests, execute the following command:
mvn test
src/main/java/com/nc/studentmanagement
: Contains the main application codecontroller
: REST controllersmodel
: Data modelsrepository
: Database repositoriesservice
: Business logicconfig
: Configuration classes
src/test/java/com/nc/studentmanagement
: Contains the test classes
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.