A simple CRUD API built with Spring Boot and MongoDB.
This project is a Spring Boot application that provides a CRUD (Create, Read, Update, Delete) API for managing student records stored in a MongoDB database.
- Create a new student record
- Retrieve all student records
- Update an existing student record
- Delete a student record
-
Clone the repository:
git clone https://github.com/GLRandula/SpringBoot-MongoDB-CRUD-API.git cd SpringBoot-MongoDB-CRUD-API
-
Configure MongoDB: Ensure you have MongoDB installed and running on your local machine or configure the connection to your MongoDB instance in the
application.properties
file. -
Build the project:
mvn clean install
-
Run the application:
mvn spring-boot:run
Once the application is running, you can interact with the API using tools like Postman or cURL.
-
Create a student:
POST /api/v1/student/save
-
Get all students:
GET /api/v1/student/getall
-
Update a student:
PUT /api/v1/student/edit/{id}
-
Delete a student:
DELETE /api/v1/student/delete/{id}
-
Get a student by ID:
GET /api/v1/student/search/{id}
Contributions are welcome! Please open an issue or submit a pull request for any changes.