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
- Host: GitHub
- URL: https://github.com/gustavohnsv/springboot-mongodb-image_upload
- Owner: gustavohnsv
- Created: 2024-07-22T18:52:15.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-04T00:20:17.000Z (over 1 year ago)
- Last Synced: 2025-07-11T23:43:41.045Z (12 months ago)
- Topics: images, java-17, maven, mongodb, spring-boot, thymeleaf
- Language: Java
- Homepage:
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```