Skip to content

ittovate/demo-mongo-crud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

👋 Introduction

  • This is a CRUD demo project that demonstrates basic Create, Read, Update, and Delete (CRUD) operations using MongoDB on the cloud.

Visual Representation

  • 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

⚠ Prerequisites

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.

⚡ Running the Project

Follow these steps to set up and run the project:

  1. Clone the repository:

    git clone https://github.com/ittovate/mongodb-crud
  2. Navigate to the project directory:

    cd mongodb-crud
  3. Set up environment variables: Configure your environment variables to connect to MongoDB:

    1. Duplicate the src/main/resources/keys.env file.
    2. Rename the copied file to .env.
    3. Open .env and replace the placeholder with your MongoDB credentials.
  4. Build and run the project: Use Maven to build the project and start the application:

    mvn clean install spring-boot:run
  5. Try it out!

  6. Stop the service: Once you're done testing, stop the service by pressing CTRL + C in the terminal.