SpringBoot x QR code - PixelForest x REST
Gautam Kumar

Gautam Kumar @gautamverma7

Joined:
Aug 28, 2024

SpringBoot x QR code - PixelForest x REST

Publish Date: May 17
3 5

Hahaha yes, spring too can do this ;)

How REST fits in my app
The resource is the QR code image generated from the text.
The HTTP method is GET — retrieving a resource (the QR code).
The text parameter controls which QR code is generated.
The server responds with an image directly, instead of JSON.

Image description

You can create the project via Spring Initializr or with the CLI:

spring init --boot-version=3.5.3 --java-version=21
cd PixelForest
Enter fullscreen mode Exit fullscreen mode

Add these dependencies to your project

<dependency>
  <groupId>com.google.zxing</groupId>
  <artifactId>core</artifactId>
  <version>3.5.0</version>
</dependency>
<dependency>
  <groupId>com.google.zxing</groupId>
  <artifactId>javase</artifactId>
  <version>3.5.0</version>
</dependency>
Enter fullscreen mode Exit fullscreen mode

Tools Used
Spring Boot 3.5
Java 21
Maven
Google ZXing (QR code library)

Refer to this link to know more about ZXing Library = ZXing

Refer to this GitHub link for the complete project = PixelForest

Ways to Extend It

Add JWT auth to secure the endpoint 🔐
Store QR codes in the cloud or database 💾
Build a React/Vue frontend for it 🎨
Make it scanable from mobile apps 📱

Feel Free to create PRs for my project and enhance it

Comments 5 total

Add comment