Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 1.57 KB

README.md

File metadata and controls

31 lines (24 loc) · 1.57 KB

PIN Generator - James Ibberson

Tools

  • Laravel 7
  • Vue 2
  • Docker / Docker Compose

The Application

The application is a PIN (personal identification number) generator. It can output 1 to 10 PINs at a time.

Requirements

  • Each PIN comprises four numeric digits (e.g. “2845”),
  • No “obvious” numbers (such as “1111”),
  • PINs should appear in apparently random order,
  • Not repeat PINs until all the preceding valid PINs have been emitted - even if the program is stopped and started between PINs.

Approach

In order to meet the requirements, PINs generated by this program will:

  • consist of all unique digits
  • contain sequences of consecutive numbers no longer than 2

All the possible PINs are pre-generated and stored in the database, then returned to user in a random order.
Each PIN that is returned is marked as used, until all PINs have been used. Then, used markers are reset and so on.

The application has been modeled as a JSON endpoint to retrieve the PINs, and a set of Vue components to call the endpoint and use the data.

Running The Application Locally

Assuming you have Docker and Docker Compose installed, the Docker development environment can be initialised with the docker-init.sh bash script.
Once initialised the application can be brought up using docker-compose up. The command will remain running until you exit it, and the containers will be shut down. To run the containers in the background, then add the -d option to the command. Once running in the background, the containers can be shut down by running docker-compose stop