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

https://github.com/gustavohnsv/springboot-mongodb-image_upload

RepositΓ³rio de gerenciamento de imagens para um banco de dados
https://github.com/gustavohnsv/springboot-mongodb-image_upload

images java-17 maven mongodb spring-boot thymeleaf

Last synced: 3 months ago
JSON representation

RepositΓ³rio de gerenciamento de imagens para um banco de dados

Awesome Lists containing this project

README

          

# 🌐 Image Management in Database with Spring Boot Java Framework

- Link to access the base API url:
```
localhost:8080/
```

- Link to acess the site url:
```
localhost:8080/api/
```

# βš™οΈ Program Language & Tools







# πŸ‹ How to run with Docker

- Generate application `.jar` file:
```
./mvnw clean package
```
- Build Docker application image
```
docker build -t .
```
- Run Docker image
```
docker run --env-file .env -p 8080:8080
```

# πŸ“Ά Endpoints

```
# Site Endpoints
GET localhost:8080/
GET localhost:8080/img/

# API Endpoints
GET localhost:8080/csrf-token
GET localhost:8080/api/images/
GET localhost:8080/api/images/image/?id={id}
GET localhost:8080/api/images/image/download/?id={id}
GET localhost:8080/api/images/image/count/
POST localhost:8080/api/images/image/
DELETE localhost:8080/api/images/image/?id={id}
HEAD localhost:8080/api/images/image/?id={id}
OPT localhost:8080/api/images/image/

to POST, DELETE, PATCH..., obtain 'csrf-token' first
to API ADMIN access, user='admin' and password='password'
to API USER acess, user='user' and password='password'
```

# 🌳 Repository Tree (maybe changed often)

```
.
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ mvnw
β”œβ”€β”€ mvnw.cmd
β”œβ”€β”€ pom.xml
β”œβ”€β”€ README.md
└── src
β”œβ”€β”€ main
β”‚Β Β  β”œβ”€β”€ java
β”‚Β Β  β”‚Β Β  └── org
β”‚Β Β  β”‚Β Β  └── gustavohnsv
β”‚Β Β  β”‚Β Β  └── imageupload
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ config
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ DotenvConfig.java
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ MongoConfig.java
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── SecurityConfig.java
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ controller
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ CsrfTokenController.java
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ ImageController.java
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── SiteController.java
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ ImageUploadApplication.java
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ model
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ Image.java
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── Message.java
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ repository
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── ImageRepository.java
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ service
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ ImageService.java
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── ResolutionType.java
β”‚Β Β  β”‚Β Β  └── util
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ ImageCompressionUtil.java
β”‚Β Β  β”‚Β Β  └── ImageResizeUtil.java
β”‚Β Β  └── resources
β”‚Β Β  β”œβ”€β”€ application.properties
β”‚Β Β  β”œβ”€β”€ static
β”‚Β Β  β”‚Β Β  └── img
β”‚Β Β  β”‚Β Β  └── folderback_java.ico
β”‚Β Β  └── templates
β”‚Β Β  β”œβ”€β”€ Home.html
β”‚Β Β  └── Images.html
└── test
└── java
└── org
└── gustavohnsv
└── imageupload
β”œβ”€β”€ ImageUploadApplicationTests.java
└── test
└── ImageControllerTest.java
```