This is a QR code generator application implemented using Spring Boot and the ZXing API library. The application provides a RESTful API endpoint to generate QR codes based on user input.
- Java Development Kit (JDK) 17 or higher
- Gradle
-
Clone the repository
git clone https://github.com/yourusername/qrcode-generator.git
-
Navigate to the project directory:
cd qrcode-generator
-
Build the project
gradle build
-
Run the application:
java -jar build/libs/qrcode-generator-0.0.1-SNAPSHOT.jar
The application will start, and you can access it at http://localhost:8080
. You will need the API endpoints below to process requests.
A copy of this application can also be pulled from the docker hub:
-
Install docker
sudo yum install -y docker
-
Start docker engine
sudo service docker start
-
Create image and run container
sudo docker run -d -p 80:8080 fkamau1/aws-qrcode:2.0
Description: Check the health status of the application.
-
Endpoint: /api/health
-
Method: GET
-
Response:
OK
Description: Generate a QR code based on the provided parameters.
-
Endpoint: /api/qrcode
-
Method: GET
-
Parameters:
- contents (required): The data to be encoded in the QR code.
- size (optional): The size of the QR code (default: 250 pixels).
- correction (optional): Error correction level (L, M, Q, H - default: L).
- type (optional): Image type (png, jpeg, gif - default: png).
-
Response: QR code image in the specified format.
http://localhost:8181/api/qrcode?contents=https://www.google.com/&size=250&type=png
- The API provides informative error messages for invalid requests.
- The default configuration can be modified in the
application.properties
file.
- This project is licensed under the MIT License - see the LICENSE file for details.