Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ittovate/demo-mongo-crud
MongoDB CRUD Demo
https://github.com/ittovate/demo-mongo-crud
maven mongodb spring
Last synced: about 9 hours ago
JSON representation
MongoDB CRUD Demo
- Host: GitHub
- URL: https://github.com/ittovate/demo-mongo-crud
- Owner: ittovate
- Created: 2024-09-23T09:02:25.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2024-09-30T17:43:43.000Z (about 1 month ago)
- Last Synced: 2024-11-08T11:14:29.462Z (about 9 hours ago)
- Topics: maven, mongodb, spring
- Language: Java
- Homepage:
- Size: 60.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: docs/README.md
Awesome Lists containing this project
README
# 👋 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.
# âš 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**:
```bash
git clone https://github.com/ittovate/mongodb-crud
```
2. **Navigate to the project directory**:
```bash
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:
```bash
mvn clean install spring-boot:run
```
5. [Try it out!](http://localhost:8080/swagger-ui/index.html)
6. **Stop the service**:
Once you're done testing, stop the service by pressing `CTRL + C` in the terminal.