Skip to content

Spring boot application exposing REST API endpoint to genrate QR-code representing custom message and another endpoint to read the decoded message, built using Java Spring boot and google's zxing library

Notifications You must be signed in to change notification settings

thecoder8890/spring-boot-qr-code-generator-reader-api

Repository files navigation

QR-code Generator and Reader

Java CI with Maven

Application used Java 17 and Spring Boot 3.5.0 | Onurdesk

Spring boot application exposing REST API endpoint to genrate QR-code representing custom message and another endpoint to read the decoded message, built using Java, Spring Boot 3.5.0 and google's zxing library.
Running Application

Local Setup

Recommended way is to use sdkman for installing both maven and java

Run the below commands in the core

mvn clean install
mvn spring-boot:run

server port is configured to 9090 which can be changed in application.properties file

Go to the below url to view swagger-ui (API docs)

http://localhost:9090/swagger-ui.html

Testing

The core QR code generation and reading functionalities are tested in src/test/java/com/onurdesk/iris/service/QrCodeServiceTests.java. These tests cover:

  • Positive Scenarios:
    • Successful QR code generation with valid text input.
    • Successful reading and decoding of a valid QR code image.
  • Negative Scenarios:
    • Attempting QR code generation with null or invalid DTO.
    • Handling of empty title during QR code generation.
    • Attempting to read invalid image files (not images or not QR codes).
    • Attempting to read QR codes with unexpected content (not deserializable to the expected DTO).
    • Handling I/O exceptions during file reading.

Running Tests

You can run the tests using Maven:

mvn test

Alternatively, running mvn clean install will also execute the tests as part of the build lifecycle.

About

Spring boot application exposing REST API endpoint to genrate QR-code representing custom message and another endpoint to read the decoded message, built using Java Spring boot and google's zxing library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages