- This is a CRUD demo project that demonstrates basic Create, Read, Update, and Delete (CRUD) operations using MongoDB on the cloud.
- The following video demonstrates how to interact with the application:
- Left window: Using Swagger UI to perform CRUD operations.
- Right window: MongoDB Compass to validate the CRUD operations visually.
demo-mongo-crud.mp4
Before you can run the project, ensure that the following are installed:
- Java 21.0.3: Required to compile and run the Spring Boot application.
- Apache Maven 3.9.8: Manages dependencies and builds the project.
- Spring Boot 3.3.3: Framework for building RESTful services and connecting to MongoDB.
- MongoDB Atlas Account: A cloud MongoDB cluster is needed to store and retrieve data.
Follow these steps to set up and run the project:
-
Clone the repository:
git clone https://github.com/ittovate/mongodb-crud
-
Navigate to the project directory:
cd mongodb-crud
-
Set up environment variables: Configure your environment variables to connect to MongoDB:
- Duplicate the
src/main/resources/keys.env
file. - Rename the copied file to
.env
. - Open
.env
and replace the placeholder with your MongoDB credentials.
- Duplicate the
-
Build and run the project: Use Maven to build the project and start the application:
mvn clean install spring-boot:run
-
Stop the service: Once you're done testing, stop the service by pressing
CTRL + C
in the terminal.