https://github.com/gustavohnsv/springboot-mongodb-client
Repositório dedicado ao estudo do framework Spring Boot, utilizando Java, Gradle e MongoDB. Contém uma API REST básica de CRUD de clientes e de carrinhos de compra
https://github.com/gustavohnsv/springboot-mongodb-client
api-rest crud-application gradle java-17 mongodb spring-boot
Last synced: about 2 months ago
JSON representation
Repositório dedicado ao estudo do framework Spring Boot, utilizando Java, Gradle e MongoDB. Contém uma API REST básica de CRUD de clientes e de carrinhos de compra
- Host: GitHub
- URL: https://github.com/gustavohnsv/springboot-mongodb-client
- Owner: gustavohnsv
- Created: 2024-06-21T22:20:19.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-09T13:33:01.000Z (almost 2 years ago)
- Last Synced: 2025-04-03T09:12:54.562Z (about 1 year ago)
- Topics: api-rest, crud-application, gradle, java-17, mongodb, spring-boot
- Language: Java
- Homepage:
- Size: 53.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🌐 CRUD operations with Spring Boot Java Framework
- Link to access the base API url:
```
localhost:8080/api/clients/
```
- If you want test the application in your localhost, make sure to make a Cluster in mongoDB and follow this steps:
1. Make a `.env` file in root folder *(/clients)*
2. In the file, insert this line:
```
MONGODB_URI=your-mongodb-uri
```
- Make sure you have a client for HTTP requests, like Insomnia or Postman
- Make sure you have Java 17 or later
- This project use Gradle
# ⚙️ Using

# 📶 Endpoints
```
GET localhost:8080/api/
GET localhost:8080/api/clients/
GET localhost:8080/api/carts/
GET localhost:8080/api/clients/{id}
GET localhost:8080/api/carts/{cart_id}
POST localhost:8080/api/clients/
POST localhost:8080/api/carts/?id={owner_id}
POST localhost:8080/api/carts/{cartID}/
PATCH localhost:8080/api/clients/?id={id}
PUT localhost:8080/api/carts/{cart_id}/
DELETE localhost:8080/api/clients/?id={id}
DELETE localhost:8080/api/carts/?id={cart_id}
DELETE localhost:8080/api/carts/{cart_id}/
```
# 🌳 Repository Tree (maybe changed often)
```
.
├── build.gradle
├── gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── HELP.md
├── README.md
├── settings.gradle
└── src
├── main
│ ├── java
│ │ └── com
│ │ └── gustavohnsv
│ │ └── clients
│ │ ├── ClientsApplication.java
│ │ ├── config
│ │ │ └── DotenvConfig.java
│ │ ├── controller
│ │ │ ├── ClientController.java
│ │ │ ├── HomeController.java
│ │ │ └── ShoppingCartsController.java
│ │ ├── exception
│ │ │ ├── CustomExceptionHandler.java
│ │ │ ├── ResourceAlreadyExistsException.java
│ │ │ ├── ResourceNotFoundException.java
│ │ │ ├── TooFewArgumentsException.java
│ │ │ └── WrongArgumentsException.java
│ │ ├── model
│ │ │ ├── Client.java
│ │ │ ├── Message.java
│ │ │ ├── ProductInfo.java
│ │ │ ├── Product.java
│ │ │ └── ShoppingCart.java
│ │ └── repository
│ │ ├── ClientRepository.java
│ │ └── ShoppingCartsRepository.java
│ └── resources
│ ├── application.properties
│ ├── static
│ └── templates
└── test
└── java
└── com
└── gustavohnsv
└── clients
└── ClientsApplicationTests.java
```