lukebell / qr-auth-svc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QR Code Authentication API

This Application generates and validates QR Codes and UUID

Contents

The mapping of the URI path space is presented in the following table:

URI path Resource class HTTP methods
/qr/generate QRCodeEndpoint POST
/qr/validate QRCodeEndpoint POST
/config ConfigEndpoint GET
/config/{id} ConfigEndpoint GET
/config ConfigEndpoint POST
/config/{id} ConfigEndpoint PUT
/config/{id} ConfigEndpoint DELETE

Application is configured:

  • Without web.xml with SpringBoot and Jersey
  • Jersey/Spring annotations registers resources
  • HikariCP manage database pool connection
  • SpringJDBCTemplate to save and retrieve data from MySQL Database
  • EHCache to cache configurations
  • Swagger as Rest API Documentation

Running the API

Run the API as follows:

mvn clean package spring-boot:run

Once deployed, the application is ready to serve the following resources:

Swagger Documentation

SwaggerUI

Docker Configuration

QR Auth API

The following instructions will guide you for the basic usage of this image

  • First build project

      mvn clean install
    
  • Start the API

      docker run -d --name=qr-auth-api --restart=always --cpuset-cpus="0-3" --memory="2048m" --log-opt max-file=3 --log-opt max-size=50m  qr-auth-api:latest
    
  • Alternatively you could run the executable jar:

      java -jar qr-auth-svc-0.0.1-SNAPSHOT.jar -Xms512m -Xmx1024m -XX:MaxPermSize=1024m -XX:PermSize=1024
    
      or
    
      nohup java -jar qr-auth-svc-0.0.1-SNAPSHOT.jar -Xms512m -Xmx1024m -XX:MaxPermSize=1024m -XX:PermSize=1024 &        
    

MySQL

  docker run --name mysql --restart=always -v /tmp/mysql/data/:/var/lib/mysql -d -p 3306:3306 -e MYSQL_ROOT_PWD=toor -e MYSQL_USER=swAuth -e MYSQL_USER_PWD=sw4uth -e MYSQL_USER_DB=auth leafney/docker-alpine-mysql

SUPPORT

Contact me:

About


Languages

Language:Java 94.9%Language:HTML 4.7%Language:Dockerfile 0.4%