Skip to content

Application that generates QR codes that can store large amounts of data and are easily read by smartphones.

License

Notifications You must be signed in to change notification settings

fkamau1/qrcode-generator

Repository files navigation

QR Code Generator

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.

Getting Started

Prerequisites

  • Java Development Kit (JDK) 17 or higher
  • Gradle

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/qrcode-generator.git
  2. Navigate to the project directory:

    cd qrcode-generator
  3. Build the project

    gradle build
  4. 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.

Docker

A copy of this application can also be pulled from the docker hub:

  1. Install docker

    sudo yum install -y docker
  2. Start docker engine

    sudo service docker start
  3. Create image and run container

    sudo docker run -d -p 80:8080 fkamau1/aws-qrcode:2.0

API Endpoints

Health Check

Description: Check the health status of the application.

  • Endpoint: /api/health

  • Method: GET

  • Response:

    OK
    

Generate QR Code

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
    

Error Handling

  • The API provides informative error messages for invalid requests.

Configuration

  • The default configuration can be modified in the application.properties file.

Dependencies

License

  • This project is licensed under the MIT License - see the LICENSE file for details.

About

Application that generates QR codes that can store large amounts of data and are easily read by smartphones.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published