Skip to content

Rapter1990/qr-generator-example

Repository files navigation

Spring Boot QR Generator Example

Main Information

📖 Information

  • The application receives the requested information to generate QR code containing text message, color, background color and size with file upload option or not through through `/api/v1/qr-generator`
  • The QR code is generated through validations defined below
    • color validation to check whether color is defined as hex color code
    • text length validation to check whether text is ranged between two defined length size (1-50)
    • Size validation to check whether if the size should be defined as small, medium and lastly large

Explore Rest APIs

Method Url Description Valid Request Params
POST /api/v1/qr-generator Qr Code Generator with Image Info
POST /api/v1/qr-generator Qr Code Generator without Image Info

Valid Request Body

    http://localhost:8080/api/v1/qr-generator
    
    form-data
    text : Merhaba
    size : small
    color : #0046FF
    backgroundColor : #64FF00
    imageFile : File Upload

Main Information

    http://localhost:8080/api/v1/qr-generator
    
    form-data
    text : Merhaba
    size : small
    color : #0046FF
    backgroundColor : #64FF00

Main Information

Technologies


  • Java 17
  • Spring Boot 3.0
  • Open API Documentation
  • Restful API
  • Spring Boot Validation
  • Google Zxing Core
  • Google Zxing Java Standart Edition (SE)
  • Lombok
  • Maven
  • Junit5
  • Mockito
  • Integration Tests
  • Docker
  • Docker Compose

Prerequisites


  • Maven or Docker

Docker Run

The application can be built and run by the Docker engine. The Dockerfile has multistage build, so you do not need to build and run separately.

Please follow directions shown below in order to build and run the application with Docker Compose file;

$ cd qr-generator-example
$ docker-compose up -d

Maven Run

To build and run the application with Maven, please follow the directions shown below;

$ cd qr-generator-example
$ mvn clean install
$ mvn spring-boot:run

Swagger

You can reach the swagger-ui through the link shown below

    http://localhost:8080/swagger-ui/index.html

Screenshots

Click here to show the screenshots of project

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7