- Clone the repository
After cloning type the next commands:
cd < Laravel folder >
- Configure the Laravel:
IMPORTANT: Copy the .env.example
file to the .env
and specify all needed data
Set proper DB user and password in .env
file and do command
DB settings for .env:
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=random
DB_USERNAME=<username>
DB_PASSWORD=<password>
DB_ROOT_PASSWORD=<root password>
run command:
sh ./first_start.sh
NOTE: The script will ask about user's password because it run sudo for some command. Command will generate the application key. Also script do automatic migration with seeder. After this the numbers' table will contain 5 randomized numbers.
Also, the test user will be created with next credentials:
user: admin
email: [email protected]
pass: 'password'
-
Start with Laravel
- URL: localhost:5000
- DB: works on port 8100
-
PhpMyAdmin
To use PhpMyAdmin just go to URL: localhost:8080
user: <DB_USERNAME>
password: <DB_PASSWORD>
-
Swagger
Main Swagger page available on localhost:5000/api/v1/documentation. Or press the button on the homepage.
Api has three part:
- Auth - generate the JWT-token used to work with protected URI
- With Authentication - used for generate new number and store it to the database. To use it proper token must be provided.
- Without Authentication - get the stored number from database by its ID.
From Swagger page one can check all API's functionality.
- To do complex tests type the command:
docker exec -it app php artisan test
Test cover as Unit as Feature tests.