- Laravel 7
- Vue 2
- Docker / Docker Compose
The application is a PIN (personal identification number) generator. It can output 1 to 10 PINs at a time.
- 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.
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.
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