Coding Challenge
Full-stack
This coding challenge has been created to evaluate the skills of a full stack Laravel developer. Given the complete freedom on how to solve the challenge, an understanding of best practices and patterns will emerge.
Challenge
Fork this repository and create a pull request when the challenge is complete.
You are given two tables books and shelves. A book belongs to a shelf. Shelves have many books.
You are asked to:
Create a new route (eg: /shelf/{shelf_slug}/read) which will display all books belonging to that shelf (name, ISBN). When a user clicks on the book name, make an ajax request to (/api/metadata/read/all) and log to the console the metadata for that specific book.
How you achieve this result is completely up to you.
There is an optional task defined in the optional.md file.
Bonus points (in order of importance):
- Using ES6 javascript
- Not using jQuery for the AJAX call
- Applying your own custom CSS
- Displaying the metadata on the page instead of logging it to the console
- Unit testing
- Using the repository pattern to abstract Eloquent interactions
Please note that the time taken to complete this challenge will be taken into consideration, starting when you fork the repository and ending with the pull request.
Please follow these coding guidelines:
Required Knowledge
- PHP 7.1
- Javascript
- MySQL
- NPM
- Composer
- GIT
- MVC Pattern
- ORMs
Recommended
- ES6
- Laravel
- Eloquent
- PHP Unit
Software requirements
- Composer
- NPM
- Local webserver running PHP 7.1 and MySQL 5.5+ (if you are running OSx Valet is a quick solution)
Install
Clone and create the .env file (an example has been provided in the _env folder)
Run:
composer install
cp _env/local.env .env
php artisan migrate
php artisan db:seed
npm install
npm run dev
Make sure everything is working on your local server. Visiting / should display "Welcome!". Double check by running the provided unit tests.
vendor/bin/phpunit --verbose
You can run the linter using this command
./node_modules/.bin/eslint resources/assets/js/app.js
License
MIT license. Feel free to remix, use and contribute to this coding challenge. Just make sure to let me know in the pull request this is not from a candidate.