- Clone this project and run
docker-compose up -d
to initialize the container. Note:hammer
database will be created after this setup. - After successful building containers you should see 4 containers running.
- Test you connection to mysql via sequal pro by using creds given in .env file. Note: If you are not able to login then ssh into mysql container and run this command
mysql -u root < /docker-entrypoint-initdb.d/createdb.sql
now you should be able to login bydefault
username. - Login to php container and run
composer install && php artisan migrate --seed
command. This will install dependencies and will create necessary tables and seed them with initial data such as services and cities. - Now you are ready to test api. Please visit https://cvee.gitbook.io/my-hammer/ to get api documentation.
- You can check routes api.php file inside routes folder.
- Initial database schema insider
2018_08_13_173327_create_jobs_setup
file indatabase/migrations
folder - Initial database table data in
DatabaseSeeder
class indatabase/seeds
folder. - JobController in
app/Http/Controllers
. - JobValidation logic in
app/Http/Requests/ValidateJobRequest.php
file. - I would have wrote test cases for this but found it will be too overwhelming.
- If you are facing issue with docker then you can use https://box.scotch.io/ vagrant file present in the directory. Then you need to manual setup database connection and overwrite in .env file