Sign inSign up

raonigabriel/spring-qrcode-example

By raonigabriel

Updated about 5 years ago

A Spring REST based generator of QRCodes.

Image
0

885

raonigabriel/spring-qrcode-example repository overview

Maven Build

Spring Boot QrCode Example

Demonstrates some of the capabilities of the Spring Boot framework through a small, simple example. After reviewing this example, you should have a good understanding of what Spring Boot can do and get a feel for how easy it is to use. #Features:

  1. Spring Boot 2.3.0, supporting fully executable JARs for Linux based operating systems, including “service” support
  2. WebFlux rest controller to generate qrcode images
  3. Produces binary Content-Type (PNG)
  4. HTTP header manipulation (Cache-Control)
  5. Java Exception translation to HTTP status code
  6. Manual cache eviction (HTTP DELETE)
  7. CORS enabled (GET, DELETE)
  8. Reactive processing (for the image creation)
  9. Uses the Google zxing library
  10. Spring IoC (Service, Autowired)
  11. Backend caching (Spring "simple" memory-based ConcurrentHashMap)
  12. Schedulled tasks. Automatic cache eviction, every 30 minutes.
  13. Logging (sl4j + logback)
  14. Only 2 classes, about 100 lines of code!!!
  15. Small. Final JAR includes everything (it self-contained) and it's about 17 MB

To get the code:

Clone the repository:

$ git clone https://github.com/raonigabriel/spring-qrcode-example.git

If this is your first time using Github, review http://help.github.com to learn the basics.

To run the application:

From the command line with Maven:

$ cd spring-qrcode-example
$ mvn spring-boot:run 

From the command line with Linux:

$ cd spring-qrcode-example/target
$ ./spring-qrcode-example-1.3.1.jar

Using docker:

$ docker run -d --name qrcode-service --rm -p 8080:8080 raonigabriel:spring-qrcode-example

Access the deployed web application http://localhost:8080/qrcode?text=Hello%20World%20From%20Spring

or

In your preferred IDE such as SpringSource Tool Suite (STS) or IDEA:

  • Import spring-qrcode-example as a Maven Project

License

Released under the Apache 2.0 license

Tag summary

Content type

Image

Digest

Size

71.3 MB

Last updated

about 5 years ago

docker pull raonigabriel/spring-qrcode-example