An open API service indexing awesome lists of open source software.

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

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

```