List of technologies I used for this exam.
- PHP 7
- MYSQL
- PHPUNIT
- Laravel Framework 5.5
- React JS/jQuery
Customer's List
- Has an ability to open up a modal and add a customer.
- Has an ability to open up a modal and edit a customer.
- Has a default image.
- Everything is the form is required.
- Email is unique and must be in the right format.
- Auto Upload Picture only works on edit, also deletes the old image.
- Has a link to the view page.
View
- Able to display customer information.
- Has a calculator with iframes structure.
Screen Share
- Please force the page to be HTTPS.
- Please install plugin.
- Shows a button to share screen.
- Links a button to a streaming page.
Modular Structure
My approach is modular structure see in app/Modules/* and these modules can be setup in config/modules.php. This service is registered in config/app.php and the service class is in app/Providers/ModularServiceProvider.php.
I also have form handlers so controllers is much easier to read. Files are located in app/Handlers/Services/*
Repository Pattern
Also applied repository pattern as I don't want to bloat my models as well and I think it's a good way to have a good quality code, handle queries in much more larger apps and much more flexible in switching databases. This is registered via provider as well in config/app.php and file is app/Providers/RepositoryProvider.
Routing
I have 2 controllers for the customer's basic crud and auto upload photo(on edit). I did this just to be true to the resourceful routes which I avoid adding functions rather than the 7 resourceful routs so I extracted the auto upload in a new controller, Reason is for me, It's much more cleaner, well structured and readable code.
Although exception for the calculator module I just applied the all of it in a single controller cause I don't think this one needs to be restful.
React JS
My react js is being compiled via webpack. See webpack.mix.js. My javascript files is located in resources/assets/js/*
PHP UNIT
I've written down several integration tests for backend and a little unit test because not much classes to test. Location is in /tests/*